2017-05-09 17:47:06 +02:00
{{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 > {{ T "personal_info"}}< / h3 >
< form class = "form-horizontal" role = "form" method = "POST" >
2017-05-14 06:15:58 +02:00
< div class = "form-group" >
< label class = "col-lg-3 control-label" > {{T "api_token" }}:< / label >
< div class = "col-lg-8" > {{.ApiToken}}< / div >
< / div >
2017-05-09 17:47:06 +02:00
< div class = "form-group" >
2017-05-10 15:49:46 +02:00
< label class = "col-lg-3 control-label" > {{ T "email_address" }}:< / label >
2017-05-09 17:47:06 +02:00
< div class = "col-lg-8" >
< input class = "form-control" type = "text" name = "email" id = "email" value = "{{.Email}}" >
{{ range (index $.FormErrors "email")}}
2017-05-11 23:54:53 +02:00
< p class = "text-error" > {{ . }}< / p >
2017-05-09 17:47:06 +02:00
{{end}}
< / div >
< / div >
< div class = "form-group" >
< label class = "col-lg-3 control-label" > {{ T "language"}}:< / label >
< div class = "col-lg-8" >
< div class = "ui-select" >
< select id = "language" name = "language" class = "form-control" >
2017-05-10 21:45:39 +02:00
{{ $userLanguage := .Language }}
{{ range $tag, $translatedName := $.Languages }}
2017-05-14 21:45:50 +02:00
< option value = "{{ $tag }}" { { if or ( eq $ userLanguage $ tag ) ( and ( eq $ userLanguage " " ) ( eq $ tag getDefaultLanguage ) ) } } selected { { end } } > {{ $translatedName }} {{if eq $tag getDefaultLanguage}}({{ T "default" }}){{end}}< / option >
2017-05-10 21:45:39 +02:00
{{ end }}
2017-05-09 17:47:06 +02:00
< / select >
< / div >
{{ range (index $.FormErrors "language")}}
2017-05-11 23:54:53 +02:00
< p class = "text-error" > {{ . }}< / p >
2017-05-09 17:47:06 +02:00
{{end}}
< / div >
< / div >
2017-05-11 11:58:44 +02:00
{{ if not (HasAdmin $.User)}}
2017-05-09 17:47:06 +02:00
< div class = "form-group" >
< label class = "col-md-3 control-label" > {{ 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")}}
2017-05-11 23:54:53 +02:00
< p class = "text-error" > {{ . }}< / p >
2017-05-09 17:47:06 +02:00
{{end}}
< / div >
< / div >
{{end}}
< div class = "form-group" >
< label class = "col-md-3 control-label" > {{ T "password"}}:< / label >
< div class = "col-md-8" >
< input class = "form-control" name = "password" id = "password" type = "password" >
{{ range (index $.FormErrors "password")}}
2017-05-11 23:54:53 +02:00
< p class = "text-error" > {{ . }}< / p >
2017-05-09 17:47:06 +02:00
{{end}}
< / div >
< / div >
< div class = "form-group" >
< label class = "col-md-3 control-label" > {{ 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")}}
2017-05-11 23:54:53 +02:00
< p class = "text-error" > {{ . }}< / p >
2017-05-09 17:47:06 +02:00
{{end}}
< / div >
< / div >
2017-05-11 11:58:44 +02:00
{{ if HasAdmin $.User}}
2017-05-09 17:47:06 +02:00
< h3 > {{ T "moderation"}}< / h3 >
< div class = "form-group" >
< label class = "col-md-3 control-label" > {{ T "username"}}:< / label >
< div class = "col-md-8" >
< input class = "form-control" name = "username" id = "username" type = "text" value = "{{.Username}}" >
{{ range (index $.FormErrors "username")}}
2017-05-11 23:54:53 +02:00
< p class = "text-error" > {{ . }}< / p >
2017-05-09 17:47:06 +02:00
{{end}}
< / div >
< / div >
< div class = "form-group" >
< label class = "col-lg-3 control-label" > {{ 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 } } > {{ T "banned"}}< / option >
< option value = "0" { { if eq . Status 0 } } selected { { end } } > {{ T "member"}} ({{ T "default" }})< / option >
2017-05-11 23:31:34 +02:00
< option value = "1" { { if eq . Status 1 } } selected { { end } } > {{ T "trusted_member"}}< / option >
{{ if eq .Status 2 }} <!-- just so that it shows correctly -->
< option value = "2" selected > {{ T "moderator"}}< / option >
{{end}}
2017-05-09 17:47:06 +02:00
< / select >
< / div >
{{ range (index $.FormErrors "status")}}
2017-05-11 23:54:53 +02:00
< p class = "text-error" > {{ . }}< / p >
2017-05-09 17:47:06 +02:00
{{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 = "{{ T " save_changes " } } " >
< span > < / span >
2017-05-14 19:32:25 +02:00
< input type = "reset" class = "btn btn-default" value = "{{ T " cancel " } } " >
2017-05-09 17:47:06 +02:00
< / div >
< / div >
< / form >
Consistency, formatting, error checking, cleanup, and a couple bug fixes (#245)
* Checkpoint: it builds
The config, db, model, network, os, and public packages have had some
fixes to glaringly obvious flaws, dead code removed, and stylistic
changes.
* Style changes and old code removal in router
Router needs a lot of work done to its (lack of) error handling.
* Dead code removal and style changes
Now up to util/email/email.go. After I'm finished with the initial sweep
I'll go back and fix error handling and security issues. Then I'll fix
the broken API. Then I'll go through to add documentation and fix code
visibility.
* Finish dead code removal and style changes
Vendored libraries not touched. Everything still needs security fixes
and documentation. There's also one case of broken functionality.
* Fix accidental find-and-replace
* Style, error checking, saftey, bug fix changes
* Redo error checking erased during merge
* Re-add merge-erased fix. Make Safe safe.
2017-05-10 04:34:40 +02:00
{{ if CurrentOrAdmin $.User .ID }}
2017-05-09 17:47:06 +02:00
< hr >
< a href = "?delete" onclick = "if (!confirm('{{ T " delete_account_confirm " } } ' ) ) return false ; " class = "btn btn-danger btn-lg" > < i class = "glyphicon glyphicon-trash" > < / i > {{ T "delete_account"}}< / a >
{{end}}
{{end}}
Consistency, formatting, error checking, cleanup, and a couple bug fixes (#245)
* Checkpoint: it builds
The config, db, model, network, os, and public packages have had some
fixes to glaringly obvious flaws, dead code removed, and stylistic
changes.
* Style changes and old code removal in router
Router needs a lot of work done to its (lack of) error handling.
* Dead code removal and style changes
Now up to util/email/email.go. After I'm finished with the initial sweep
I'll go back and fix error handling and security issues. Then I'll fix
the broken API. Then I'll go through to add documentation and fix code
visibility.
* Finish dead code removal and style changes
Vendored libraries not touched. Everything still needs security fixes
and documentation. There's also one case of broken functionality.
* Fix accidental find-and-replace
* Style, error checking, saftey, bug fix changes
* Redo error checking erased during merge
* Re-add merge-erased fix. Make Safe safe.
2017-05-10 04:34:40 +02:00
{{end}}