192 lignes
11 Kio
HTML
192 lignes
11 Kio
HTML
{{define "profile_edit_content"}}
|
|
{{with .UserProfile}}
|
|
{{ range (index $.FormInfos "infos")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{ range (index $.FormErrors "errors")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
<h3>{{ call $.T "personal_info"}}</h3>
|
|
<div class="user-edit">
|
|
<form role="form" method="POST">
|
|
{{ block "csrf_field" $ }}{{end}}
|
|
<label class="input-label">{{call $.T "api_token" }}:</label>
|
|
<p style="font-family: monospace;">{{.APIToken}}</p>
|
|
<a class="form-input up-input" href="{{ genRoute "user_profile_apireset" "id" (print .ID) "username" .Username }}">Reset Api key</a> <br> <br>
|
|
<label class="input-label">{{ call $.T "email_address" }}:</label> <br>
|
|
<input class="form-input up-input" type="text" name="email" id="email" value="{{.Email}}"> <br>
|
|
{{ range (index $.FormErrors "email")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
<label class="input-label">{{ call $.T "language"}}:</label> <br>
|
|
<select id="language" name="language" class="form-input up-input">
|
|
{{ $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> <br>
|
|
{{ range (index $.FormErrors "language")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{ if not (HasAdmin $.User)}}
|
|
<label class="input-label">{{ call $.T "current_password"}}:</label> <br>
|
|
<input class="form-input up-input up-input" name="current_password" id="current_password" type="password"> <br>
|
|
{{ range (index $.FormErrors "current_password")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{end}}
|
|
<label class="input-label">{{ call $.T "password"}}:</label> <br>
|
|
<input class="form-input up-input up-input" name="password" id="password" type="password"> <br>
|
|
{{ range (index $.FormErrors "password")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
<label class="input-label">{{ call $.T "confirm_password"}}:</label> <br>
|
|
<input class="form-input up-input up-input" name="password_confirmation" id="password_confirmation" type="password"> <br>
|
|
{{ range (index $.FormErrors "password_confirmation")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
<h3>{{ call $.T "preferences"}}</h3>
|
|
<label class="input-label" for="theme">{{call $.T "theme"}}</label> <br>
|
|
<select id="theme-selector" name="theme" class="form-input up-input" onchange="switchThemes()">
|
|
<option value="">{{call $.T "theme_select"}}</option>
|
|
<option value="g"{{ if eq $.Theme "g" }} selected{{end}}>/g/</option>
|
|
<option value="tomorrow"{{ if eq $.Theme "tomorrow" }} selected{{end}}>Tomorrow</option>
|
|
<option value=""{{ if eq $.Theme "" }} selected{{end}}>{{call $.T "theme_none"}}</option>
|
|
</select><br>
|
|
{{ range (index $.FormErrors "theme")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{ with .Settings }}
|
|
{{ if DefaultUserSettings "new_torrent"}}
|
|
<label class="input-label">{{ call $.T "new_torrent_settings" }}:</label> <br>
|
|
<select id="new_torrent" name="new_torrent" class="form-input up-input">
|
|
<option value="0" {{ if not (.Get "new_torrent") }}selected{{end}}>{{ call $.T "no"}}</option>
|
|
<option value="1" {{ if .Get "new_torrent" }}selected{{end}}>{{ call $.T "yes"}}</option>
|
|
</select> <br>
|
|
{{ range (index $.FormErrors "new_torrent")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{end}}
|
|
{{ if DefaultUserSettings "new_torrent_email"}}
|
|
<label class="input-label">{{ call $.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 not (.Get "new_torrent_email") }}selected{{end}}>{{ call $.T "no"}}</option>
|
|
<option value="1" {{ if .Get "new_torrent_email"}}selected{{end}}>{{ call $.T "yes"}}</option>
|
|
</select> <br>
|
|
{{ range (index $.FormErrors "new_torrent_email")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{end}}
|
|
{{ if DefaultUserSettings "new_comment"}}
|
|
<label class="input-label">{{ call $.T "new_comment_settings" }}:</label> <br>
|
|
<select id="new_comment" name="new_comment" class="form-input up-input">
|
|
<option value="0" {{ if not (.Get "new_comment") }}selected{{end}}>{{ call $.T "no"}}</option>
|
|
<option value="1" {{ if .Get "new_comment" }}selected{{end}}>{{ call $.T "yes"}}</option>
|
|
</select> <br>
|
|
{{ range (index $.FormErrors "new_comment")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{end}}
|
|
{{ if DefaultUserSettings "new_comment_email"}}
|
|
<label class="input-label">{{ call $.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 not (.Get "new_comment_email") }}selected{{end}}>{{ call $.T "no"}}</option>
|
|
<option value="1" {{ if .Get "new_comment_email" }}selected{{end}}>{{ call $.T "yes"}}</option>
|
|
</select> <br>
|
|
{{ range (index $.FormErrors "new_comment_email")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{end}}
|
|
{{ if DefaultUserSettings "new_responses"}}
|
|
<label class="input-label">{{ call $.T "new_responses_settings" }}:</label> <br>
|
|
<select id="new_responses" name="new_responses" class="form-input up-input">
|
|
<option value="0" {{ if not (.Get "new_responses") }}selected{{end}}>{{ call $.T "no"}}</option>
|
|
<option value="1" {{ if .Get "new_responses" }}selected{{end}}>{{ call $.T "yes"}}</option>
|
|
</select> <br>
|
|
{{ range (index $.FormErrors "new_responses")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{end}}
|
|
{{ if DefaultUserSettings "new_responses_email"}}
|
|
<label class="input-label">{{ call $.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 not (.Get "new_responses_email") }}selected{{end}}>{{ call $.T "no"}}</option>
|
|
<option value="1" {{ if .Get "new_responses_email" }}selected{{end}}>{{ call $.T "yes"}}</option>
|
|
</select> <br>
|
|
{{ range (index $.FormErrors "new_responses_email")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{end}}
|
|
{{ if DefaultUserSettings "new_follower"}}
|
|
<label class="input-label">{{ call $.T "new_follower_settings" }}:</label> <br>
|
|
<select id="new_follower" name="new_follower" class="form-input up-input">
|
|
<option value="0" {{ if not (.Get "new_follower") }}selected{{end}}>{{ call $.T "no"}}</option>
|
|
<option value="1" {{ if .Get "new_follower" }}selected{{end}}>{{ call $.T "yes"}}</option>
|
|
</select> <br>
|
|
{{ range (index $.FormErrors "new_follower")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{end}}
|
|
{{ if DefaultUserSettings "new_follower_email"}}
|
|
<label class="input-label">{{ call $.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 not (.Get "new_follower_email") }}selected{{end}}>{{ call $.T "no"}}</option>
|
|
<option value="1" {{ if .Get "new_follower_email"}}selected{{end}}>{{ call $.T "yes"}}</option>
|
|
</select> <br>
|
|
{{ range (index $.FormErrors "new_follower_email")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{end}}
|
|
{{ if DefaultUserSettings "followed"}}
|
|
<label class="input-label">{{ call $.T "followed_settings" }}:</label> <br>
|
|
<select id="followed" name="followed" class="form-input up-input">
|
|
<option value="0" {{ if not (.Get "followed") }}selected{{end}}>{{ call $.T "no"}}</option>
|
|
<option value="1" {{ if .Get "followed" }}selected{{end}}>{{ call $.T "yes"}}</option>
|
|
</select><br>
|
|
{{ range (index $.FormErrors "followed")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{end}}
|
|
{{ if DefaultUserSettings "followed_email"}}
|
|
<label class="input-label">{{ call $.T "followed_email_settings" }}:</label> <br>
|
|
<select id="followed_email" name="followed_email" class="form-input up-input">
|
|
<option value="0" {{ if not (.Get "followed_email") }}selected{{end}}>{{ call $.T "no"}}</option>
|
|
<option value="1" {{ if .Get "followed_email" }}selected{{end}}>{{ call $.T "yes"}}</option>
|
|
</select> <br>
|
|
{{ range (index $.FormErrors "followed_email")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{end}}
|
|
{{end}}
|
|
{{ if HasAdmin $.User}}
|
|
<h3>{{ call $.T "moderation"}}</h3>
|
|
<label class="input-label">{{ call $.T "username"}}:</label> <br>
|
|
<input class="form-input up-input" name="username" id="username" type="text" value="{{.Username}}">
|
|
{{ range (index $.FormErrors "username")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
<label class="input-label">{{ call $.T "role" }}:</label>
|
|
<select id="status" name="status" class="form-input up-input">
|
|
<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>
|
|
{{ range (index $.FormErrors "status")}}
|
|
<p class="error-text">{{ . }}</p>
|
|
{{end}}
|
|
{{end}}
|
|
<label class="input-label"></label>
|
|
<input type="submit" class="form-input" name="save" value="{{ call $.T "save_changes"}}">
|
|
<span></span>
|
|
<input type="reset" class="form-input" value="{{ call $.T "cancel"}}">
|
|
</form>
|
|
</div>
|
|
{{ 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}}
|