Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/templates/site/user/edit.jet.html
akuma06 e54a2e59e2 Fixed alphabetical order for languages and categories
Also improved the name of exported functions for categories
2017-07-06 21:53:13 +02:00

154 lignes
9,1 Kio
HTML
Brut Annotations Historique

Ce fichier contient des caractères Unicode invisibles.

Ce fichier contient des caractères Unicode invisibles à l'œil nu, mais peuvent être traités différemment par un ordinateur. Si vous pensez que c'est intentionnel, vous pouvez ignorer cet avertissement. Utilisez le bouton Échappe pour les dévoiler.

{{ 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 _, language := Languages }}
<option value="{{ language.Code }}" {{ if userLanguage == language.Code || ((userLanguage == "") && (language.Code == getDefaultLanguage())) }}selected{{end}}>{{ language.Name }} {{if language.Code == getDefaultLanguage()}}({{ T("default") }}){{end}}</option>
{{ end }}
</select> <br>
{{ yield errors(name="language")}}
{{ if !User.HasAdmin()}}
<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}}
{{ if User.HasAdmin()}}
<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>
{{ if User.CurrentOrAdmin(UserProfile.ID) }}
<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}}