114 lignes
5,3 Kio
HTML
114 lignes
5,3 Kio
HTML
{{define "profile_edit_content"}}
|
||
{{with .UserProfile}}
|
||
{{ range (index $.FormInfos "infos")}}
|
||
<div class="alert alert-info"><a class="panel-close close" data-dismiss="alert">×</a><i class="glyphicon glyphicon-info-sign"></i> {{ . }}</div>
|
||
{{end}}
|
||
{{ range (index $.FormErrors "errors")}}
|
||
<div class="alert alert-danger"><a class="panel-close close" data-dismiss="alert">×</a><i class="glyphicon glyphicon-exclamation-sign"></i> {{ . }}</div>
|
||
{{end}}
|
||
<h3>{{ call $.T "personal_info"}}</h3>
|
||
|
||
<form class="form-horizontal" role="form" method="POST">
|
||
<div class="form-group">
|
||
<label class="col-lg-3 control-label">{{call $.T "api_token" }}:</label>
|
||
<div class="col-lg-8">{{.ApiToken}}</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-3 control-label">{{ call $.T "email_address" }}:</label>
|
||
<div class="col-lg-8">
|
||
<input class="form-control" type="text" name="email" id="email" value="{{.Email}}">
|
||
{{ range (index $.FormErrors "email")}}
|
||
<p class="text-error">{{ . }}</p>
|
||
{{end}}
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-3 control-label">{{ call $.T "language"}}:</label>
|
||
<div class="col-lg-8">
|
||
<div class="ui-select">
|
||
<select id="language" name="language" class="form-control">
|
||
{{ $userLanguage := .Language }}
|
||
{{ range $tag, $translatedName := $.Languages }}
|
||
<option value="{{ $tag }}" {{ if or (eq $userLanguage $tag) (and (eq $userLanguage "") (eq $tag getDefaultLanguage)) }}selected{{end}}>{{ $translatedName }} {{if eq $tag getDefaultLanguage}}({{ call $.T "default" }}){{end}}</option>
|
||
{{ end }}
|
||
</select>
|
||
</div>
|
||
{{ range (index $.FormErrors "language")}}
|
||
<p class="text-error">{{ . }}</p>
|
||
{{end}}
|
||
</div>
|
||
</div>
|
||
{{ if not (HasAdmin $.User)}}
|
||
<div class="form-group">
|
||
<label class="col-md-3 control-label">{{ call $.T "current_password"}}:</label>
|
||
<div class="col-md-8">
|
||
<input class="form-control" name="current_password" id="current_password" type="password">
|
||
{{ range (index $.FormErrors "current_password")}}
|
||
<p class="text-error">{{ . }}</p>
|
||
{{end}}
|
||
</div>
|
||
</div>
|
||
{{end}}
|
||
<div class="form-group">
|
||
<label class="col-md-3 control-label">{{ call $.T "password"}}:</label>
|
||
<div class="col-md-8">
|
||
<input class="form-control" name="password" id="password" type="password">
|
||
{{ range (index $.FormErrors "password")}}
|
||
<p class="text-error">{{ . }}</p>
|
||
{{end}}
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-3 control-label">{{ call $.T "confirm_password"}}:</label>
|
||
<div class="col-md-8">
|
||
<input class="form-control" name="password_confirmation" id="password_confirmation" type="password">
|
||
{{ range (index $.FormErrors "password_confirmation")}}
|
||
<p class="text-error">{{ . }}</p>
|
||
{{end}}
|
||
</div>
|
||
</div>
|
||
{{ if HasAdmin $.User}}
|
||
<h3>{{ call $.T "moderation"}}</h3>
|
||
<div class="form-group">
|
||
<label class="col-md-3 control-label">{{ call $.T "username"}}:</label>
|
||
<div class="col-md-8">
|
||
<input class="form-control" name="username" id="username" type="text" value="{{.Username}}">
|
||
{{ range (index $.FormErrors "username")}}
|
||
<p class="text-error">{{ . }}</p>
|
||
{{end}}
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-3 control-label">{{ call $.T "role" }}:</label>
|
||
<div class="col-lg-8">
|
||
<div class="ui-select">
|
||
<select id="status" name="status" class="form-control">
|
||
<option value="-1" {{ if eq .Status -1 }}selected{{end}}>{{ call $.T "banned"}}</option>
|
||
<option value="0" {{ if eq .Status 0 }}selected{{end}}>{{ call $.T "member"}} ({{ call $.T "default" }})</option>
|
||
<option value="1" {{ if eq .Status 1 }}selected{{end}}>{{ call $.T "trusted_member"}}</option>
|
||
{{ if eq .Status 2 }} <!-- just so that it shows correctly -->
|
||
<option value="2" selected>{{ call $.T "moderator"}}</option>
|
||
{{end}}
|
||
</select>
|
||
</div>
|
||
{{ range (index $.FormErrors "status")}}
|
||
<p class="text-error">{{ . }}</p>
|
||
{{end}}
|
||
</div>
|
||
</div>
|
||
{{end}}
|
||
<div class="form-group">
|
||
<label class="col-md-3 control-label"></label>
|
||
<div class="col-md-8">
|
||
<input type="submit" class="btn btn-primary" name="save" value="{{ call $.T "save_changes"}}">
|
||
<span></span>
|
||
<input type="reset" class="btn btn-default" value="{{ call $.T "cancel"}}">
|
||
</div>
|
||
</div>
|
||
</form>
|
||
{{ if CurrentOrAdmin $.User .ID }}
|
||
<hr>
|
||
<a href="{{ genRoute "user_profile" }}?delete" onclick="if (!confirm('{{ call $.T "delete_account_confirm" }}')) return false;" class="btn btn-danger btn-lg"><i class="glyphicon glyphicon-trash"></i> {{ call $.T "delete_account"}}</a>
|
||
{{end}}
|
||
{{end}}
|
||
{{end}}
|