aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2018-04-12 09:55:58 -0400
committerUnknwon <u@gogs.io>2018-04-12 09:55:58 -0400
commitf2ecfdc96a338815ffb2be898b3114031f0da48c (patch)
tree68e98cdb346e8d57e7d1b25169b391dd7afc0037 /templates
parent717d409b7273f7874c38268e1b908596277dacac (diff)
auth: support authentication source config file (#3142)
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/auth/edit.tmpl4
-rw-r--r--templates/admin/auth/list.tmpl8
-rw-r--r--templates/admin/auth/new.tmpl8
-rw-r--r--templates/user/auth/login.tmpl18
4 files changed, 28 insertions, 10 deletions
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl
index 32de620c..fba6fe48 100644
--- a/templates/admin/auth/edit.tmpl
+++ b/templates/admin/auth/edit.tmpl
@@ -189,7 +189,9 @@
<div class="field">
<button class="ui green button">{{.i18n.Tr "admin.auths.update"}}</button>
- <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{.i18n.Tr "admin.auths.delete"}}</div>
+ {{if not .Source.LocalFile}}
+ <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{.i18n.Tr "admin.auths.delete"}}</div>
+ {{end}}
</div>
</form>
</div>
diff --git a/templates/admin/auth/list.tmpl b/templates/admin/auth/list.tmpl
index c0b08d2a..d989a77c 100644
--- a/templates/admin/auth/list.tmpl
+++ b/templates/admin/auth/list.tmpl
@@ -29,7 +29,13 @@
<td>{{.TypeName}}</td>
<td><i class="fa fa{{if .IsActived}}-check{{end}}-square-o"></i></td>
<td><span class="poping up" data-content="{{DateFmtLong .Updated}}" data-variation="tiny">{{DateFmtShort .Updated}}</span></td>
- <td><span class="poping up" data-content="{{DateFmtLong .Created}}" data-variation="tiny">{{DateFmtShort .Created}}</span></td>
+ <td>
+ {{if .Created.IsZero}}
+ N/A
+ {{else}}
+ <span class="poping up" data-content="{{DateFmtLong .Created}}" data-variation="tiny">{{DateFmtShort .Created}}</span>
+ {{end}}
+ </td>
<td><a href="{{AppSubURL}}/admin/auths/{{.ID}}"><i class="fa fa-pencil-square-o"></i></a></td>
</tr>
{{end}}
diff --git a/templates/admin/auth/new.tmpl b/templates/admin/auth/new.tmpl
index e164f531..d6b0c6e8 100644
--- a/templates/admin/auth/new.tmpl
+++ b/templates/admin/auth/new.tmpl
@@ -188,14 +188,6 @@
</div>
</form>
</div>
-
- <h4 class="ui top attached header">
- {{.i18n.Tr "admin.auths.tips"}}
- </h4>
- <div class="ui attached segment">
- <h5>GMail Settings:</h5>
- <p>Host: smtp.gmail.com, Port: 587, Enable TLS Encryption: true</p>
- </div>
</div>
</div>
</div>
diff --git a/templates/user/auth/login.tmpl b/templates/user/auth/login.tmpl
index 01306971..3bc8e13f 100644
--- a/templates/user/auth/login.tmpl
+++ b/templates/user/auth/login.tmpl
@@ -17,6 +17,24 @@
<label for="password">{{.i18n.Tr "password"}}</label>
<input id="password" name="password" type="password" autocomplete="off" value="{{.password}}" required>
</div>
+ {{if .LoginSources}}
+ <div class="required inline field {{if .Err_LoginSource}}error{{end}}">
+ <label for="password">{{.i18n.Tr "auth.auth_source"}}</label>
+ <div class="ui selection dropdown">
+ <input type="hidden" id="login_source" name="login_source" value="{{.login_source}}" required>
+ <span class="text">
+ {{.i18n.Tr "auth.local"}}
+ </span>
+ <i class="dropdown icon"></i>
+ <div class="menu">
+ <div class="item" data-value="0">{{.i18n.Tr "auth.local"}}</div>
+ {{range .LoginSources}}
+ <div class="item" data-value="{{.ID}}">{{.Name}}</div>
+ {{end}}
+ </div>
+ </div>
+ </div>
+ {{end}}
<div class="inline field">
<label></label>
<div class="ui checkbox">