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/_search.html
Ramon Dantas 1968d2ae54 Move translation func to template variables (#652)
* Add T field to template variables

* Remove languages.SetTranslationFromRequest

* Add Tfunc on handlers

* Remove T and Ts from template_functions

* Update templates

Change the templates to use the local Tfunc, instead of the global one.
Also changed the signature of the fields on template_variables.go, so that
they return a template.HTML to avoid escaping problems.

* Remove unnecessary variable
2017-05-21 08:38:28 +10:00

74 lignes
6 Kio
HTML

{{define "search_common"}}
<select name="c" class="form-control input-sm" value>
<option value="_">{{call $.T "all_categories"}}</option>
{{ if Sukebei }}
<option value="1_" {{if eq .Search.Category "1_"}}selected{{end}}>{{call $.T "art"}}</option>
<option value="1_1" {{if eq .Search.Category "1_1"}}selected{{end}}>{{call $.T "art_anime"}}</option>
<option value="1_2" {{if eq .Search.Category "1_2"}}selected{{end}}>{{call $.T "art_doujinshi"}}</option>
<option value="1_3" {{if eq .Search.Category "1_3"}}selected{{end}}>{{call $.T "art_games"}}</option>
<option value="1_4" {{if eq .Search.Category "1_4"}}selected{{end}}>{{call $.T "art_manga"}}</option>
<option value="1_5" {{if eq .Search.Category "1_5"}}selected{{end}}>{{call $.T "art_pictures"}}</option>
<option value="2_" {{if eq .Search.Category "2_"}}selected{{end}}>{{call $.T "real_life"}}</option>
<option value="2_1" {{if eq .Search.Category "2_1"}}selected{{end}}>{{call $.T "real_life_photobooks_and_pictures"}}</option>
<option value="2_2" {{if eq .Search.Category "2_2"}}selected{{end}}>{{call $.T "real_life_videos"}}</option>
{{ else }}
<option value="3_" {{if eq .Search.Category "3_"}}selected{{end}}>{{call $.T "anime"}}</option>
<option value="3_12" {{if eq .Search.Category "3_12"}}selected{{end}}>{{call $.T "anime_amv"}}</option>
<option value="3_5" {{if eq .Search.Category "3_5"}}selected{{end}}>{{call $.T "anime_english_translated"}}</option>
<option value="3_13" {{if eq .Search.Category "3_13"}}selected{{end}}>{{call $.T "anime_non_english_translated"}}</option>
<option value="3_6" {{if eq .Search.Category "3_6"}}selected{{end}}>{{call $.T "anime_raw"}}</option>
<option value="2_" {{if eq .Search.Category "2_"}}selected{{end}}>{{call $.T "audio"}}</option>
<option value="2_3" {{if eq .Search.Category "2_3"}}selected{{end}}>{{call $.T "audio_lossless"}}</option>
<option value="2_4" {{if eq .Search.Category "2_4"}}selected{{end}}>{{call $.T "audio_lossy"}}</option>
<option value="4_" {{if eq .Search.Category "4_"}}selected{{end}}>{{call $.T "literature"}}</option>
<option value="4_7" {{if eq .Search.Category "4_7"}}selected{{end}}>{{call $.T "literature_english_translated"}}</option>
<option value="4_8" {{if eq .Search.Category "4_8"}}selected{{end}}>{{call $.T "literature_raw"}}</option>
<option value="4_14" {{if eq .Search.Category "4_14"}}selected{{end}}>{{call $.T "literature_non_english_translated"}}</option>
<option value="5_" {{if eq .Search.Category "5_"}}selected{{end}}>{{call $.T "live_action"}}</option>
<option value="5_9" {{if eq .Search.Category "5_9"}}selected{{end}}>{{call $.T "live_action_english_translated"}}</option>
<option value="5_10" {{if eq .Search.Category "5_10"}}selected{{end}}>{{call $.T "live_action_idol_pv"}}</option>
<option value="5_18" {{if eq .Search.Category "5_18"}}selected{{end}}>{{call $.T "live_action_non_english_translated"}}</option>
<option value="5_11" {{if eq .Search.Category "5_11"}}selected{{end}}>{{call $.T "live_action_raw"}}</option>
<option value="6_" {{if eq .Search.Category "6_"}}selected{{end}}>{{call $.T "pictures"}}</option>
<option value="6_15" {{if eq .Search.Category "6_15"}}selected{{end}}>{{call $.T "pictures_graphics"}}</option>
<option value="6_16" {{if eq .Search.Category "6_16"}}selected{{end}}>{{call $.T "pictures_photos"}}</option>
<option value="1_" {{if eq .Search.Category "1_"}}selected{{end}}>{{call $.T "software"}}</option>
<option value="1_1" {{if eq .Search.Category "1_1"}}selected{{end}}>{{call $.T "software_applications"}}</option>
<option value="1_2" {{if eq .Search.Category "1_2"}}selected{{end}}>{{call $.T "software_games"}}</option>
{{ end }}
</select>
<select name="s" class="form-control input-sm">
<option value="0">{{call $.T "show_all"}}</option>
<option value="1" {{if eq .Search.Status 1}}selected{{end}}>{{call $.T "filter_remakes"}}</option>
<option value="2" {{if eq .Search.Status 2}}selected{{end}}>{{call $.T "trusted"}}</option>
<option value="3" {{if eq .Search.Status 3}}selected{{end}}>A+</option>
</select>
{{ if .Search.ShowItemsPerPage }}
<select id="max" name="max" class="form-control input-sm">
<option value="5" {{if eq .Navigation.MaxItemPerPage 5}}selected{{end}}>5</option>
<option value="10" {{if eq .Navigation.MaxItemPerPage 10}}selected{{end}}>10</option>
<option value="15" {{if eq .Navigation.MaxItemPerPage 15}}selected{{end}}>15</option>
<option value="20" {{if eq .Navigation.MaxItemPerPage 20}}selected{{end}}>20</option>
<option value="25" {{if eq .Navigation.MaxItemPerPage 25}}selected{{end}}>25</option>
<option value="30" {{if eq .Navigation.MaxItemPerPage 30}}selected{{end}}>30</option>
<option value="35" {{if eq .Navigation.MaxItemPerPage 35}}selected{{end}}>35</option>
<option value="40" {{if eq .Navigation.MaxItemPerPage 40}}selected{{end}}>40</option>
<option value="45" {{if eq .Navigation.MaxItemPerPage 45}}selected{{end}}>45</option>
<option value="50" {{if eq .Navigation.MaxItemPerPage 50}}selected{{end}}>50</option>
<option value="70" {{if eq .Navigation.MaxItemPerPage 70}}selected{{end}}>70</option>
<option value="100" {{if eq .Navigation.MaxItemPerPage 100}}selected{{end}}>100</option>
<option value="150" {{if eq .Navigation.MaxItemPerPage 150}}selected{{end}}>150</option>
<option value="200" {{if eq .Navigation.MaxItemPerPage 200}}selected{{end}}>200</option>
<option value="300" {{if eq .Navigation.MaxItemPerPage 300}}selected{{end}}>300</option>
</select>
{{ end }}
<input type="hidden" name="userID" value="{{ .Search.UserID }}">
{{end}}
{{define "search_button"}}
<div class="input-group">
<input name="q" class="form-control input-sm" placeholder="{{call $.T "search"}}" type="text" value="{{.Search.Query}}">
<span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-search" aria-hidden="true"></span><span class="search_text"> {{call $.T "search"}}</span></button>
</span>
</div>
{{end}}