Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Added Theme field in user settings

Cette révision appartient à :
akuma06 2017-05-29 15:15:04 +02:00
Parent a7d621f048
révision c570557477
3 fichiers modifiés avec 15 ajouts et 4 suppressions

Voir le fichier

@ -67,6 +67,7 @@ type UserForm struct {
Password string `form:"password" len_min:"6" len_max:"72" equalInput:"ConfirmPassword"`
ConfirmPassword string `form:"password_confirmation" omit:"true"`
Status int `form:"status" default:"0"`
Theme string `form:"theme"`
}
// UserSettingsForm is used when updating a user.

Voir le fichier

@ -45,6 +45,16 @@
<p class="text-error">{{ . }}</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="text-error">{{ . }}</p>
{{end}}
{{ with .Settings }}
{{ if DefaultUserSettings "new_torrent"}}
<label class="input-label">{{ call $.T "new_torrent_settings" }}:</label> <br>

Voir le fichier

@ -13,10 +13,10 @@
</select>
<h3>{{call $.T "theme"}}</h3>
<select id="theme-selector" name="theme" class="form-input" onchange="switchThemes()">
<option value="{{$.Theme}}" selected>{{call $.T "theme_select"}}</option>
<option value="g">/g/</option>
<option value="tomorrow">Tomorrow</option>
<option value="">{{call $.T "theme_none"}}</option>
<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>
</br>