summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorMeaglith Ma <genedna@gmail.com>2014-04-23 12:29:53 +0800
committerMeaglith Ma <genedna@gmail.com>2014-04-23 12:29:53 +0800
commitee7bfe2ebe3a453beff5e8d4c1436061d321acfe (patch)
tree02575fe703fdcfaa2bd6450b852734d9305c9ce6 /templates
parentb270b34c98b10b0e4807048890e883b6b06a6461 (diff)
parentf0cdf30134e62be6bf5924735a6145769e495cfc (diff)
downloadgitea-ee7bfe2ebe3a453beff5e8d4c1436061d321acfe.tar.gz
gitea-ee7bfe2ebe3a453beff5e8d4c1436061d321acfe.zip
Add memcached and redis Docker supported
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/config.tmpl30
-rw-r--r--templates/admin/dashboard.tmpl2
-rw-r--r--templates/admin/users/edit.tmpl2
-rw-r--r--templates/admin/users/new.tmpl2
-rw-r--r--templates/base/alert.tmpl2
-rw-r--r--templates/base/head.tmpl17
-rw-r--r--templates/base/navbar.tmpl30
-rw-r--r--templates/home.tmpl21
-rw-r--r--templates/install.tmpl14
-rw-r--r--templates/issue/create.tmpl3
-rw-r--r--templates/issue/view.tmpl2
-rw-r--r--templates/mail/auth/active_email.tmpl6
-rw-r--r--templates/mail/auth/register_success.tmpl8
-rw-r--r--templates/mail/auth/reset_passwd.tmpl33
-rw-r--r--templates/release/list.tmpl60
-rw-r--r--templates/release/new.tmpl70
-rw-r--r--templates/repo/commits.tmpl23
-rw-r--r--templates/repo/create.tmpl14
-rw-r--r--templates/repo/diff.tmpl344
-rw-r--r--templates/repo/migrate.tmpl99
-rw-r--r--templates/repo/nav.tmpl12
-rw-r--r--templates/repo/setting.tmpl45
-rw-r--r--templates/repo/single_list.tmpl63
-rw-r--r--templates/repo/toolbar.tmpl8
-rw-r--r--templates/status/401.tmpl6
-rw-r--r--templates/status/404.tmpl4
-rw-r--r--templates/status/500.tmpl4
-rw-r--r--templates/user/activate.tmpl36
-rw-r--r--templates/user/dashboard.tmpl17
-rw-r--r--templates/user/delete.tmpl16
-rw-r--r--templates/user/forgot_passwd.tmpl32
-rw-r--r--templates/user/password.tmpl7
-rw-r--r--templates/user/profile.tmpl19
-rw-r--r--templates/user/publickey.tmpl8
-rw-r--r--templates/user/reset_passwd.tmpl26
-rw-r--r--templates/user/setting.tmpl11
-rw-r--r--templates/user/setting_nav.tmpl1
-rw-r--r--templates/user/signin.tmpl36
-rw-r--r--templates/user/signup.tmpl21
-rw-r--r--templates/user/social.tmpl17
40 files changed, 664 insertions, 507 deletions
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index 31cfb77bad..d25d40275a 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -62,8 +62,8 @@
<dl class="dl-horizontal admin-dl-horizontal">
<dt>Register Email Confirmation</dt>
<dd><i class="fa fa{{if .Service.RegisterEmailConfirm}}-check{{end}}-square-o"></i></dd>
- <dt>Disenable Registeration</dt>
- <dd><i class="fa fa{{if .Service.DisenableRegisteration}}-check{{end}}-square-o"></i></dd>
+ <dt>Disable Registration</dt>
+ <dd><i class="fa fa{{if .Service.DisableRegistration}}-check{{end}}-square-o"></i></dd>
<dt>Require Sign In View</dt>
<dd><i class="fa fa{{if .Service.RequireSignInView}}-check{{end}}-square-o"></i></dd>
<dt>Mail Notification</dt>
@@ -88,12 +88,34 @@
<dl class="dl-horizontal admin-dl-horizontal">
<dt>Enabled</dt>
<dd><i class="fa fa{{if .MailerEnabled}}-check{{end}}-square-o"></i></dd>
- <dt>Name</dt>
+ {{if .MailerEnabled}}<dt>Name</dt>
<dd>{{.Mailer.Name}}</dd>
<dt>Host</dt>
<dd>{{.Mailer.Host}}</dd>
<dt>User</dt>
- <dd>{{.Mailer.User}}</dd>
+ <dd>{{.Mailer.User}}</dd>{{end}}
+ </dl>
+ </div>
+ </div>
+
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ OAuth Configuration
+ </div>
+
+ <div class="panel-body">
+ <dl class="dl-horizontal admin-dl-horizontal">
+ <dt>Enabled</dt>
+ <dd><i class="fa fa{{if .OauthEnabled}}-check{{end}}-square-o"></i></dd>
+ {{if .OauthEnabled}}<dt>GitHub</dt>
+ <dd><i class="fa fa{{if .Oauther.GitHub}}-check{{end}}-square-o"></i></dd>
+ <dt>Google</dt>
+ <dd><i class="fa fa{{if .Oauther.Google}}-check{{end}}-square-o"></i></dd>
+ <dt>Tencent QQ</dt>
+ <dd><i class="fa fa{{if .Oauther.Tencent}}-check{{end}}-square-o"></i></dd>
+ <dt>Weibo</dt>
+ <dd><i class="fa fa{{if .Oauther.Weibo}}-check{{end}}-square-o"></i></dd>
+ {{end}}
</dl>
</div>
</div>
diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl
index 2334c676d9..76539842d2 100644
--- a/templates/admin/dashboard.tmpl
+++ b/templates/admin/dashboard.tmpl
@@ -9,7 +9,7 @@
</div>
<div class="panel-body">
- Gogs database has <b>{{.Stats.Counter.User}}</b> users, <b>{{.Stats.Counter.PublicKey}}</b> SSH keys, <b>{{.Stats.Counter.Repo}}</b> repositories, <b>{{.Stats.Counter.Watch}}</b> watches, <b>{{.Stats.Counter.Action}}</b> actions, and <b>{{.Stats.Counter.Access}}</b> accesses.
+ Gogs database has <b>{{.Stats.Counter.User}}</b> users, <b>{{.Stats.Counter.PublicKey}}</b> SSH keys, <b>{{.Stats.Counter.Repo}}</b> repositories, <b>{{.Stats.Counter.Watch}}</b> watches, <b>{{.Stats.Counter.Action}}</b> actions, <b>{{.Stats.Counter.Access}}</b> accesses, <b>{{.Stats.Counter.Issue}}</b> issues, <b>{{.Stats.Counter.Comment}}</b> comments, <b>{{.Stats.Counter.Mirror}}</b> mirrors, <b>{{.Stats.Counter.Oauth}}</b> oauthes, <b>{{.Stats.Counter.Release}}</b> releases.
</div>
</div>
diff --git a/templates/admin/users/edit.tmpl b/templates/admin/users/edit.tmpl
index 5db2c7a95e..da9a67cfae 100644
--- a/templates/admin/users/edit.tmpl
+++ b/templates/admin/users/edit.tmpl
@@ -11,8 +11,8 @@
<div class="panel-body">
<br/>
<form action="/admin/users/{{.User.Id}}" method="post" class="form-horizontal">
- {{if .IsSuccess}}<p class="alert alert-success">Account profile has been successfully updated.</p>{{else if .HasError}}<p class="alert alert-danger form-error">{{.ErrorMsg}}</p>{{end}}
{{.CsrfTokenHtml}}
+ {{template "base/alert" .}}
<input type="hidden" value="{{.User.Id}}" name="userId"/>
<div class="form-group">
<label class="col-md-3 control-label">Username: </label>
diff --git a/templates/admin/users/new.tmpl b/templates/admin/users/new.tmpl
index 7f441f32b3..4c851e3144 100644
--- a/templates/admin/users/new.tmpl
+++ b/templates/admin/users/new.tmpl
@@ -12,7 +12,7 @@
<br/>
<form action="/admin/users/new" method="post" class="form-horizontal">
{{.CsrfTokenHtml}}
- <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div>
+ {{template "base/alert" .}}
<div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}">
<label class="col-md-3 control-label">Username: </label>
<div class="col-md-7">
diff --git a/templates/base/alert.tmpl b/templates/base/alert.tmpl
new file mode 100644
index 0000000000..bb1eb6aab1
--- /dev/null
+++ b/templates/base/alert.tmpl
@@ -0,0 +1,2 @@
+{{if .Flash.ErrorMsg}}<div class="alert alert-danger form-error">{{.Flash.ErrorMsg}}</div>{{end}}
+{{if .Flash.SuccessMsg}}<div class="alert alert-success">{{.Flash.SuccessMsg}}</div>{{end}} \ No newline at end of file
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index 7f56ed7080..68231391c0 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -9,16 +9,27 @@
<meta name="description" content="Gogs(Go Git Service) is a GitHub-like clone in the Go Programming Language" />
<meta name="keywords" content="go, git">
<meta name="_csrf" content="{{.CsrfToken}}" />
+ {{if .Repository.IsGoget}}<meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">{{end}}
<!-- Stylesheets -->
+ {{if IsProdMode}}
+ <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
+ <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
+
+ <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
+ <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
+ {{else}}
<link href="/css/bootstrap.min.css" rel="stylesheet" />
- <link href="/css/todc-bootstrap.min.css" rel="stylesheet" />
<link href="/css/font-awesome.min.css" rel="stylesheet" />
- <link href="/css/markdown.css" rel="stylesheet" />
- <link href="/css/gogs.css" rel="stylesheet" />
<script src="/js/jquery-1.10.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
+ {{end}}
+
+ <link href="/css/todc-bootstrap.min.css" rel="stylesheet" />
+ <link href="/css/markdown.css" rel="stylesheet" />
+ <link href="/css/gogs.css" rel="stylesheet" />
+
<script src="/js/lib.js"></script>
<script src="/js/app.js"></script>
<title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title>
diff --git a/templates/base/navbar.tmpl b/templates/base/navbar.tmpl
index 7d1f64e495..e5b22192f5 100644
--- a/templates/base/navbar.tmpl
+++ b/templates/base/navbar.tmpl
@@ -1,16 +1,38 @@
<div class="masthead navbar" id="masthead">
<div class="container">
<nav class="nav">
- <a id="nav-logo" class="nav-item{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="logo"></a>
- <a class="nav-item{{if .PageIsUserDashboard}} active{{end}}" href="/">Dashboard</a>
- <a class="nav-item{{if .PageIsHelp}} active{{end}}" href="https://github.com/gogits/gogs/wiki">Help</a>{{if .IsSigned}}
+ <a id="nav-logo" class="nav-item pull-left{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="logo"></a>
+ <a class="nav-item pull-left{{if .PageIsUserDashboard}} active{{end}}" href="/">Dashboard</a>
+ <a class="nav-item pull-left{{if .PageIsHelp}} active{{end}}" href="https://github.com/gogits/gogs/wiki">Help</a>{{if .IsSigned}}
+ {{if .HasAccess}}<!-- <form class="nav-item pull-left{{if .PageIsNewRepo}} active{{end}}" id="nav-search-form">
+ <div class="input-group">
+ <div class="input-group-btn">
+ <button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown">{{if .Repository}}This Repository{{else}}All Repositories{{end}} <span class="caret"></span></button>
+ <ul class="dropdown-menu">
+ {{if .Repository}}<li><a href="#">This Repository</a></li>
+ <li class="divider"></li>{{end}}
+ <li><a href="#">All Repositories</a></li>
+ </ul>
+ </div>
+ <input type="search" class="form-control input-sm" name="q" placeholder="search code, commits and issues"/>
+ </div>
+ </form> -->{{end}}
<a id="nav-out" class="nav-item navbar-right navbar-btn btn btn-danger" href="/user/logout/"><i class="fa fa-power-off fa-lg"></i></a>
<a id="nav-avatar" class="nav-item navbar-right{{if .PageIsUserProfile}} active{{end}}" href="{{.SignedUser.HomeLink}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}">
<img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username"/>
</a>
- <a class="navbar-right nav-item{{if .PageIsNewRepo}} active{{end}}" href="/repo/create" data-toggle="tooltip" data-placement="bottom" title="New Repository"><i class="fa fa-plus fa-lg"></i></a>
<a class="navbar-right nav-item{{if .PageIsUserSetting}} active{{end}}" href="/user/setting" data-toggle="tooltip" data-placement="bottom" title="Setting"><i class="fa fa-cogs fa-lg"></i></a>
{{if .IsAdmin}}<a class="navbar-right nav-item{{if .PageIsAdmin}} active{{end}}" href="/admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><i class="fa fa-gear fa-lg"></i></a>{{end}}
+ <div class="navbar-right nav-item pull-right{{if .PageIsNewRepo}} active{{end}}" id="nav-repo-new" data-toggle="tooltip" data-placement="bottom" title="New Repo">
+ <button type="button" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus-square fa-lg"></i></button>
+ <div class="dropdown-menu">
+ <ul class="list-unstyled">
+ <li><a href="/repo/create"><i class="fa fa-book"></i>Repository</a></li>
+ <li><a href="/repo/migrate"><i class="fa fa-clipboard"></i>Migration</a></li>
+ <!-- <li><a href="#"><i class="fa fa-users"></i>Organization</a></li> -->
+ </ul>
+ </div>
+ </div>
{{else}}<a id="nav-signin" class="nav-item navbar-right navbar-btn btn btn-danger" href="/user/login/">Sign In</a>
<a id="nav-signup" class="nav-item navbar-right" href="/user/sign_up/">Sign Up</a>{{end}}
</nav>
diff --git a/templates/home.tmpl b/templates/home.tmpl
index d3a8c0c343..b08d1c2451 100644
--- a/templates/home.tmpl
+++ b/templates/home.tmpl
@@ -1,8 +1,27 @@
{{template "base/head" .}}
{{template "base/navbar" .}}
<div id="body" class="container">
+ {{if not .Repos}}
<h4>Hey there, welcome to the land of Gogs!</h4>
- <p>If you just get your Gogs server running, go <a href="/install">install</a> guide page will help you setup things for your first-time run.</p>
+ <p>If you just got your Gogs server running, go to the <a href="/install">install</a> guide page, which will guide you through your initial setup.</p>
<img src="http://gowalker.org/public/gogs_demo.gif">
+ {{else}}
+ <h4>Hey there, welcome to the land of Gogs!</h4>
+ <h5>Here are some recent updated repositories:</h5>
+ <div class="tab-pane active">
+ <ul class="list-unstyled repo-list">
+ {{range .Repos}}
+ <li>
+ <div class="meta pull-right"><!-- <i class="fa fa-star"></i> {{.NumStars}} --> <i class="fa fa-code-fork"></i> {{.NumForks}}</div>
+ <h4>
+ <a href="/{{.Owner.Name}}/{{.Name}}">{{.Name}}</a>
+ </h4>
+ <p class="desc">{{.Description}}</p>
+ <div class="info">Last updated {{.Updated|TimeSince}}</div>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ {{end}}
</div>
{{template "base/footer" .}}
diff --git a/templates/install.tmpl b/templates/install.tmpl
index 1fbc74bc7d..2ed7e569d1 100644
--- a/templates/install.tmpl
+++ b/templates/install.tmpl
@@ -3,8 +3,8 @@
<form action="/install" method="post" class="form-horizontal card" id="install-card">
{{.CsrfTokenHtml}}
<h3>Install Steps For First-time Run</h3>
- <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div>
- <p class="help-block text-center">Gogs requires MySQL or PostgreSQL, SQLite3 only available for official binary version</p>
+ {{template "base/alert" .}}
+ <p class="help-block text-center">Gogs requires MySQL, SQLite3. or PostgreSQL. SQLite3 is only available in the official binary version.</p>
<div class="form-group">
<label class="col-md-3 control-label">Database Type: </label>
<div class="col-md-8">
@@ -156,11 +156,11 @@
<label class="col-md-3 control-label">SMTP Host: </label>
<div class="col-md-8">
- <input name="smtp_host" type="text" class="form-control" placeholder="Type SMTP host address" value="{{.smtp_host}}">
+ <input name="smtp_host" type="text" class="form-control" placeholder="Type SMTP host address and port" value="{{.smtp_host}}">
</div>
</div>
<div class="form-group">
- <label class="col-md-3 control-label">Email: </label>
+ <label class="col-md-3 control-label">Username: </label>
<div class="col-md-8">
<input name="mailer_user" type="text" class="form-control" placeholder="Type SMTP user e-mail address" value="{{.mailer_user}}">
@@ -184,11 +184,7 @@
<strong>Enable Register Confirmation</strong>
</label>
</div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-offset-3 col-md-7">
<div class="checkbox">
<label>
<input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}>
@@ -208,4 +204,4 @@
</form>
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "base/footer" .}}
diff --git a/templates/issue/create.tmpl b/templates/issue/create.tmpl
index 01784cd21e..a75ee83617 100644
--- a/templates/issue/create.tmpl
+++ b/templates/issue/create.tmpl
@@ -6,6 +6,7 @@
<div id="issue">
<form class="form" action="{{.RepoLink}}/issues/new" method="post" id="issue-create-form">
{{.CsrfTokenHtml}}
+ {{template "base/alert" .}}
<div class="col-md-1">
<img class="avatar" src="{{.SignedUser.AvatarLink}}" alt=""/>
</div>
@@ -19,7 +20,7 @@
</div>
<ul class="nav nav-tabs" data-init="tabs">
<li class="active issue-write"><a href="#issue-textarea" data-toggle="tab">Write</a></li>
- <li class="issue-preview"><a href="#issue-preview" data-toggle="tab" data-ajax="/api/v1/markdown?repo=repo_id&issue=new" data-ajax-name="issue-preview" data-ajax-method="post" data-preview="#issue-preview">Preview</a></li>
+ <li class="issue-preview"><a href="#issue-preview" data-toggle="tab" data-ajax="/api/v1/markdown?repoLink={{.RepoLink}}" data-ajax-name="issue-preview" data-ajax-method="post" data-preview="#issue-preview">Preview</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane" id="issue-textarea">
diff --git a/templates/issue/view.tmpl b/templates/issue/view.tmpl
index e619451cc1..16d60d3584 100644
--- a/templates/issue/view.tmpl
+++ b/templates/issue/view.tmpl
@@ -72,7 +72,7 @@
</div>
<ul class="nav nav-tabs" data-init="tabs">
<li class="active issue-write"><a href="#issue-textarea" data-toggle="tab">Write</a></li>
- <li class="issue-preview"><a href="#issue-preview" data-toggle="tab" data-ajax="/api/v1/markdown?repo=repo_id&issue=issue_id&comment=new" data-ajax-name="issue-preview" data-ajax-method="post" data-preview="#issue-preview">Preview</a></li>
+ <li class="issue-preview"><a href="#issue-preview" data-toggle="tab" data-ajax="/api/v1/markdown?repoLink={{.RepoLink}}" data-ajax-name="issue-preview" data-ajax-method="post" data-preview="#issue-preview">Preview</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane" id="issue-textarea">
diff --git a/templates/mail/auth/active_email.tmpl b/templates/mail/auth/active_email.tmpl
index c04ddc8a30..72d9948bd4 100644
--- a/templates/mail/auth/active_email.tmpl
+++ b/templates/mail/auth/active_email.tmpl
@@ -15,11 +15,11 @@
Hi <span style="color: #00BFFF;">{{.User.Name}}</span>,
</div>
<div style="font-size:14px; padding:0 15px;">
- <p style="margin:0;padding:0 0 9px 0;">Please click following link to verify your e-mail address within <b>{{.ActiveCodeLives}} hours</b>.</p>
+ <p style="margin:0;padding:0 0 9px 0;">Please click the following link to verify your e-mail address within <b>{{.ActiveCodeLives}} hours</b>.</p>
<p style="margin:0;padding:0 0 9px 0;">
<a href="{{.AppUrl}}user/activate?code={{.Code}}">{{.AppUrl}}user/activate?code={{.Code}}</a>
</p>
- <p style="margin:0;padding:0 0 9px 0;">Copy and paste it to your browser if the link is not working.</p>
+ <p style="margin:0;padding:0 0 9px 0;">Not working? Try copying and pasting it to your browser.</p>
</div>
</div>
</div>
@@ -30,4 +30,4 @@
</div>
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/templates/mail/auth/register_success.tmpl b/templates/mail/auth/register_success.tmpl
index 0a69280847..ffbe2c9732 100644
--- a/templates/mail/auth/register_success.tmpl
+++ b/templates/mail/auth/register_success.tmpl
@@ -12,14 +12,14 @@
<h1 style="font-size:20px; padding:10px 0 20px; margin:0; border-bottom:1px solid #ddd;"><img src="{{.AppUrl}}/{{.AppLogo}}" style="height: 32px; margin-bottom: -10px;"> <a style="color:#333;text-decoration:none;" target="_blank" href="{{.AppUrl}}">{{.AppName}}</a></h1>
<div style="padding:40px 15px;">
<div style="font-size:16px; padding-bottom:30px; font-weight:bold;">
- Hi <span style="color: #00BFFF;">{{.User.Name}}</span>, welcome to register {{.AppName}}!
+ Hi <span style="color: #00BFFF;">{{.User.Name}}</span>, this is your registration email for {{.AppName}}!
</div>
<div style="font-size:14px; padding:0 15px;">
- <p style="margin:0;padding:0 0 9px 0;">Please click following link to verify your e-mail address within <b>{{.ActiveCodeLives}} hours</b>.</p>
+ <p style="margin:0;padding:0 0 9px 0;">Please click the following link to verify your e-mail address within <b>{{.ActiveCodeLives}} hours</b>.</p>
<p style="margin:0;padding:0 0 9px 0;">
<a href="{{.AppUrl}}user/activate?code={{.Code}}">{{.AppUrl}}user/activate?code={{.Code}}</a>
</p>
- <p style="margin:0;padding:0 0 9px 0;">Copy and paste it to your browser if the link is not working.</p>
+ <p style="margin:0;padding:0 0 9px 0;">Not working? Try copying and pasting it to your browser.</p>
</div>
</div>
</div>
@@ -30,4 +30,4 @@
</div>
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/templates/mail/auth/reset_passwd.tmpl b/templates/mail/auth/reset_passwd.tmpl
new file mode 100644
index 0000000000..c85fc61798
--- /dev/null
+++ b/templates/mail/auth/reset_passwd.tmpl
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>{{.User.Name}}, please reset your password</title>
+</head>
+<body style="background:#eee;">
+<div style="color:#333; font:12px/1.5 Tahoma,Arial,sans-serif;; text-shadow:1px 1px #fff; padding:0; margin:0;">
+ <div style="width:600px;margin:0 auto; padding:40px 0 20px;">
+ <div style="border:1px solid #d9d9d9;border-radius:3px; background:#fff; box-shadow: 0px 2px 5px rgba(0, 0, 0,.05); -webkit-box-shadow: 0px 2px 5px rgba(0, 0, 0,.05);">
+ <div style="padding: 20px 15px;">
+ <h1 style="font-size:20px; padding:10px 0 20px; margin:0; border-bottom:1px solid #ddd;"><img src="{{.AppUrl}}/{{.AppLogo}}" style="height: 32px; margin-bottom: -10px;"> <a style="color:#333;text-decoration:none;" target="_blank" href="{{.AppUrl}}">{{.AppName}}</a></h1>
+ <div style="padding:40px 15px;">
+ <div style="font-size:16px; padding-bottom:30px; font-weight:bold;">
+ Hi <span style="color: #00BFFF;">{{.User.Name}}</span>,
+ </div>
+ <div style="font-size:14px; padding:0 15px;">
+ <p style="margin:0;padding:0 0 9px 0;">Please click the following link to reset your password within <b>{{.ActiveCodeLives}} hours</b>.</p>
+ <p style="margin:0;padding:0 0 9px 0;">
+ <a href="{{.AppUrl}}user/reset_password?code={{.Code}}">{{.AppUrl}}user/reset_password?code={{.Code}}</a>
+ </p>
+ <p style="margin:0;padding:0 0 9px 0;">Not working? Try copying and pasting it to your browser.</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div style="color:#aaa;padding:10px;text-align:center;">
+ © 2014 <a style="color:#888;text-decoration:none;" target="_blank" href="http://gogits.org">Gogs: Go Git Service</a>
+ </div>
+ </div>
+</div>
+</body>
+</html>
diff --git a/templates/release/list.tmpl b/templates/release/list.tmpl
index d7c4674e84..dd37e9c1a2 100644
--- a/templates/release/list.tmpl
+++ b/templates/release/list.tmpl
@@ -5,55 +5,52 @@
<div id="body" class="container">
<div id="release">
<h4 id="release-head">
- <span class="release"><strong>Release</strong></span> /
- <a class="tag" href="/{tag_link}">Tags</a>
+ <span class="release"><strong>Releases</strong></span><!-- /
+ <a class="tag" href="/{tag_link}">Tags</a> -->
<!-- comment : if in tag page, show a.release and span.tag please -->
</h4>
<ul id="release-list" class="list-unstyled">
- <li class="release-item release-tag clearfix" id="release-tag-{release_tag_id}">
+ {{range .Releases}}
+ <li class="release-item clearfix" id="release-{{.SHA1}}">
+ {{if .PublisherId}}
<div class="col-md-2 text-right">
- <a class="commit" href="{commit_link}"><i class="fa fa-code"></i>commit-sha</a>
+ {{if .IsPrerelease}}<span class="btn btn-warning status pre-release">Pre-Release</span>{{else}}<span class="btn btn-success status stable">Stable</span>{{end}}
+ <a class="tag" href="{{$.RepoLink}}/src/{{.TagName}}"><i class="fa fa-tag"></i>{{.TagName}}</a>
+ <a class="commit" href="{{$.RepoLink}}/src/{{.SHA1}}"><i class="fa fa-code"></i>{{ShortSha .SHA1}}</a>
</div>
<div class="col-md-10">
- <h5 class="title"><a href="{release_single_link}">Release Tag</a><i class="fa fa-tag"></i></h5>
+ <h4 class="title"><a href="{{$.RepoLink}}/src/{{.TagName}}">{{.Title}}</a></h4>
<p class="info">
- <span class="author"><img class="avatar" src="http://1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132" alt="" width="20">&nbsp;&nbsp;
- <a href="/user/fuxiaohei">fuxiaohei</a></span>
- <span class="time">1 week ago</span>
- <span class="ahead"><strong>0</strong> commits since this tag</span>
+ <span class="author"><img class="avatar" src="{{.Publisher.AvatarLink}}" alt="" width="20">&nbsp;&nbsp;
+ <a href="/user/{{.Publisher.Name}}">{{.Publisher.Name}}</a></span>
+ {{if .Created}}<span class="time">{{TimeSince .Created}}</span>{{end}}
+ <span class="ahead"><strong>{{.NumCommitsBehind}}</strong> commits since this release</span>
</p>
+ <div class="markdown desc">
+ {{str2html .Note}}
+ </div>
<p class="download">
- <a class="download-link" href="{release_download_link}"><i class="fa fa-download"></i>zip</a>
- <a class="download-link" href="{release_download_link}"><i class="fa fa-download"></i>tar.gz</a>
+ <a class="btn btn-default" href="{{$.RepoLink}}/archive/{{.TagName}}/{{$.Repository.Name}}.zip"><i class="fa fa-download"></i>Source Code (ZIP)</a>
+ <!-- <a class="btn btn-default" href="{release_download_link}"><i class="fa fa-download"></i>Source Code (TAR.GZ)</a> -->
</p>
<span class="dot">&nbsp;</span>
</div>
- </li>
- <li class="release-item clearfix" id="release-{release_id}">
+ {{else}}
<div class="col-md-2 text-right">
- <span class="btn btn-success status stable">Stable</span>
- <a class="tag" href="{commit_link}"><i class="fa fa-tag"></i>release tag</a>
- <a class="commit" href="{commit_link}"><i class="fa fa-code"></i>commit-sha</a>
+ <a class="commit" href="{{$.RepoLink}}/src/{{.SHA1}}"><i class="fa fa-code"></i>{{ShortSha .SHA1}}</a>
</div>
<div class="col-md-10">
- <h4 class="title"><a href="{release_single_link}">Release Title</a></h4>
- <p class="info">
- <span class="author"><img class="avatar" src="http://1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132" alt="" width="20">&nbsp;&nbsp;
- <a href="/user/fuxiaohei">fuxiaohei</a></span>
- <span class="time">1 week ago</span>
- <span class="ahead"><strong>0</strong> commits since this tag</span>
- </p>
- <div class="markdown desc">
- release descriptions, support markdown content
- </div>
+ <h5 class="title"><a href="{{$.RepoLink}}/src/{{.TagName}}">{{.TagName}}</a><i class="fa fa-tag"></i></h5>
<p class="download">
- <a class="btn btn-default" href="{release_download_link}"><i class="fa fa-download"></i>Source Code (ZIP)</a>
- <a class="btn btn-default" href="{release_download_link}"><i class="fa fa-download"></i>Source Code (TAR.GZ)</a>
+ <a class="download-link" href="{{$.RepoLink}}/archive/{{.TagName}}/{{$.Repository.Name}}.zip"><i class="fa fa-download"></i>zip</a>
+ <!-- <a class="download-link" href="{release_download_link}"><i class="fa fa-download"></i>tar.gz</a> -->
</p>
<span class="dot">&nbsp;</span>
</div>
+ {{end}}
</li>
- <li class="release-item clearfix" id="release-{release_id}">
+ {{end}}
+ <!-- <li class="release-item clearfix" id="release-{release_id}">
<div class="col-md-2 text-right">
<span class="btn btn-warning status pre-release">Pre-Release</span>
<a class="tag" href="{commit_link}"><i class="fa fa-tag"></i>release tag</a>
@@ -76,11 +73,8 @@
</p>
<span class="dot">&nbsp;</span>
</div>
- </li>
+ </li> -->
</ul>
</div>
- {{range .Releases}}
- {{.}}
- {{end}}
</div>
{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/release/new.tmpl b/templates/release/new.tmpl
new file mode 100644
index 0000000000..6dfe4a5c2d
--- /dev/null
+++ b/templates/release/new.tmpl
@@ -0,0 +1,70 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+{{template "repo/nav" .}}
+{{template "repo/toolbar" .}}
+<div id="body" class="container">
+ <div id="release">
+ <h4 id="release-head">New Release</h4>
+ {{template "base/alert" .}}
+ <form id="release-new-form" action="{{.RepoLink}}/releases/new" method="post" class="form form-inline">
+ {{.CsrfTokenHtml}}
+ <div class="form-group">
+ <input id="tag-name" name="tag_name" type="text" class="form-control" placeholder="tag name" value="{{.tag_name}}" />
+ <span class="target-at">@</span>
+ <div class="btn-group" id="release-new-target-select">
+ <button type="button" class="btn btn-default"><i class="fa fa-code-fork fa-lg fa-m"></i>
+ <span class="target-text">Target : </span>
+ <strong id="release-new-target-name"> {{.Repository.DefaultBranch}}</strong>
+ </button>
+ <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
+ <span class="caret"></span>
+ </button>
+ <div class="dropdown-menu clone-group-btn" id="release-new-target-branch-list">
+ <ul class="list-group">
+ {{range .Branches}}
+ <li class="list-group-item">
+ <a href="#" rel="{{.}}"><i class="fa fa-code-fork"></i>{{.}}</a>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ <input id="tag-target" type="hidden" name="tag_target" value="{{.Repository.DefaultBranch}}"/>
+ </div>
+ <p class="help-block">Choose an existing tag, or create a new tag on publish</p>
+ </div>
+ <div class="form-group" style="display: block">
+ <input class="form-control input-lg" id="release-new-title" name="title" type="text" placeholder="release title" value="{{.title}}" />
+ </div>
+ <div class="form-group col-md-8" style="display: block" id="release-new-content-div">
+ <div class="md-help pull-right">
+ Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a>
+ </div>
+ <ul class="nav nav-tabs" data-init="tabs">
+ <li class="release-write active"><a href="#release-textarea" data-toggle="tab">Write</a></li>
+ <li class="release-preview"><a href="#release-preview" data-toggle="tab" data-ajax="/api/v1/markdown?repo=repo_id&amp;release=new" data-ajax-name="release-preview" data-ajax-method="post" data-preview="#release-preview">Preview</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="release-textarea">
+ <div class="form-group">
+ <textarea class="form-control" name="content" id="release-new-content" rows="10" placeholder="Write some content" data-ajax-rel="release-preview" data-ajax-val="val" data-ajax-field="content">{{.content}}</textarea>
+ </div>
+ </div>
+ <div class="tab-pane release-preview-content" id="release-preview">loading...</div>
+ </div>
+ </div>
+ <div class="text-right form-group col-md-8" style="display: block">
+ <hr/>
+ <label for="release-new-pre-release">
+ <input id="release-new-pre-release" type="checkbox" name="prerelease" {{if .prerelease}}checked{{end}}/>
+ <strong>This is a pre-release</strong>
+ </label>
+ <p class="help-block">We’ll point out that this release is identified as non-production ready.</p>
+ </div>
+ <div class="text-right form-group col-md-8" style="display: block">
+ <button class="btn-success btn">Publish release</button>
+ <!-- <input class="btn btn-default" type="submit" name="draft" value="Save Draft"/> -->
+ </div>
+ </form>
+ </div>
+</div>
+{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl
index efe35936c4..b14c6bc8c6 100644
--- a/templates/repo/commits.tmpl
+++ b/templates/repo/commits.tmpl
@@ -6,16 +6,21 @@
<div id="commits">
<div class="panel panel-default commit-box info-box">
<div class="panel-heading info-head">
- <div class="search pull-right form">
- <input class="form-control search" type="search" placeholder="search commit"/>
- </div>
+ <form class="search pull-right col-md-3" action="{{.RepoLink}}/commits/{{.BranchName}}/search" method="get" id="commits-search-form">
+ <div class="input-group">
+ <input class="form-control search" type="search" placeholder="search commit" name="q" value="{{.Keyword}}" />
+ <div class="input-group-btn">
+ <button type="submit" class="btn btn-default">Find</button>
+ </div>
+ </div>
+ </form>
<h4>{{.CommitCount}} Commits</h4>
</div>
<table class="panel-footer table commit-list table table-striped">
<thead>
<tr>
<th class="author">Author</th>
- <th class="sha">Commit</th>
+ <th class="sha">SHA1</th>
<th class="message">Message</th>
<th class="date">Date</th>
</tr>
@@ -26,15 +31,19 @@
{{$r := List .Commits}}
{{range $r}}
<tr>
- <td class="author"><img class="avatar" src="{{AvatarLink .Committer.Email}}" alt=""/><a href="/user/{{.Committer.Name}}">{{.Committer.Name}}</a></td>
- <td class="sha"><a class="label label-success" href="/{{$username}}/{{$reponame}}/commit/{{.Id}} ">{{SubStr .Id.String 0 10}} </a></td>
+ <td class="author"><img class="avatar" src="{{AvatarLink .Author.Email}}" alt=""/><a href="/user/email2user?email={{.Author.Email}}">{{.Author.Name}}</a></td>
+ <td class="sha"><a rel="nofollow" class="label label-success" href="/{{$username}}/{{$reponame}}/commit/{{.Id}} ">{{SubStr .Id.String 0 10}} </a></td>
<td class="message">{{.Message}} </td>
- <td class="date">{{TimeSince .Committer.When}}</td>
+ <td class="date">{{TimeSince .Author.When}}</td>
</tr>
{{end}}
</tbody>
</table>
</div>
+ {{if not .IsSearchPage}}<ul class="pagination" id="commits-pager">
+ {{if .LastPageNum}}<li><a href="{{.RepoLink}}/commits/{{.BranchName}}?p={{.LastPageNum}}">&laquo; Newer</a></li>{{end}}
+ {{if .NextPageNum}}<li><a href="{{.RepoLink}}/commits/{{.BranchName}}?p={{.NextPageNum}}">&raquo; Older</a></li>{{end}}
+ </ul>{{end}}
</div>
</div>
{{template "base/footer" .}}
diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl
index dc509fc1cc..6da6a93d15 100644
--- a/templates/repo/create.tmpl
+++ b/templates/repo/create.tmpl
@@ -4,7 +4,7 @@
<form action="/repo/create" method="post" class="form-horizontal card" id="repo-create">
{{.CsrfTokenHtml}}
<h3>Create New Repository</h3>
- <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div>
+ {{template "base/alert" .}}
<div class="form-group">
<label class="col-md-2 control-label">Owner<strong class="text-danger">*</strong></label>
<div class="col-md-8">
@@ -22,10 +22,14 @@
</div>
<div class="form-group">
- <label class="col-md-2 control-label">Visibility<strong class="text-danger">*</strong></label>
+ <label class="col-md-2 control-label">Visibility</label>
<div class="col-md-8">
- <p class="form-control-static">Public</p>
- <input type="hidden" value="public" name="visibility"/>
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="private" {{if .private}}checked{{end}}>
+ <strong>This repository is private</strong>
+ </label>
+ </div>
</div>
</div>
@@ -43,6 +47,8 @@
<option value="">Select a language</option>
{{range .LanguageIgns}}<option value="{{.}}">{{.}}</option>{{end}}
</select>
+ <br>
+ <div>Need more .gitignore? Go <a href="http://www.gitignore.io/">gitignore.io</a>.</div>
</div>
</div>
diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl
index 5c95ddefde..0dce405337 100644
--- a/templates/repo/diff.tmpl
+++ b/templates/repo/diff.tmpl
@@ -5,7 +5,7 @@
<div id="source">
<div class="panel panel-info diff-box diff-head-box">
<div class="panel-heading">
- <a class="pull-right btn btn-primary btn-sm" href="{{.SourcePath}}">Browse Source</a>
+ <a class="pull-right btn btn-primary btn-sm" rel="nofollow" href="{{.SourcePath}}">Browse Source</a>
<h4>{{.Commit.Message}}</h4>
</div>
<div class="panel-body">
@@ -14,12 +14,15 @@
</span>
<p class="author">
<img class="avatar" src="{{AvatarLink .Commit.Author.Email}}" alt=""/>
- <a class="name" href="#"><strong>{{.Commit.Author.Name}}</strong></a>
+ <a class="name" href="/user/email2user?email={{.Commit.Author.Email}}"><strong>{{.Commit.Author.Name}}</strong></a>
<span class="time">{{TimeSince .Commit.Author.When}}</span>
</p>
</div>
</div>
+ {{if .DiffNotAvailable}}
+ <h4>Diff Data Not Available.</h4>
+ {{else}}
<div class="diff-detail-box diff-box">
<a class="pull-right btn btn-default" data-toggle="collapse" data-target="#diff-files">Show Diff Stats</a>
<p class="showing">
@@ -30,12 +33,16 @@
{{range .Diff.Files}}
<li>
<div class="diff-counter count pull-right">
+ {{if not .IsBin}}
<span class="add" data-line="{{.Addition}}">{{.Addition}}</span>
<span class="bar">
<span class="pull-left add"></span>
<span class="pull-left del"></span>
</span>
<span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span>
+ {{else}}
+ <span>BIN</span>
+ {{end}}
</div>
<!-- todo finish all file status, now modify, add, delete and rename -->
<span class="status {{DiffTypeToStr .Type}}" data-toggle="tooltip" data-placement="right" title="{{DiffTypeToStr .Type}}">&nbsp;</span>
@@ -49,14 +56,18 @@
<div class="panel panel-default diff-file-box diff-box file-content" id="diff-2">
<div class="panel-heading">
<div class="diff-counter count pull-left">
+ {{if not .IsBin}}
<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
<span class="bar">
<span class="pull-left add"></span>
<span class="pull-left del"></span>
</span>
<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
+ {{else}}
+ BIN
+ {{end}}
</div>
- <a class="btn btn-default btn-sm pull-right" href="{{$.SourcePath}}/{{.Name}}">View File</a>
+ <a class="btn btn-default btn-sm pull-right" rel="nofollow" href="{{$.SourcePath}}/{{.Name}}">View File</a>
<span class="file">{{.Name}}</span>
</div>
{{$isImage := (call $.IsImageFile .Name)}}
@@ -83,338 +94,13 @@
</tr>
{{end}}
{{end}}
- <!-- <tr class="same-code nl-2 ol-2">
- <td class="lines-num lines-num-old">
- <span rel="L1">2</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L1">2</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="same-code nl-3 ol-3">
- <td class="lines-num lines-num-old">
- <span rel="L3">3</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L3">3</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="add-code nl-4 ol-0">
- <td class="lines-num lines-num-old">
- <span rel="add">+</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L4">4</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="add-code nl-5 ol-0">
- <td class="lines-num lines-num-old">
- <span rel="add">+</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L5">5</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="del-code nl-0 ol-4">
- <td class="lines-num lines-num-old">
- <span rel="L4">4</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="del">-</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="del-code nl-0 ol-5">
- <td class="lines-num lines-num-old">
- <span rel="L5">5</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="del">-</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="del-code nl-0 ol-6">
- <td class="lines-num lines-num-old">
- <span rel="L6">6</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="del">-</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="del-code nl-0 ol-7">
- <td class="lines-num lines-num-old">
- <span rel="L7">7</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="del">-</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="same-code nl-6 ol-8">
- <td class="lines-num lines-num-old">
- <span rel="L8">8</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L6">6</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="same-code nl-7 ol-9">
- <td class="lines-num lines-num-old">
- <span rel="L1">9</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L1">7</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="same-code nl-8 ol-10">
- <td class="lines-num lines-num-old">
- <span rel="L1">10</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L1">8</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr> -->
</tbody>
</table>
{{end}}
</div>
</div>
{{end}}
-
- <!-- <div class="panel panel-default diff-file-box diff-box file-content">
- <div class="panel-heading">
- <div class="diff-counter count pull-left">
- <span class="add" data-line="2">+ 2</span>
- <span class="bar">
- <span class="pull-left add"></span>
- <span class="pull-left del"></span>
- </span>
- <span class="del" data-line="4">- 4</span>
- </div>
- <a class="btn btn-default btn-sm pull-right" href="#">View File</a>
- <span class="file">data/test/bson_test/simple_type.go</span>
- </div>
- <div class="panel-body file-body file-code code-view code-diff">
- <table>
- <tbody>
- <tr class="same-code nl-1 ol-1">
- <td class="lines-num lines-num-old">
- <span rel="L1">1</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L1">1</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="same-code nl-2 ol-2">
- <td class="lines-num lines-num-old">
- <span rel="L1">2</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L1">2</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="same-code nl-3 ol-3">
- <td class="lines-num lines-num-old">
- <span rel="L3">3</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L3">3</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="add-code nl-4 ol-0">
- <td class="lines-num lines-num-old">
- <span rel="add">+</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L4">4</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="add-code nl-5 ol-0">
- <td class="lines-num lines-num-old">
- <span rel="add">+</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L5">5</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="del-code nl-0 ol-4">
- <td class="lines-num lines-num-old">
- <span rel="L4">4</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="del">-</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="del-code nl-0 ol-5">
- <td class="lines-num lines-num-old">
- <span rel="L5">5</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="del">-</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="del-code nl-0 ol-6">
- <td class="lines-num lines-num-old">
- <span rel="L6">6</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="del">-</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="del-code nl-0 ol-7">
- <td class="lines-num lines-num-old">
- <span rel="L7">7</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="del">-</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="same-code nl-6 ol-8">
- <td class="lines-num lines-num-old">
- <span rel="L8">8</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L6">6</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="same-code nl-7 ol-9">
- <td class="lines-num lines-num-old">
- <span rel="L1">9</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L1">7</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="same-code nl-8 ol-10">
- <td class="lines-num lines-num-old">
- <span rel="L1">10</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L1">8</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="ellipsis-code">
- <td class="text-center lines-ellipsis" colspan="2">
- <i class="fa fa-ellipsis-h"></i>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="same-code nl-8 ol-10">
- <td class="lines-num lines-num-old">
- <span rel="L1">10</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L1">8</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- <tr class="same-code nl-8 ol-10">
- <td class="lines-num lines-num-old">
- <span rel="L1">10</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="L1">8</span>
- </td>
- <td class="lines-code">
- <pre> "github.com/youtube/vitess/go/bson"</pre>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
-
- <div class="panel panel-default diff-file-box diff-box file-content">
- <div class="panel-heading">
- <div class="diff-counter count pull-left">
- <span class="add" data-line="0">BIN</span>
- <span class="bar">
- <span class="pull-left add"></span>
- <span class="pull-left del"></span>
- </span>
- <span class="del" data-line="1"></span>
- </div>
- <a class="btn btn-default btn-sm pull-right" href="#">View File</a>
- <span class="file">data/test/bson_test/simple_type.png</span>
- </div>
- <div class="panel-body file-body file-code code-view code-bin">
- <table>
- <tbody>
- <tr class="text-center"><td><img src="http://1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132?s=200" alt=""/></td></tr>
- </tbody>
- </table>
- </div>
- </div> -->
+ {{end}}
</div>
</div>
{{template "base/footer" .}}
diff --git a/templates/repo/migrate.tmpl b/templates/repo/migrate.tmpl
new file mode 100644
index 0000000000..34a4077eec
--- /dev/null
+++ b/templates/repo/migrate.tmpl
@@ -0,0 +1,99 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+<div class="container" id="body">
+ <form action="/repo/migrate" method="post" class="form-horizontal card" id="repo-create">
+ {{.CsrfTokenHtml}}
+ <h3>Repository Migration</h3>
+ {{template "base/alert" .}}
+ <!-- <div class="form-group">
+ <label class="col-md-2 control-label">From<strong class="text-danger">*</strong></label>
+ <div class="col-md-8">
+ <select class="form-control" name="from">
+ <option value="github">GitHub</option>
+ </select>
+ </div>
+ </div> -->
+
+ <div class="form-group">
+ <label class="col-md-2 control-label">HTTPS URL<strong class="text-danger">*</strong></label>
+ <div class="col-md-8">
+ <input name="url" type="text" class="form-control" placeholder="Type your migration repository HTTPS URL" value="{{.url}}" required="required" >
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="col-md-offset-2 col-md-8">
+ <a class="btn btn-default" data-toggle="collapse" data-target="#repo-import-auth">Need Authorization</a>
+ </div>
+ <div id="repo-import-auth" class="collapse">
+ <div class="form-group">
+ <label class="col-md-2 control-label">Username</label>
+ <div class="col-md-8">
+ <input name="auth_username" type="text" class="form-control" placeholder="Type your user name" value="{{.auth_username}}" >
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-md-2 control-label">Password</label>
+ <div class="col-md-8">
+ <input name="auth_password" type="password" class="form-control" placeholder="Type your password" value="{{.auth_password}}" >
+ </div>
+ </div>
+ </div>
+ </div>
+ <hr/>
+ <div class="form-group">
+ <label class="col-md-2 control-label">Owner<strong class="text-danger">*</strong></label>
+ <div class="col-md-8">
+ <p class="form-control-static">{{.SignedUserName}}</p>
+ <input type="hidden" value="{{.SignedUserId}}" name="userId"/>
+ </div>
+ </div>
+
+ <div class="form-group {{if .Err_RepoName}}has-error has-feedback{{end}}">
+ <label class="col-md-2 control-label">Repository<strong class="text-danger">*</strong></label>
+ <div class="col-md-8">
+ <input name="repo" type="text" class="form-control" placeholder="Type your repository name" value="{{.repo}}" required="required">
+ <span class="help-block">Great repository names are short and memorable. </span>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="col-md-2 control-label">Migration Type</label>
+ <div class="col-md-8">
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="mirror" {{if .mirror}}checked{{end}}>
+ <strong>This repository is a mirror</strong>
+ </label>
+ </div>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="col-md-2 control-label">Visibility</label>
+ <div class="col-md-8">
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="private" {{if .private}}checked{{end}}>
+ <strong>This repository is private</strong>
+ </label>
+ </div>
+ </div>
+ </div>
+
+ <div class="form-group {{if .Err_Description}}has-error has-feedback{{end}}">
+ <label class="col-md-2 control-label">Description</label>
+ <div class="col-md-8">
+ <textarea name="desc" class="form-control" placeholder="Type your repository description">{{.desc}}</textarea>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="col-md-offset-2 col-md-8">
+ <button type="submit" class="btn btn-lg btn-primary">Migrate repository</button>
+ <a href="/" class="text-danger">Cancel</a>
+ </div>
+ </div>
+ </form>
+</div>
+{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/nav.tmpl b/templates/repo/nav.tmpl
index 3ce27f921e..ce9c112b8d 100644
--- a/templates/repo/nav.tmpl
+++ b/templates/repo/nav.tmpl
@@ -2,13 +2,13 @@
<div class="container">
<div class="row">
<div class="col-md-7">
- <h3 class="name"><i class="fa fa-book fa-lg"></i><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="/{{.Owner.Name}}/{{.Repository.Name}}">{{.Repository.Name}}</a></h3>
+ <h3 class="name"><i class="fa fa-book fa-lg"></i><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="/{{.Owner.Name}}/{{.Repository.Name}}">{{.Repository.Name}}</a> {{if .Repository.IsPrivate}}<span class="label label-default">Private</span>{{else if .Repository.IsMirror}}<span class="label label-default">Mirror</span>{{end}}</h3>
<p class="desc">{{.Repository.Description}}{{if .Repository.Website}} <a href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end}}</p>
</div>
<div class="col-md-5 actions text-right clone-group-btn">
{{if not .IsBareRepo}}
<div class="btn-group" id="repo-clone">
- <button type="button" class="btn btn-default"><i class="fa fa-download fa-lg fa-m"></i></button>
+ <a class="btn btn-default" href="{{.RepoLink}}/archive/{{.BranchName}}/{{.Repository.Name}}.zip"><i class="fa fa-download fa-lg fa-m"></i></a>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
@@ -24,10 +24,10 @@
</span>
</div>
<p class="help-block text-center">Need help cloning? Visit <a href="#">Help</a>!</p>
- <!-- <hr/>
+ <hr/>
<div class="clone-zip text-center">
- <a class="btn btn-success btn-lg" href="#"><i class="fa fa-suitcase"></i>Download ZIP</a>
- </div> -->
+ <a class="btn btn-success btn-lg" href="{{.RepoLink}}/archive/{{.BranchName}}/{{.Repository.Name}}.zip"><i class="fa fa-suitcase"></i>Download ZIP</a>
+ </div>
</div>
</div>
<div class="btn-group {{if .IsRepositoryWatching}}watching{{else}}no-watching{{end}}" id="repo-watching" data-watch="/{{.Owner.Name}}/{{.Repository.Name}}/action/watch" data-unwatch="/{{.Owner.Name}}/{{.Repository.Name}}/action/unwatch">
@@ -61,4 +61,4 @@
</div>
</div>
</div>
-</div> \ No newline at end of file
+</div>
diff --git a/templates/repo/setting.tmpl b/templates/repo/setting.tmpl
index 6e2d3bec8b..61621fe0e4 100644
--- a/templates/repo/setting.tmpl
+++ b/templates/repo/setting.tmpl
@@ -12,7 +12,7 @@
</div>
<div id="repo-setting-container" class="col-md-9">
- {{if .IsSuccess}}<p class="alert alert-success">Repository options has been successfully updated.</p>{{else if .HasError}}<p class="alert alert-danger form-error">{{.ErrorMsg}}</p>{{end}}
+ {{template "base/alert" .}}
<div class="panel panel-default">
<div class="panel-heading">
Repository Options
@@ -23,9 +23,10 @@
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="update">
<div class="form-group">
- <label class="col-md-3 text-right">Name</label>
+ <label class="col-md-3 text-right" for="repo-setting-name">Name</label>
<div class="col-md-9">
- <input class="form-control" name="name" value="{{.Repository.Name}}" title="{{.Repository.Name}}" />
+ <input class="form-control" name="name" value="{{.Repository.Name}}" title="{{.Repository.Name}}" id="repo-setting-name"/>
+ <p class="help-block hidden"><span class="text-danger">Cautious : </span>your repository name is changing !</p>
</div>
</div>
@@ -42,14 +43,44 @@
<input type="url" class="form-control" name="site" value="{{.Repository.Website}}" />
</div>
</div>
- <!-- <div class="form-group">
+ <hr>
+ <div class="form-group">
<label class="col-md-3 text-right">Default Branch</label>
- <div class="col-md-9">
+ <div class="col-md-3">
<select name="branch" id="repo-default-branch" class="form-control">
- <option value="">Branch</option>
+ <option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>
+ {{range .Branches}}
+ {{if eq . $.Repository.DefaultBranch}}{{else}}<option value="{{.}}">{{.}}</option>{{end}}
+ {{end}}
</select>
</div>
- </div> -->
+ </div>
+
+ {{if .Repository.IsMirror}}<div class="form-group">
+ <label class="col-md-3 text-right">Mirror Interval(hours)</label>
+ <div class="col-md-3">
+ <input class="form-control" name="interval" value="{{.MirrorInterval}}"/>
+ </div>
+ </div>{{end}}
+
+ <div class="form-group">
+ <div class="col-md-offset-3 col-md-9">
+ <div class="checkbox">
+ <label style="line-height: 15px;">
+ <input type="checkbox" name="private" {{if .Repository.IsPrivate}}checked{{end}}>
+ <strong>Make this repository private</strong>
+ </label>
+ </div>
+
+ <div class="checkbox">
+ <label style="line-height: 15px;">
+ <input type="checkbox" name="goget" {{if .Repository.IsGoget}}checked{{end}}>
+ <strong>Enable 'go get' meta</strong>
+ </label>
+ </div>
+ </div>
+ </div>
+
<div class="form-group">
<div class="col-md-9 col-md-offset-3">
<button class="btn btn-primary" type="submit">Save Options</button>
diff --git a/templates/repo/single_list.tmpl b/templates/repo/single_list.tmpl
index b0c31d1e44..7b6c6e5e9c 100644
--- a/templates/repo/single_list.tmpl
+++ b/templates/repo/single_list.tmpl
@@ -1,6 +1,6 @@
<div class="panel panel-default info-box">
<div class="panel-heading info-head">
- <a href="/{{.Username}}/{{.Reponame}}/commit/{{.LastCommit.Oid.String}}">{{.LastCommit.Message}}</a>
+ <a href="/{{.Username}}/{{.Reponame}}/commit/{{.LastCommit.Id}}">{{.LastCommit.Message}}</a>
</div>
<div class="panel-body info-content">
<a href="/user/{{.LastCommit.Author.Name}}">{{.LastCommit.Author.Name}}</a> <span class="text-muted">{{TimeSince .LastCommit.Author.When}}</span>
@@ -15,40 +15,37 @@
</tr>
</thead>
<tbody>
- {{if .HasParentPath}}
- <tr class="has-parent">
- <td class="icon"><a href="{{.BranchLink}}{{.ParentPath}}"><i class="fa fa-reply"></i></a></td>
- <td class="name"><a href="{{.BranchLink}}{{.ParentPath}}">..</a></td>
- <td class="text"></td>
- <td class="date"></td>
- </tr>
- {{end}}
- {{range .Files}}
- <tr
- {{if .IsDir}}class="is-dir"{{end}}>
- <td class="icon">
- <i class="fa {{if .IsDir}}fa-folder{{else}}fa-file-text-o{{end}}"></i>
- </td>
- <td class="name">
- <span class="wrap">
- {{if .IsDir}}
- <a href="{{$.BranchLink}}/{{.Path}}">{{.Name}}</a>
- {{else}}
- <a href="{{$.BranchLink}}/{{.Path}}">{{.Name}}</a>
- {{end}}
- </span>
- </td>
- <td class="text">
- <span class="wrap"><a href="/{{$.Username}}/{{$.Reponame}}/commit/{{.Commit.Oid}}">{{.Commit.Message}}</a></span>
- </td>
- <td class="date">
- <span class="wrap">{{TimeSince .Commit.Committer.When}}</span>
- </td>
- </tr>
- {{end}}
+ {{if .HasParentPath}}
+ <tr class="has-parent">
+ <td class="icon"><a href="{{.BranchLink}}{{.ParentPath}}"><i class="fa fa-reply"></i></a></td>
+ <td class="name"><a href="{{.BranchLink}}{{.ParentPath}}">..</a></td>
+ <td class="text"></td>
+ <td class="date"></td>
+ </tr>
+ {{end}}
+ {{range $item := .Files}}
+ {{$entry := index $item 0}}
+ {{$commit := index $item 1}}
+ <tr {{if $entry.IsDir}}class="is-dir"{{end}}>
+ <td class="icon">
+ <i class="fa {{if $entry.IsDir}}fa-folder{{else}}fa-file-text-o{{end}}"></i>
+ </td>
+ <td class="name">
+ <span class="wrap">
+ <a href="{{$.BranchLink}}/{{$.TreePath}}{{$entry.Name}}">{{$entry.Name}}</a>
+ </span>
+ </td>
+ <td class="text">
+ <span class="wrap"><a rel="nofollow" href="/{{$.Username}}/{{$.Reponame}}/commit/{{$commit.Id}}">{{$commit.Message}}</a></span>
+ </td>
+ <td class="date">
+ <span class="wrap">{{TimeSince $commit.Committer.When}}</span>
+ </td>
+ </tr>
+ {{end}}
</tbody>
</table>
</div>
{{if .ReadmeExist}}
{{template "repo/single_file" .}}
-{{end}} \ No newline at end of file
+{{end}}
diff --git a/templates/repo/toolbar.tmpl b/templates/repo/toolbar.tmpl
index 5484204832..a14aae9ca9 100644
--- a/templates/repo/toolbar.tmpl
+++ b/templates/repo/toolbar.tmpl
@@ -11,12 +11,12 @@
<li class="{{if .IsRepoToolbarIssues}}active{{end}}"><a href="{{.RepoLink}}/issues">{{if .Repository.NumOpenIssues}}<span class="badge">{{.Repository.NumOpenIssues}}</span> {{end}}Issues <!--<span class="badge">42</span>--></a></li>
{{if .IsRepoToolbarIssues}}
<li class="tmp">{{if .IsRepoToolbarIssuesList}}<a href="{{.RepoLink}}/issues/new"><button class="btn btn-primary btn-sm">New Issue</button>
- </a>{{else}}<a href="{{.RepoLink}}/issues"><button class="btn btn-primary btn-sm">Issues List</button></a>{{end}}</li>
+ </a>{{end}}</li>
{{end}}
- <li class="{{if .IsRepoToolbarReleases}}active{{end}}"><a href="{{.RepoLink}}/releases">{{if .Repository.NumReleases}}<span class="badge">{{.Repository.NumReleases}}</span> {{end}}Releases</a></li>
- {{if .IsRepoToolbarReleases}}
+ <li class="{{if .IsRepoToolbarReleases}}active{{end}}"><a href="{{.RepoLink}}/releases">{{if .Repository.NumTags}}<span class="badge">{{.Repository.NumTags}}</span> {{end}}Releases</a></li>
+ {{if .IsRepoToolbarReleases}}{{if .IsRepositoryOwner}}{{if not .IsRepoReleaseNew}}
<li class="tmp"><a href="{{.RepoLink}}/releases/new"><button class="btn btn-primary btn-sm">New Release</button></a></li>
- {{end}}
+ {{end}}{{end}}{{end}}
<!-- <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
<ul class="dropdown-menu">
diff --git a/templates/status/401.tmpl b/templates/status/401.tmpl
new file mode 100644
index 0000000000..98995381af
--- /dev/null
+++ b/templates/status/401.tmpl
@@ -0,0 +1,6 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+<div class="container">
+ 401 Unauthorized
+</div>
+{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/status/404.tmpl b/templates/status/404.tmpl
index f68676fe23..6adb3d7163 100644
--- a/templates/status/404.tmpl
+++ b/templates/status/404.tmpl
@@ -4,6 +4,6 @@
<p style="margin-top: 80px"><img src="/img/404.png" alt="404"/></p>
<hr/>
<p>Application Version: {{AppVer}}</p>
- <p>If you think it is an error, please open an issue on <a href="https://github.com/gogits/gogs/issues/new">GitHub</a>.</p>
+ <p>If you think this is an error, please open an issue on <a href="https://github.com/gogits/gogs/issues/new">GitHub</a>.</p>
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "base/footer" .}}
diff --git a/templates/status/500.tmpl b/templates/status/500.tmpl
index dd7358115d..07edd3620a 100644
--- a/templates/status/500.tmpl
+++ b/templates/status/500.tmpl
@@ -2,8 +2,8 @@
{{template "base/navbar" .}}
<div id="body" class="container text-center">
<p style="margin-top: 80px"><img src="/img/500.png" alt="404"/></p>
- <hr/>
- <p>An error is occurred : {{.ErrorMsg}}</p>
+ {{if .ErrorMsg}}<hr/>
+ <p>An error is occurred : {{.ErrorMsg}}</p>{{end}}
<hr/>
<p>Application Version: {{AppVer}}</p>
</div>
diff --git a/templates/user/activate.tmpl b/templates/user/activate.tmpl
new file mode 100644
index 0000000000..1df3646b6d
--- /dev/null
+++ b/templates/user/activate.tmpl
@@ -0,0 +1,36 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+<div id="body" class="container">
+ <form action="/user/activate" method="post" class="form-horizontal card" id="login-card">
+ {{.CsrfTokenHtml}}
+ <h3>Activate Your Account</h3>
+ {{if .IsActivatePage}}
+ {{if .ServiceNotEnabled}}
+ <p>Sorry, Register Mail Confirmation has been disabled.</p>
+ {{else if .ResendLimited}}
+ <p>Sorry, you are sending an activation e-mail too frequently. Please wait 3 minutes.</p>
+ {{else}}
+ <p>A new confirmation e-mail has been sent to <b>{{.SignedUser.Email}}</b>, please check your inbox within the next {{.Hours}} hours to complete your registration.</p>
+ <hr/>
+ <a href="http://{{Mail2Domain .SignedUser.Email}}" class="btn btn-lg btn-success">Sign in to your e-mail</a>
+ {{end}}
+ {{else}}
+ {{if .IsSendRegisterMail}}
+ <p>A confirmation e-mail has been sent to <b>{{.Email}}</b>, please check your inbox within the next {{.Hours}} hours to complete your registration.</p>
+ <hr/>
+ <a href="http://{{Mail2Domain .Email}}" class="btn btn-lg btn-success">Sign in to your e-mail</a>
+ {{else if .IsActivateFailed}}
+ <p>Sorry, your confirmation code has exipired or not valid.</p>
+ {{else}}
+ <p>Hi, {{.SignedUser.Name}}, you have an unconfirmed email address(<b>{{.SignedUser.Email}}</b>). If you haven't received a confirmation e-mail or need to resend a new one, please click on the button below.</p>
+ <hr/>
+ <div class="form-group">
+ <div class="col-md-offset-4 col-md-6">
+ <button type="submit" class="btn btn-lg btn-primary">Click here to resend your activation e-mail</button>
+ </div>
+ </div>
+ {{end}}
+ {{end}}
+ </form>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/user/dashboard.tmpl b/templates/user/dashboard.tmpl
index bc0853fb0d..9781b8db1e 100644
--- a/templates/user/dashboard.tmpl
+++ b/templates/user/dashboard.tmpl
@@ -22,24 +22,33 @@
<span class="clearfix"></span>
</li>
{{else}}
- <li>No any activity yet.</li>
+ <li>Oh. Looks like there isn't any activity here yet. Get Busy!</li>
{{end}}
</ul>
</div>
<div id="feed-right" class="col-md-4">
<div class="panel panel-default repo-panel">
<div class="panel-heading">Your Repositories
- <a class="btn btn-success pull-right btn-sm" href="/repo/create"><i class="fa fa-plus-square"></i>New Repo</a>
+ <div class="btn-group pull-right" id="user-dashboard-repo-new">
+ <button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus-square"></i>New</button>
+ <div class="dropdown-menu dropdown-menu-right">
+ <ul class="list-unstyled">
+ <li><a href="/repo/create"><i class="fa fa-book"></i>Repository</a></li>
+ <li><a href="/repo/migrate"><i class="fa fa-clipboard"></i>Migration</a></li>
+ <!-- <li><a href="#"><i class="fa fa-users"></i>Organization</a></li> -->
+ </ul>
+ </div>
+ </div>
</div>
<div class="panel-body">
<ul class="list-group">{{range .MyRepos}}
<li class="list-group-item"><a href="/{{$.SignedUserName}}/{{.Name}}">
<!-- <span class="stars pull-right"><i class="fa fa-star"></i>{{.NumStars}}</span> -->
- <i class="fa fa-book"></i>{{.Name}}</a>
+ <i class="fa fa-book"></i>{{.Name}}{{if .IsPrivate}} <span class="label label-default">Private</span>{{end}}</a>
</li>{{end}}
</ul>
</div>
</div>
</div>
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "base/footer" .}}
diff --git a/templates/user/delete.tmpl b/templates/user/delete.tmpl
index 17c9ea8925..6493bef38e 100644
--- a/templates/user/delete.tmpl
+++ b/templates/user/delete.tmpl
@@ -1,24 +1,16 @@
{{template "base/head" .}}
{{template "base/navbar" .}}
<div id="body" class="container" data-page="user">
- <div id="user-setting-nav" class="col-md-3">
- <h4>Account Setting</h4>
- <ul class="list-group">
- <li class="list-group-item"><a href="/user/setting">Account Profile</a></li>
- <li class="list-group-item"><a href="/user/setting/password">Password</a></li>
- <!-- <li class="list-group-item"><a href="/user/setting/notification">Notifications</a></li> -->
- <li class="list-group-item"><a href="/user/setting/ssh/">SSH Keys</a></li>
- <!-- <li class="list-group-item"><a href="/user/setting/security">Security</a></li> -->
- <li class="list-group-item list-group-item-success"><a href="/user/delete">Delete Account</a></li>
- </ul>
- </div>
+ {{template "user/setting_nav" .}}
<div id="user-setting-container" class="col-md-9">
<h4>Delete Account</h4>
- <p class="alert alert-danger">{{if not .HasError}}The operation will delete your account permanently. Sorry to see you go, but we know you'll back soon.{{else}}{{.ErrorMsg}}{{end}}</p>
+ {{template "base/alert" .}}
+ {{if not .Flash.ErrorMsg}}<p class="alert alert-danger">The operation will delete your account permanently. Sorry to see you go, but we know you'll back soon.</p>{{end}}
<div class="form-group">
<button type="submit" class="btn btn-danger btn-lg" href="#delete-account-modal" id="delete-account" data-toggle="modal">Delete Account</button>
</div>
</div>
+
<div class="modal fade" id="delete-account-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<form action="/user/delete" method="post" class="modal-content" id="user-delete">
diff --git a/templates/user/forgot_passwd.tmpl b/templates/user/forgot_passwd.tmpl
new file mode 100644
index 0000000000..57564ffd4f
--- /dev/null
+++ b/templates/user/forgot_passwd.tmpl
@@ -0,0 +1,32 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+<div id="body" class="container">
+ <form action="/user/forget_password" method="post" class="form-horizontal card" id="login-card">
+ {{.CsrfTokenHtml}}
+ <h3>Reset Your Password</h3>
+ {{template "base/alert" .}}
+ {{if .IsResetSent}}
+ <p>A confirmation e-mail has been sent to <b>{{.Email}}</b>, please check your inbox within {{.Hours}} hours.</p>
+ <hr/>
+ <a href="http://{{Mail2Domain .Email}}" class="btn btn-lg btn-success">Sign in to your e-mail</a>
+ {{else if .IsResetRequest}}
+ <div class="form-group {{if .Err_Email}}has-error has-feedback{{end}}">
+ <label class="col-md-3 control-label">Email: </label>
+ <div class="col-md-7">
+ <input name="email" class="form-control" placeholder="Type your e-mail address" required="required">
+ </div>
+ </div>
+ <hr/>
+ <div class="form-group">
+ <div class="col-md-offset-4 col-md-6">
+ <button type="submit" class="btn btn-lg btn-primary">Click here to send resend confirmation e-mail</button>
+ </div>
+ </div>
+ {{else if .IsResetDisable}}
+ <p>Sorry, mail service is not enabled.</p>
+ {{else if .ResendLimited}}
+ <p>Sorry, you are sending an e-mail too frequently, please wait another 3 minutes and try again.</p>
+ {{end}}
+ </form>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/user/password.tmpl b/templates/user/password.tmpl
index b2cdc72d9e..cba9cce0c5 100644
--- a/templates/user/password.tmpl
+++ b/templates/user/password.tmpl
@@ -6,9 +6,8 @@
<div id="setting-pwd">
<h4>Password</h4>
<form class="form-horizontal" id="password-form" method="post" action="/user/setting/password">
- {{.CsrfTokenHtml}}
- {{if .IsSuccess}}
- <p class="alert alert-success">Password is changed successfully. You can now sign in via new password.</p>{{else if .HasError}}<p class="alert alert-danger form-error">{{.ErrorMsg}}</p>{{end}}
+ {{.CsrfTokenHtml}}
+ {{template "base/alert" .}}
<div class="form-group">
<label class="col-md-3 control-label">Old Password<strong class="text-danger">*</strong></label>
<div class="col-md-7">
@@ -33,7 +32,7 @@
<div class="form-group">
<div class="col-md-offset-3 col-md-7">
<button type="submit" class="btn btn-primary">Change Password</button>&nbsp;&nbsp;
- <a href="/forget-password/">Forgot your password?</a>
+ <a href="/user/forget_password/">Forgot your password?</a>
</div>
</div>
</form>
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl
index 88ee318f4a..0319f46c2e 100644
--- a/templates/user/profile.tmpl
+++ b/templates/user/profile.tmpl
@@ -20,6 +20,20 @@
<li class="list-group-item"><i class="fa fa-link"></i><a target="_blank" href="{{.Owner.Website}}">{{.Owner.Website}}</a></li>
{{end}}
<li class="list-group-item"><i class="fa fa-clock-o"></i>Joined on {{DateFormat .Owner.Created "M d, Y"}}</li>
+ <!-- <hr> -->
+ <!-- <li class="list-group-item" style="padding-top: 5px;">
+ <div class="profile-rel">
+ <div class="col-md-6 followers">
+ <strong>123</strong>
+ <p>followers</p>
+ </div>
+ <div class="col-md-6 following">
+ <strong>123</strong>
+ <p>following</p>
+ </div>
+ </div>
+ </li>
+ <hr> -->
</ul>
</div>
</div>
@@ -39,19 +53,18 @@
<span class="clearfix"></span>
</li>
{{else}}
- <li>No any public activity yet.</li>
+ <li>No public activity yet.</li>
{{end}}
</ul>
</div>
{{else}}
- {{$owner := .Owner}}
<div class="tab-pane active">
<ul class="list-unstyled repo-list">
{{range .Repos}}
<li>
<div class="meta pull-right"><!-- <i class="fa fa-star"></i> {{.NumStars}} --> <i class="fa fa-code-fork"></i> {{.NumForks}}</div>
<h4>
- <a href="/{{$owner.Name}}/{{.Name}}">{{.Name}}</a>
+ <a href="/{{$.Owner.Name}}/{{.Name}}">{{.Name}}{{if .IsPrivate}} <span class="label label-default">Private</span>{{end}}</a>
</h4>
<p class="desc">{{.Description}}</p>
<div class="info">Last updated {{.Updated|TimeSince}}</div>
diff --git a/templates/user/publickey.tmpl b/templates/user/publickey.tmpl
index ecdeb035d2..8eb7be487c 100644
--- a/templates/user/publickey.tmpl
+++ b/templates/user/publickey.tmpl
@@ -4,8 +4,8 @@
{{template "user/setting_nav" .}}
<div id="user-setting-container" class="col-md-9">
<div id="ssh-keys">
- <h4>SSH Keys</h4>{{if .AddSSHKeySuccess}}
- <p class="alert alert-success">New SSH Key has been added !</p>{{else if .HasError}}<p class="alert alert-danger">{{.ErrorMsg}}</p>{{end}}
+ <h4>SSH Keys</h4>
+ {{template "base/alert" .}}
<ul id="ssh-keys-list" class="list-group">
<li class="list-group-item"><span class="name">SSH Key's name</span></li>
{{range .Keys}}
@@ -30,7 +30,7 @@
<div class="modal-body">
<div class="form-group">
- <label class="col-md-3 control-label">The name of key<strong class="text-danger">*</strong></label>
+ <label class="col-md-3 control-label">Key Name<strong class="text-danger">*</strong></label>
<div class="col-md-8">
<input name="keyname" class="form-control" placeholder="Type your preferred name" required="required">
</div>
@@ -55,4 +55,4 @@
</div>
</div>
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "base/footer" .}}
diff --git a/templates/user/reset_passwd.tmpl b/templates/user/reset_passwd.tmpl
new file mode 100644
index 0000000000..a2a5ca9ece
--- /dev/null
+++ b/templates/user/reset_passwd.tmpl
@@ -0,0 +1,26 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+<div id="body" class="container">
+ <form action="/user/reset_password?code={{.Code}}" method="post" class="form-horizontal card" id="login-card">
+ {{.CsrfTokenHtml}}
+ <h3>Reset Your Pasword</h3>
+ {{template "base/alert" .}}
+ {{if .IsResetForm}}
+ <div class="form-group">
+ <label class="col-md-4 control-label">Password: </label>
+ <div class="col-md-6">
+ <input name="passwd" type="password" class="form-control" placeholder="Type your password" required="required">
+ </div>
+ </div>
+ <hr/>
+ <div class="form-group">
+ <div class="col-md-offset-4 col-md-6">
+ <button type="submit" class="btn btn-lg btn-primary">Click here to reset your password</button>
+ </div>
+ </div>
+ {{else}}
+ <p>Sorry, your confirmation code has expired or is not valid.</p>
+ {{end}}
+ </form>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/user/setting.tmpl b/templates/user/setting.tmpl
index b32689fe12..59357d7c93 100644
--- a/templates/user/setting.tmpl
+++ b/templates/user/setting.tmpl
@@ -7,12 +7,13 @@
<h4>Account Profile</h4>
<form class="form-horizontal" id="password-form" method="post" action="/user/setting">
{{.CsrfTokenHtml}}
- {{if .IsSuccess}}<p class="alert alert-success">Your profile has been successfully updated.</p>{{else if .HasError}}<p class="alert alert-danger form-error">{{.ErrorMsg}}</p>{{end}}
- <p>Your Email will be public and used for Account related notifications and any web based operations made via the web.</p>
+ {{template "base/alert" .}}
+ <p>Your Email address is public and will be used for any account related notifications, and any web based operations made via the site.</p>
<div class="form-group">
- <label class="col-md-2 control-label">Username<strong class="text-danger">*</strong></label>
+ <label class="col-md-2 control-label" for="user-setting-username">Username<strong class="text-danger">*</strong></label>
<div class="col-md-8">
- <input name="username" class="form-control" placeholder="Type your user name" required="required" value="{{.SignedUser.Name}}" title="{{.SignedUser.Name}}">
+ <input name="username" class="form-control" placeholder="Type your user name" required="required" value="{{.SignedUser.Name}}" title="{{.SignedUser.Name}}" id="user-setting-username">
+ <p class="help-block hidden"><span class="text-danger">Cautious : </span>your username is changing !</p>
</div>
</div>
@@ -53,4 +54,4 @@
</div>
</div>
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "base/footer" .}}
diff --git a/templates/user/setting_nav.tmpl b/templates/user/setting_nav.tmpl
index c0f2ae03dd..9c7ae5208f 100644
--- a/templates/user/setting_nav.tmpl
+++ b/templates/user/setting_nav.tmpl
@@ -2,6 +2,7 @@
<h4>Account Setting</h4>
<ul class="list-group">
<li class="list-group-item{{if .IsUserPageSetting}} list-group-item-success{{end}}"><a href="/user/setting">Account Profile</a></li>
+ <li class="list-group-item{{if .IsUserPageSettingSocial}} list-group-item-success{{end}}"><a href="/user/setting/social">Social Account</a></li>
<li class="list-group-item{{if .IsUserPageSettingPasswd}} list-group-item-success{{end}}"><a href="/user/setting/password">Password</a></li>
<!-- <li class="list-group-item{{if .IsUserPageSettingNotify}} list-group-item-success{{end}}"><a href="/user/setting/notification">Notifications</a></li> -->
<li class="list-group-item{{if .IsUserPageSettingSSH}} list-group-item-success{{end}}"><a href="/user/setting/ssh/">SSH Keys</a></li>
diff --git a/templates/user/signin.tmpl b/templates/user/signin.tmpl
index b6c39af1b8..955c82f430 100644
--- a/templates/user/signin.tmpl
+++ b/templates/user/signin.tmpl
@@ -3,8 +3,12 @@
<div class="container" id="body" data-page="user-signin">
<form action="/user/login" method="post" class="form-horizontal card" id="login-card">
{{.CsrfTokenHtml}}
+ {{if .IsSocialLogin}}
+ <h3>Social login: 2nd step <small>associate account</small></h3>
+ {{else}}
<h3>Log in</h3>
- <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div>
+ {{end}}
+ {{template "base/alert" .}}
<div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}">
<label class="col-md-4 control-label">Username: </label>
<div class="col-md-6">
@@ -18,8 +22,8 @@
<input name="passwd" type="password" class="form-control" placeholder="Type your password" required="required">
</div>
</div>
-
- <div class="form-group">
+
+ {{if not .IsSocialLogin}}<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<div class="checkbox">
<label>
@@ -28,24 +32,40 @@
</label>
</div>
</div>
- </div>
+ </div>{{end}}
<div class="form-group">
<div class="col-md-offset-4 col-md-6">
<button type="submit" class="btn btn-lg btn-primary">Log In</button>
- <a href="/forget-password/">Forgot your password?</a>
+ {{if not .IsSocialLogin}}<a href="/user/forget_password/">Forgot your password?</a>{{end}}
</div>
</div>
- <div class="form-group">
+ {{if not .IsSocialLogin}}<div class="form-group">
<div class="col-md-offset-4 col-md-6">
<a href="/user/sign_up">Need an account? Sign up now.</a>
</div>
</div>
+ {{if .OauthEnabled}}
<div class="form-group text-center" id="social-login">
- <a class="btn btn-danger btn-lg" href="/user/sign_up">Register new account</a>
+ <h4><span>or</span></h4>
+ <!--
+ <a href="/user/login/github?next=/user/sign_up" class="btn btn-default facebbok">
+ <i class="fa fa-facebook-square fa-2x"></i>
+ <span>Facebook</span>
+ </a>
+ <a href="/user/login/github?next=/user/sign_up" class="btn btn-default weibo">
+ <i class="fa fa-weibo fa-2x"></i>
+ <span>Weibo</span>
+ </a>-->
+ {{if .OauthService.GitHub}}<a href="/user/login/github?next=/user/sign_up" class="btn btn-default"><i class="fa fa-github-square fa-2x"></i><span>GitHub</span></a>{{end}}
+ {{if .OauthService.Google}}<a href="/user/login/google?next=/user/sign_up" class="btn btn-default"><i class="fa fa-google-plus-square fa-2x"></i><span>Google</span></a>{{end}}
+ {{if .OauthService.Twitter}}<a href="/user/login/twitter?next=/user/sign_up" class="btn btn-default"><i class="fa fa-twitter-square fa-2x"></i><span>Twitter</span></a>{{end}}
+ {{if .OauthService.Tencent}}<a href="/user/login/qq?next=/user/sign_up" class="btn btn-default"><i class="fa fa-linux fa-2x"></i><span>Tencent QQ</span></a>{{end}}
+ {{if .OauthService.Weibo}}<a href="/user/login/weibo?next=/user/sign_up" class="btn btn-default"><i class="fa fa-weibo fa-2x"></i><span>Weibo</span></a>{{end}}
</div>
+ {{end}}{{end}}
</form>
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "base/footer" .}}
diff --git a/templates/user/signup.tmpl b/templates/user/signup.tmpl
index 6ed595a350..578ffa9eed 100644
--- a/templates/user/signup.tmpl
+++ b/templates/user/signup.tmpl
@@ -1,20 +1,23 @@
{{template "base/head" .}}
{{template "base/navbar" .}}
-<div class="container" id="body" data-page="user-signup">
+<div class="container" id="body">
<form action="/user/sign_up" method="post" class="form-horizontal card" id="login-card">
{{.CsrfTokenHtml}}
- {{if .DisenableRegisteration}}
- Sorry, registeration has been disenabled, you can only get account from administrator.
+ {{if .DisableRegistration}}
+ Sorry, registration has been disabled. Please contact the site administrator.
{{else}}
- <h3>Sign Up</h3>
- <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div>
+ {{if .IsSocialLogin}}
+ <h3>Social login: 2nd step <small>complete information</small></h3>
+ {{else}}
+ <h3>Sign Up</h3>
+ {{end}}
+ {{template "base/alert" .}}
<div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}">
<label class="col-md-4 control-label">Username: </label>
<div class="col-md-6">
<input name="username" class="form-control" placeholder="Type your username" value="{{.username}}" required="required">
</div>
</div>
-
<div class="form-group {{if .Err_Email}}has-error has-feedback{{end}}">
<label class="col-md-4 control-label">Email: </label>
<div class="col-md-6">
@@ -44,10 +47,14 @@
<div class="form-group">
<div class="col-md-offset-4 col-md-6">
+ {{if .IsSocialLogin}}
+ <a href="/user/login">Already have an account? Bind now!</a>
+ {{else}}
<a href="/user/login">Already have an account? Sign in now!</a>
+ {{end}}
</div>
</div>
{{end}}
</form>
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "base/footer" .}}
diff --git a/templates/user/social.tmpl b/templates/user/social.tmpl
new file mode 100644
index 0000000000..f0b1132385
--- /dev/null
+++ b/templates/user/social.tmpl
@@ -0,0 +1,17 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+<div id="body" class="container" data-page="user">
+ {{template "user/setting_nav" .}}
+ <div id="user-setting-container" class="col-md-9">
+ <div id="ssh-keys">
+ <h4>Social Account</h4>
+ {{template "base/alert" .}}
+ <ul id="ssh-keys-list" class="list-group">
+ {{range .Socials}}
+ <i class="fa {{Oauth2Icon .Type}} fa-3x"></i>
+ {{end}}
+ </ul>
+ </div>
+ </div>
+</div>
+{{template "base/footer" .}} \ No newline at end of file