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()}}
2017-09-30 15:10:47 +02:00
< h2 style = "margin-top: 4px;" > {{ T("personal_info")}}< / h2 >
< form role = "form" method = "POST" >
{{ yield csrf_field()}}
< table class = "user-edit-table" >
< tbody >
< tr >
< td > {{ T("api_token") }}:< / td >
2017-10-10 02:33:38 +02:00
< td > < span style = "font-family: monospace;" > {{if UserProfile.APIToken == ""}}{{T("no_api_token")}}{{else}}{{UserProfile.APIToken}}{{end}}< / span > < / td >
2017-09-30 15:10:47 +02:00
< / tr >
< tr >
< td > < / td >
< td style = "padding-bottom: 6px;" > < a href = "/apidoc" > {{ T("api_documentation")}}< / a > / < a class = "form-input up-input" href = "/user/{{ UserProfile.ID}}/{{UserProfile.Username }}/apireset" > Reset API key< / a > < / td >
< / tr >
< tr >
< td > < label for = "email" > {{ T("email_address") }}< / label > < / td >
< td > < input class = "form-input up-input" placeholder = "{{ T(" email_placeholder " ) } } " type = "text" name = "email" id = "email" value = "{{UserProfile.Email}}" / > < / td >
< / tr >
< tr >
< td > < label for = "language" > {{ T("language")}}< / label > < / td >
< td >
< select id = "language" name = "language" class = "form-input up-input" >
{{ userLanguage := UserProfile.Language }}
{{ range _, language := Languages }}
< option value = "{{ language.Tag }}" { { if userLanguage = = language . Tag | | userLanguage = = language . Code | | ( ( userLanguage = = " " ) & & ( language . Tag = = getDefaultLanguage ( ) ) ) } } selected { { end } } > {{ language.Name }} {{if language.Tag == getDefaultLanguage()}}({{ T("default") }}){{end}}< / option >
{{ end }}
< / select >
< / td >
< / tr >
{{ if !User.HasAdmin()}}
< tr >
< td > < label for = "current_password" > {{ T("current_password") }}< / label > < / td >
< td > < input class = "form-input up-input up-input" name = "current_password" id = "current_password" type = "password" / > < / td >
< / tr >
{{end}}
< tr >
< td > < label for = "password" > {{ T("password") }}< / label > < / td >
< td > < input class = "form-input up-input up-input" name = "password" id = "password" type = "password" / > < / td >
< / tr >
< tr >
< td > < label for = "password_confirmation" > {{ T("confirm_password") }}< / label > < / td >
< td > < input class = "form-input up-input up-input" name = "password_confirmation" id = "password" type = "password" / > < / td >
< / tr >
< / tbody >
< / table >
2017-07-24 07:03:43 +02:00
{{ yield errors(name="Email")}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="Language")}}
2017-07-24 07:03:43 +02:00
{{ if !User.HasAdmin()}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="CurrentPassword")}}
2017-07-24 07:03:43 +02:00
{{end}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="Password")}}
2017-07-24 07:03:43 +02:00
{{ yield errors(name="ConfirmPassword")}}
2017-06-28 13:42:38 +02:00
2017-09-30 15:10:47 +02:00
< h2 > {{ T("preferences")}}< / h2 >
< table class = "user-edit-table" >
< tbody >
< tr >
< td > < label for = "theme" > {{ T("theme") }}:< / label > < / td >
< td >
< select id = "theme-selector" name = "theme" class = "form-input up-input" onchange = "switchThemes()" >
< option value = "" > {{ T("theme_select")}}< / option >
2017-10-07 01:39:38 +02:00
{{ range theme := getThemeList()}}
2017-10-10 02:33:38 +02:00
< option value = "{{theme}}" { { if Theme = = theme } } selected { { end } } > {{formatThemeName(theme, T)}}< / option >
2017-10-07 01:39:38 +02:00
{{end}}
2017-09-30 15:10:47 +02:00
< option value = "" { { if Theme = = " " } } selected { { end } } > {{ T("theme_none")}}< / option >
< / select >
< / td >
< / tr >
2017-09-30 16:05:09 +02:00
< tr class = "hidden" >
< td > < label for = "anidex_api" > Anidex API Token:< / label > < / td >
< td > < input disabled class = "form-input up-input" placeholder = "Coming soon..." type = "text" name = "anidex_api" id = "anidex_api" value = "{{UserProfile.AnidexAPIToken}}" / > < / td >
< / tr >
< tr class = "hidden" >
< td > < label for = "nyaasi_api" > Nyaa.si API Token:< / label > < / td >
< td > < input disabled class = "form-input up-input" placeholder = "Coming soon..." type = "text" name = "nyaasi_api" id = "nyaasi_api" value = "{{UserProfile.NyaasiAPIToken}}" / > < / td >
< / tr >
< tr class = "hidden" >
< td > < label for = "tokyot_api" > TokyoTosho API Token:< / label > < / td >
< td > < input disabled class = "form-input up-input" placeholder = "Coming soon..." type = "text" name = "tokyot_api" id = "tokyot_api" value = "{{UserProfile.TokyoTAPIToken }}" / > < / td >
< / tr >
2017-09-30 15:10:47 +02:00
{{ if DefaultUserSettings("new_torrent")}}
< tr > < td colspan = "2" style = "padding:0" > < label for = "new_torrent" > {{ T("new_torrent_settings") }}< / label > < / td > < / tr >
< tr >
< td colspan = "2" >
< 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 >
< / td >
< / tr >
{{end}}
{{ if DefaultUserSettings("new_torrent_email")}}
< tr > < td colspan = "2" style = "padding:0" > < label for = "new_torrent_email" > {{ T("new_torrent_email_settings") }}< / label > < / td > < / tr >
< tr >
< td colspan = "2" >
< 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 >
< / td >
< / tr >
{{end}}
{{ if DefaultUserSettings("new_comment")}}
< tr > < td colspan = "2" style = "padding:0" > < label for = "new_comment" > {{ T("new_comment_settings") }}< / label > < / td > < / tr >
< tr >
< td colspan = "2" >
< 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 >
< / td >
< / tr >
{{end}}
{{ if DefaultUserSettings("new_comment_email")}}
< tr > < td colspan = "2" style = "padding:0" > < label for = "new_comment_email" > {{ T("new_comment_email_settings") }}< / label > < / td > < / tr >
< tr >
< td colspan = "2" >
< 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 >
< / td >
< / tr >
{{end}}
{{ if DefaultUserSettings("new_responses")}}
< tr > < td colspan = "2" style = "padding:0" > < label for = "new_responses" > {{ T("new_responses_settings") }}< / label > < / td > < / tr >
< tr >
< td colspan = "2" >
< 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 >
< / td >
< / tr >
{{end}}
{{ if DefaultUserSettings("new_responses_email")}}
< tr > < td colspan = "2" style = "padding:0" > < label for = "new_responses_email" > {{ T("new_responses_email_settings") }}< / label > < / td > < / tr >
< tr >
< td colspan = "2" >
< 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 >
< / td >
< / tr >
{{end}}
{{ if DefaultUserSettings("new_follower")}}
< tr > < td colspan = "2" style = "padding:0" > < label for = "new_follower" > {{ T("new_follower_settings") }}< / label > < / td > < / tr >
< tr >
< td colspan = "2" >
< 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 >
< / td >
< / tr >
{{end}}
{{ if DefaultUserSettings("new_follower_email")}}
< tr > < td colspan = "2" style = "padding:0" > < label for = "new_follower_email" > {{ T("new_follower_email_settings") }}< / label > < / td > < / tr >
< tr >
< td colspan = "2" >
< 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 >
< / td >
< / tr >
{{end}}
{{ if DefaultUserSettings("followed")}}
< tr > < td colspan = "2" style = "padding:0" > < label for = "followed" > {{ T("followed_settings") }}< / label > < / td > < / tr >
< tr >
< td colspan = "2" >
< 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 >
< / td >
< / tr >
{{end}}
{{ if DefaultUserSettings("followed_email")}}
< tr > < td colspan = "2" style = "padding:0" > < label for = "followed_email" > {{ T("followed_email_settings") }}< / label > < / td > < / tr >
< tr >
< td colspan = "2" >
< 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 >
< / td >
< / tr >
{{end}}
< / tbody >
< / table >
2017-07-24 07:03:43 +02:00
{{ if DefaultUserSettings("new_torrent")}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="NewTorrent")}}
2017-07-24 07:03:43 +02:00
{{end}}
{{ if DefaultUserSettings("new_torrent_email")}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="NewTorrentEmail")}}
2017-07-24 07:03:43 +02:00
{{end}}
{{ if DefaultUserSettings("new_comment")}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="NewComment")}}
2017-07-24 07:03:43 +02:00
{{end}}
{{ if DefaultUserSettings("new_comment_email")}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="NewCommentEmail")}}
2017-07-24 07:03:43 +02:00
{{end}}
{{ if DefaultUserSettings("new_responses")}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="NewResponses")}}
2017-07-24 07:03:43 +02:00
{{end}}
{{ if DefaultUserSettings("new_responses_email")}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="NewResponsesEmail")}}
2017-07-24 07:03:43 +02:00
{{end}}
{{ if DefaultUserSettings("new_follower")}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="NewFollower")}}
2017-07-24 07:03:43 +02:00
{{end}}
{{ if DefaultUserSettings("new_follower_email")}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="NewFollowerEmail")}}
2017-07-24 07:03:43 +02:00
{{end}}
{{ if DefaultUserSettings("followed")}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="Followed")}}
2017-07-24 07:03:43 +02:00
{{end}}
{{ if DefaultUserSettings("followed_email")}}
2017-09-30 15:10:47 +02:00
{{ yield errors(name="FollowedEmail")}}
2017-07-24 07:03:43 +02:00
{{end}}
2017-06-28 13:42:38 +02:00
2017-09-30 15:10:47 +02:00
{{ if User.HasAdmin()}}
< h2 > {{ T("moderation")}}< / h2 >
< table class = "user-edit-table" >
< tbody >
< tr >
2017-10-15 13:18:57 +02:00
< td > < label for = "username" > {{ T("username") }}:< / label > < / td >
2017-09-30 15:10:47 +02:00
< td > < input class = "form-input up-input" name = "username" id = "username" type = "text" value = "{{UserProfile.Username}}" > < / td >
< / tr >
< tr >
< td > < label for = "status" > {{ T("role") }}:< / label > < / td >
< td >
< select id = "status" name = "status" class = "form-input up-input" >
2017-10-28 18:28:59 +02:00
< option value = "-1" { { if UserProfile . Status = = -1 } } selected { { end } } > {{ T("userstatus_banned")}}< / option >
< option value = "0" { { if UserProfile . Status = = 0 } } selected { { end } } > {{ T("userstatus_member")}} ({{ T("default") }})< / option >
< option value = "1" { { if UserProfile . Status = = 1 } } selected { { end } } > {{ T("userstatus_trusted")}}< / option >
2017-10-04 15:46:06 +02:00
{{ if UserProfile.Status == 2}}
2017-10-28 18:28:59 +02:00
< option value = "2" selected > {{ T("userstatus_moderator")}}< / option >
2017-09-30 15:10:47 +02:00
{{end}}
2017-10-28 18:28:59 +02:00
< option value = "3" { { if UserProfile . Status = = 3 } } selected { { end } } > {{ T("userstatus_scraped")}}< / option >
2017-09-30 15:10:47 +02:00
< / select >
< / td >
< / tr >
< / tbody >
< / table >
{{ yield errors(name="Username")}}
{{ yield errors(name="Status")}}
{{end}}
2017-07-24 07:03:43 +02:00
< input type = "submit" class = "form-input btn-green" name = "save" value = "{{ T(" save_changes " ) } } " >
< input type = "reset" class = "form-input" value = "{{ T(" cancel " ) } } " >
< / form >
{{ if User.CurrentOrAdmin(UserProfile.ID) }}
< hr / >
2017-10-12 02:54:01 +02:00
< form method = "POST" action = "/user/{{UserProfile.ID}}/{{UserProfile.Username}}/delete" >
2017-10-15 01:34:45 +02:00
{{ yield csrf_field()}}
2017-10-12 17:53:04 +02:00
< button type = "submit" class = "form-input btn-red" onclick = "if (!confirm('{{ T(" delete_account_confirm " ) } } ' ) ) return false ; " style = "float:right" > {{ T("delete_account") }}< / button >
2017-10-12 02:54:01 +02:00
< / form >
2017-07-24 07:03:43 +02:00
{{end}}
2017-06-28 13:42:38 +02:00
{{end}}