2017-06-28 13:42:38 +02:00
{{ extends "layouts/profile" }}
{{ import "layouts/partials/menu/profile" }}
{{ import "layouts/partials/helpers/csrf" }}
{{block title()}} {{ T("profile_edit_page", UserProfile.Username) }}{{end}}
{{ block profile_navigation()}}{{ yield profile_menu(route="profile_edit") }}{{end}}
{{block profile_content()}}
< h3 > {{ T("personal_info")}}< / h3 >
< div class = "user-edit" >
< form role = "form" method = "POST" >
{{ yield csrf_field()}}
< label class = "input-label" > {{ T("api_token") }}:< / label >
< p style = "font-family: monospace;" > {{UserProfile.APIToken}}< / p >
< a class = "form-input up-input" href = "/user/{{ UserProfile.ID}}/{{UserProfile.Username }}/apireset" > Reset API key< / a > < br > < br >
< label class = "input-label" > {{ T("email_address") }}:< / label > < br >
< input class = "form-input up-input" placeholder = "{{ T(" email_placeholder " ) } } " type = "text" name = "email" id = "email" value = "{{UserProfile.Email}}" > < br >
{{ yield errors(name="email")}}
< label class = "input-label" > {{ T("language")}}:< / label > < br >
< select id = "language" name = "language" class = "form-input up-input" >
{{ userLanguage := UserProfile.Language }}
{{ range tag, translatedName := Languages }}
< option value = "{{ tag }}" { { if userLanguage = = tag | | ( ( userLanguage = = " " ) & & ( tag = = getDefaultLanguage ( ) ) ) } } selected { { end } } > {{ translatedName }} {{if tag == getDefaultLanguage()}}({{ T("default") }}){{end}}< / option >
{{ end }}
< / select > < br >
{{ yield errors(name="language")}}
2017-07-03 00:34:18 +02:00
{{ if !User.HasAdmin()}}
2017-06-28 13:42:38 +02:00
< label class = "input-label" > {{ T("current_password")}}:< / label > < br >
< input class = "form-input up-input up-input" name = "current_password" id = "current_password" type = "password" > < br >
{{ yield errors(name="current_password")}}
{{end}}
< label class = "input-label" > {{ T("password")}}:< / label > < br >
< input class = "form-input up-input up-input" name = "password" id = "password" type = "password" > < br >
{{ yield errors(name="password")}}
< label class = "input-label" > {{ T("confirm_password")}}:< / label > < br >
< input class = "form-input up-input up-input" name = "password_confirmation" id = "password_confirmation" type = "password" > < br >
{{ yield errors(name="password_confirmation")}}
< h3 > {{ T("preferences")}}< / h3 >
< label class = "input-label" for = "theme" > {{ T("theme")}}< / label > < br >
< select id = "theme-selector" name = "theme" class = "form-input up-input" onchange = "switchThemes()" >
< option value = "" > {{ T("theme_select")}}< / option >
< option value = "g" { { if Theme = = " g " } } selected { { end } } > /g/< / option >
< option value = "tomorrow" { { if Theme = = " tomorrow " } } selected { { end } } > Tomorrow< / option >
< option value = "" { { if Theme = = " " } } selected { { end } } > {{ T("theme_none")}}< / option >
< / select > < br >
{{ yield errors(name="theme")}}
{{ if DefaultUserSettings("new_torrent")}}
< label class = "input-label" > {{ T("new_torrent_settings") }}:< / label > < br >
< select id = "new_torrent" name = "new_torrent" class = "form-input up-input" >
< option value = "0" { { if ! UserProfile . Settings . Get ( " new_torrent " ) } } selected { { end } } > {{ T("no")}}< / option >
< option value = "1" { { if UserProfile . Settings . Get ( " new_torrent " ) } } selected { { end } } > {{ T("yes")}}< / option >
< / select > < br >
{{ yield errors(name="new_torrent")}}
{{end}}
{{ if DefaultUserSettings("new_torrent_email")}}
< label class = "input-label" > {{ T("new_torrent_email_settings") }}:< / label > < br >
< select id = "new_torrent_email" name = "new_torrent_email" class = "form-input up-input" >
< option value = "0" { { if ! UserProfile . Settings . Get ( " new_torrent_email " ) } } selected { { end } } > {{ T("no")}}< / option >
< option value = "1" { { if UserProfile . Settings . Get ( " new_torrent_email " ) } } selected { { end } } > {{ T("yes")}}< / option >
< / select > < br >
{{ yield errors(name="new_torrent_email")}}
{{end}}
{{ if DefaultUserSettings("new_comment")}}
< label class = "input-label" > {{ T("new_comment_settings") }}:< / label > < br >
< select id = "new_comment" name = "new_comment" class = "form-input up-input" >
< option value = "0" { { if ! UserProfile . Settings . Get ( " new_comment " ) } } selected { { end } } > {{ T("no")}}< / option >
< option value = "1" { { if UserProfile . Settings . Get ( " new_comment " ) } } selected { { end } } > {{ T("yes")}}< / option >
< / select > < br >
{{ yield errors(name="new_comment")}}
{{end}}
{{ if DefaultUserSettings("new_comment_email")}}
< label class = "input-label" > {{ T("new_comment_email_settings") }}:< / label > < br >
< select id = "new_comment_email" name = "new_comment_email" class = "form-input up-input" >
< option value = "0" { { if ! UserProfile . Settings . Get ( " new_comment_email " ) } } selected { { end } } > {{ T("no")}}< / option >
< option value = "1" { { if UserProfile . Settings . Get ( " new_comment_email " ) } } selected { { end } } > {{ T("yes")}}< / option >
< / select > < br >
{{ yield errors(name="new_comment_email")}}
{{end}}
{{ if DefaultUserSettings("new_responses")}}
< label class = "input-label" > {{ T("new_responses_settings") }}:< / label > < br >
< select id = "new_responses" name = "new_responses" class = "form-input up-input" >
< option value = "0" { { if ! UserProfile . Settings . Get ( " new_responses " ) } } selected { { end } } > {{ T("no")}}< / option >
< option value = "1" { { if UserProfile . Settings . Get ( " new_responses " ) } } selected { { end } } > {{ T("yes")}}< / option >
< / select > < br >
{{ yield errors(name="new_responses")}}
{{end}}
{{ if DefaultUserSettings("new_responses_email")}}
< label class = "input-label" > {{ T("new_responses_email_settings") }}:< / label > < br >
< select id = "new_responses_email" name = "new_responses_email" class = "form-input up-input" >
< option value = "0" { { if UserProfile . Settings . Get ( " new_responses_email " ) } } selected { { end } } > {{ T("no")}}< / option >
< option value = "1" { { if UserProfile . Settings . Get ( " new_responses_email " ) } } selected { { end } } > {{ T("yes")}}< / option >
< / select > < br >
{{ yield errors(name="new_responses_email")}}
{{end}}
{{ if DefaultUserSettings("new_follower")}}
< label class = "input-label" > {{ T("new_follower_settings") }}:< / label > < br >
< select id = "new_follower" name = "new_follower" class = "form-input up-input" >
< option value = "0" { { if UserProfile . Settings . Get ( " new_follower " ) } } selected { { end } } > {{ T("no")}}< / option >
< option value = "1" { { if UserProfile . Settings . Get ( " new_follower " ) } } selected { { end } } > {{ T("yes")}}< / option >
< / select > < br >
{{ yield errors(name="new_follower")}}
{{end}}
{{ if DefaultUserSettings("new_follower_email")}}
< label class = "input-label" > {{ T("new_follower_email_settings") }}:< / label > < br >
< select id = "new_follower_email" name = "new_follower_email" class = "form-input up-input" >
< option value = "0" { { if UserProfile . Settings . Get ( " new_follower_email " ) } } selected { { end } } > {{ T("no")}}< / option >
< option value = "1" { { if UserProfile . Settings . Get ( " new_follower_email " ) } } selected { { end } } > {{ T("yes")}}< / option >
< / select > < br >
{{ yield errors(name="new_follower_email")}}
{{end}}
{{ if DefaultUserSettings("followed")}}
< label class = "input-label" > {{ T("followed_settings") }}:< / label > < br >
< select id = "followed" name = "followed" class = "form-input up-input" >
< option value = "0" { { if UserProfile . Settings . Get ( " followed " ) } } selected { { end } } > {{ T("no")}}< / option >
< option value = "1" { { if UserProfile . Settings . Get ( " followed " ) } } selected { { end } } > {{ T("yes")}}< / option >
< / select > < br >
{{ yield errors(name="followed")}}
{{end}}
{{ if DefaultUserSettings("followed_email")}}
< label class = "input-label" > {{ T("followed_email_settings") }}:< / label > < br >
< select id = "followed_email" name = "followed_email" class = "form-input up-input" >
< option value = "0" { { if UserProfile . Settings . Get ( " followed_email " ) } } selected { { end } } > {{ T("no")}}< / option >
< option value = "1" { { if UserProfile . Settings . Get ( " followed_email " ) } } selected { { end } } > {{ T("yes")}}< / option >
< / select > < br >
{{ yield errors(name="followed_email")}}
{{end}}
2017-07-03 02:16:39 +02:00
{{ if User.HasAdmin()}}
2017-06-28 13:42:38 +02:00
< h3 > {{ T("moderation")}}< / h3 >
< label class = "input-label" > {{ T("username")}}:< / label > < br >
< input class = "form-input up-input" name = "username" id = "username" type = "text" value = "{{UserProfile.Username}}" >
{{ yield errors(name="username")}}
< label class = "input-label" > {{ T("role") }}:< / label >
< select id = "status" name = "status" class = "form-input up-input" >
< option value = "-1" { { if UserProfile . Status = = -1 } } selected { { end } } > {{ T("banned")}}< / option >
< option value = "0" { { if UserProfile . Status = = 0 } } selected { { end } } > {{ T("member")}} ({{ T("default") }})< / option >
< option value = "1" { { if UserProfile . Status = = 1 } } selected { { end } } > {{ T("trusted_member")}}< / option >
{{ if UserProfile.Status == 2 }} <!-- just so that it shows correctly -->
< option value = "2" selected > {{ T("moderator")}}< / option >
{{end}}
< option value = "3" { { if UserProfile . Status = = 3 } } selected { { end } } > {{ T("scraped_user")}}< / option >
< / select >
{{ yield errors(name="status")}}
{{end}}
< label class = "input-label" > < / label >
< input type = "submit" class = "form-input btn-green" name = "save" value = "{{ T(" save_changes " ) } } " >
< span > < / span >
< input type = "reset" class = "form-input" value = "{{ T(" cancel " ) } } " >
< / form >
< / div >
2017-07-03 00:34:18 +02:00
{{ if User.CurrentOrAdmin(UserProfile.ID) }}
2017-06-28 13:42:38 +02:00
< hr >
< a href = "/user/{{UserProfile.ID}}/{{UserProfile.Username}}?delete" onclick = "if (!confirm('{{ T(" delete_account_confirm " ) } } ' ) ) return false ; " class = "form-input btn-red" > {{ T("delete_account")}}< / a >
{{end}}
{{end}}