aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-04-11 10:28:23 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-04-11 10:28:23 +0800
commit8cfa2be4332abdc8bdcadead36d065eab3d2d55e (patch)
tree9fe6d03f5006c3dced1f9d5102f43504fb58e8b5 /templates
parentdb39e58a139ef8581b4b61d2d4a68b4e5324acdf (diff)
parent306aa5bffe7868207ed7b773c1aedbf3f0a659ad (diff)
downloadgitea-8cfa2be4332abdc8bdcadead36d065eab3d2d55e.tar.gz
gitea-8cfa2be4332abdc8bdcadead36d065eab3d2d55e.zip
Merge branch 'dev' of github.com:gogits/gogs into dev
Diffstat (limited to 'templates')
-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/install.tmpl6
-rw-r--r--templates/issue/create.tmpl1
-rw-r--r--templates/repo/create.tmpl2
-rw-r--r--templates/repo/diff.tmpl8
-rw-r--r--templates/repo/mirror.tmpl2
-rw-r--r--templates/repo/setting.tmpl11
-rw-r--r--templates/status/500.tmpl4
-rw-r--r--templates/user/delete.tmpl16
-rw-r--r--templates/user/forgot_passwd.tmpl2
-rw-r--r--templates/user/password.tmpl7
-rw-r--r--templates/user/reset_passwd.tmpl2
-rw-r--r--templates/user/setting.tmpl2
-rw-r--r--templates/user/signin.tmpl2
-rw-r--r--templates/user/signup.tmpl2
17 files changed, 37 insertions, 36 deletions
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/install.tmpl b/templates/install.tmpl
index c70cfa3e6b..c1fd76659c 100644
--- a/templates/install.tmpl
+++ b/templates/install.tmpl
@@ -3,7 +3,7 @@
<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>
+ {{template "base/alert" .}}
<p class="help-block text-center">Gogs requires MySQL or PostgreSQL, SQLite3 only available for official binary version</p>
<div class="form-group">
<label class="col-md-3 control-label">Database Type: </label>
@@ -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}}>
diff --git a/templates/issue/create.tmpl b/templates/issue/create.tmpl
index 5375040b09..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>
diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl
index dc509fc1cc..97c7945616 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">
diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl
index 5c95ddefde..396aa795f5 100644
--- a/templates/repo/diff.tmpl
+++ b/templates/repo/diff.tmpl
@@ -30,12 +30,16 @@
{{range .Diff.Files}}
<li>
<div class="diff-counter count pull-right">
+ {{if Subtract .Addition .Deletion}}
<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,12 +53,16 @@
<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 Subtract .Addition .Deletion}}
<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>
<span class="file">{{.Name}}</span>
diff --git a/templates/repo/mirror.tmpl b/templates/repo/mirror.tmpl
index 2ac21dd617..0f10d1f549 100644
--- a/templates/repo/mirror.tmpl
+++ b/templates/repo/mirror.tmpl
@@ -4,7 +4,7 @@
<form action="/repo/create" method="post" class="form-horizontal card" id="repo-create">
{{.CsrfTokenHtml}}
<h3>Create Repository Mirror</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">From<strong class="text-danger">*</strong></label>
<div class="col-md-8">
diff --git a/templates/repo/setting.tmpl b/templates/repo/setting.tmpl
index 1adf0090c7..ff3b73b59a 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
@@ -44,14 +44,17 @@
</div>
</div>
<hr>
- <!-- <div class="form-group">
+ <div class="form-group">
<label class="col-md-3 text-right">Default Branch</label>
<div class="col-md-9">
<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>
<div class="form-group">
<div class="col-md-offset-3 col-md-9">
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/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
index a099ff2744..7990ab18cd 100644
--- a/templates/user/forgot_passwd.tmpl
+++ b/templates/user/forgot_passwd.tmpl
@@ -4,7 +4,7 @@
<form action="/user/forget_password" method="post" class="form-horizontal card" id="login-card">
{{.CsrfTokenHtml}}
<h3>Reset Your Password</h3>
- <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div>
+ {{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/>
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/reset_passwd.tmpl b/templates/user/reset_passwd.tmpl
index 9190c7c13c..966b6cb3b5 100644
--- a/templates/user/reset_passwd.tmpl
+++ b/templates/user/reset_passwd.tmpl
@@ -4,7 +4,7 @@
<form action="/user/reset_password?code={{.Code}}" method="post" class="form-horizontal card" id="login-card">
{{.CsrfTokenHtml}}
<h3>Reset Your Pasword</h3>
- <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div>
+ {{template "base/alert" .}}
{{if .IsResetForm}}
<div class="form-group">
<label class="col-md-4 control-label">Password: </label>
diff --git a/templates/user/setting.tmpl b/templates/user/setting.tmpl
index d582833870..762dc33b7f 100644
--- a/templates/user/setting.tmpl
+++ b/templates/user/setting.tmpl
@@ -7,7 +7,7 @@
<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}}
+ {{template "base/alert" .}}
<p>Your Email will be public and used for Account related notifications and any web based operations made via the web.</p>
<div class="form-group">
<label class="col-md-2 control-label" for="user-setting-username">Username<strong class="text-danger">*</strong></label>
diff --git a/templates/user/signin.tmpl b/templates/user/signin.tmpl
index eb4cb9ccee..294c0d3418 100644
--- a/templates/user/signin.tmpl
+++ b/templates/user/signin.tmpl
@@ -4,7 +4,7 @@
<form action="/user/login" method="post" class="form-horizontal card" id="login-card">
{{.CsrfTokenHtml}}
<h3>Log in</h3>
- <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-4 control-label">Username: </label>
<div class="col-md-6">
diff --git a/templates/user/signup.tmpl b/templates/user/signup.tmpl
index 6ed595a350..87fa80ccc1 100644
--- a/templates/user/signup.tmpl
+++ b/templates/user/signup.tmpl
@@ -7,7 +7,7 @@
Sorry, registeration has been disenabled, you can only get account from administrator.
{{else}}
<h3>Sign Up</h3>
- <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-4 control-label">Username: </label>
<div class="col-md-6">