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

184 lignes
9,6 Kio
HTML
Brut Vue normale Historique

First batch of changes for the refactor (#1078) * First batch of changes for the refactor Added the support of gin in routes and other services/utils Begining implementation of JetHTML * Remove os folder * Move scrapers to own repo * Second batch of changes All .jet.html are the working templates. You can now test this PR, the index Page and upload works. If you want to complete the other html templates, you're welcome * Move captcha to util * Move uploadService to utils * Use govalidator instead of regex * Third batch of changes All the front end should as previously. I also fixed some minor things unrelated to the refactor (mostly style issues on static pages) Now errors can be accessed by importing the "errors" helpers and using the `yield errors(name="xxx")` command in templates. Same for infos. Templates are now more hierarchized with a base template "base.jet.html" which is extended depending on the context in "index_site" or "index_admin" layouts. Those layouts are extended than in every pages. Other helpers are captcha to render a captcha `yield captcha(captchaid="xxx")` And also csrf, with the command `yield csrf_field()` To translate, you don't have anymore to do `call $.T "xxx"`, you just have to do `T("xxx")`. Pages for the website part are in folders in the folder "templates/site". Pages for the admin part are in "templates/admin". Layouts are separated in "templates/layouts". Helpers and menu are in "templates/layouts/helpers" and "templates/layouts/menu". Error pages should be put in "templates/errors" * Added test on templates When adding a new template, you have to tell to template_test.go, the context of the new template (if it doesn't use the common context) * Panel admin works Now the templating part should work. The PR can now be fully tested. I think we should push the templating PR and do the routes/controllers/removal of services in another branch. So we know that this one is functional * Updated dependencies * Fixed test for modelhelper * Fix testing for commentlist * Fix travis :') * Just renamed router and removed network * Applying same SEO fix * Update form_validator.go * Added back regexp package
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-07-24 07:03:43 +02:00
<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/>
<a href="/apidoc">{{ T("api_documentation")}}</a>
<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.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>
<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="CurrentPassword")}}
{{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="ConfirmPassword")}}
First batch of changes for the refactor (#1078) * First batch of changes for the refactor Added the support of gin in routes and other services/utils Begining implementation of JetHTML * Remove os folder * Move scrapers to own repo * Second batch of changes All .jet.html are the working templates. You can now test this PR, the index Page and upload works. If you want to complete the other html templates, you're welcome * Move captcha to util * Move uploadService to utils * Use govalidator instead of regex * Third batch of changes All the front end should as previously. I also fixed some minor things unrelated to the refactor (mostly style issues on static pages) Now errors can be accessed by importing the "errors" helpers and using the `yield errors(name="xxx")` command in templates. Same for infos. Templates are now more hierarchized with a base template "base.jet.html" which is extended depending on the context in "index_site" or "index_admin" layouts. Those layouts are extended than in every pages. Other helpers are captcha to render a captcha `yield captcha(captchaid="xxx")` And also csrf, with the command `yield csrf_field()` To translate, you don't have anymore to do `call $.T "xxx"`, you just have to do `T("xxx")`. Pages for the website part are in folders in the folder "templates/site". Pages for the admin part are in "templates/admin". Layouts are separated in "templates/layouts". Helpers and menu are in "templates/layouts/helpers" and "templates/layouts/menu". Error pages should be put in "templates/errors" * Added test on templates When adding a new template, you have to tell to template_test.go, the context of the new template (if it doesn't use the common context) * Panel admin works Now the templating part should work. The PR can now be fully tested. I think we should push the templating PR and do the routes/controllers/removal of services in another branch. So we know that this one is functional * Updated dependencies * Fixed test for modelhelper * Fix testing for commentlist * Fix travis :') * Just renamed router and removed network * Applying same SEO fix * Update form_validator.go * Added back regexp package
2017-06-28 13:42:38 +02:00
2017-07-24 07:03:43 +02:00
<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="NewTorrent")}}
{{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="NewTorrentEmail")}}
{{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="NewComment")}}
{{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="NewCommentEmail")}}
{{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="NewResponses")}}
{{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="NewResponsesEmail")}}
{{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="NewFollower")}}
{{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="NewFollowerEmail")}}
{{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="FollowedEmail")}}
{{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")}}
First batch of changes for the refactor (#1078) * First batch of changes for the refactor Added the support of gin in routes and other services/utils Begining implementation of JetHTML * Remove os folder * Move scrapers to own repo * Second batch of changes All .jet.html are the working templates. You can now test this PR, the index Page and upload works. If you want to complete the other html templates, you're welcome * Move captcha to util * Move uploadService to utils * Use govalidator instead of regex * Third batch of changes All the front end should as previously. I also fixed some minor things unrelated to the refactor (mostly style issues on static pages) Now errors can be accessed by importing the "errors" helpers and using the `yield errors(name="xxx")` command in templates. Same for infos. Templates are now more hierarchized with a base template "base.jet.html" which is extended depending on the context in "index_site" or "index_admin" layouts. Those layouts are extended than in every pages. Other helpers are captcha to render a captcha `yield captcha(captchaid="xxx")` And also csrf, with the command `yield csrf_field()` To translate, you don't have anymore to do `call $.T "xxx"`, you just have to do `T("xxx")`. Pages for the website part are in folders in the folder "templates/site". Pages for the admin part are in "templates/admin". Layouts are separated in "templates/layouts". Helpers and menu are in "templates/layouts/helpers" and "templates/layouts/menu". Error pages should be put in "templates/errors" * Added test on templates When adding a new template, you have to tell to template_test.go, the context of the new template (if it doesn't use the common context) * Panel admin works Now the templating part should work. The PR can now be fully tested. I think we should push the templating PR and do the routes/controllers/removal of services in another branch. So we know that this one is functional * Updated dependencies * Fixed test for modelhelper * Fix testing for commentlist * Fix travis :') * Just renamed router and removed network * Applying same SEO fix * Update form_validator.go * Added back regexp package
2017-06-28 13:42:38 +02:00
2017-07-24 07:03:43 +02:00
<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}}
First batch of changes for the refactor (#1078) * First batch of changes for the refactor Added the support of gin in routes and other services/utils Begining implementation of JetHTML * Remove os folder * Move scrapers to own repo * Second batch of changes All .jet.html are the working templates. You can now test this PR, the index Page and upload works. If you want to complete the other html templates, you're welcome * Move captcha to util * Move uploadService to utils * Use govalidator instead of regex * Third batch of changes All the front end should as previously. I also fixed some minor things unrelated to the refactor (mostly style issues on static pages) Now errors can be accessed by importing the "errors" helpers and using the `yield errors(name="xxx")` command in templates. Same for infos. Templates are now more hierarchized with a base template "base.jet.html" which is extended depending on the context in "index_site" or "index_admin" layouts. Those layouts are extended than in every pages. Other helpers are captcha to render a captcha `yield captcha(captchaid="xxx")` And also csrf, with the command `yield csrf_field()` To translate, you don't have anymore to do `call $.T "xxx"`, you just have to do `T("xxx")`. Pages for the website part are in folders in the folder "templates/site". Pages for the admin part are in "templates/admin". Layouts are separated in "templates/layouts". Helpers and menu are in "templates/layouts/helpers" and "templates/layouts/menu". Error pages should be put in "templates/errors" * Added test on templates When adding a new template, you have to tell to template_test.go, the context of the new template (if it doesn't use the common context) * Panel admin works Now the templating part should work. The PR can now be fully tested. I think we should push the templating PR and do the routes/controllers/removal of services in another branch. So we know that this one is functional * Updated dependencies * Fixed test for modelhelper * Fix testing for commentlist * Fix travis :') * Just renamed router and removed network * Applying same SEO fix * Update form_validator.go * Added back regexp package
2017-06-28 13:42:38 +02:00
{{end}}