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/layouts/partials/helpers/search.jet.html
akuma06 9bb26a7dbe Add username search (#1434)
* Add username search

Quite simple, you need to provide ?user=xxxx

* Add userID search + Changed name of input field

Now ?user=xxx can also search userID.
For that you need to prefix it with "#".
Example:
* ?user=akuma06 would search torrents based on username akuma06
* ?user=#123 would search torrents based on userID 123 (be aware that you have to encode the "#" in url format %23)

* Update search.jet.html (#1436)

* Update main.css (#1435)
2017-08-29 11:06:16 +10:00

102 lignes
5,4 Kio
HTML

{{ import "flags" }}
{{block search_common()}}
<select name="c" class="form-input form-category">
<option value="_">{{ T("all_categories")}}</option>
{{ range _, cat := GetCategories(true, true) }}
<option value="{{ cat.ID }}" {{if Search.Category == cat.ID }}selected{{end}}>{{ T(cat.Name) }}</option>
{{ end }}
</select>
{{end}}
{{block search_button() }}
<input class="form-input search-box" name="q" placeholder="{{ T("search")}}" type="text" value="{{Search.NameLike}}"/>
<button type="submit" class="form-input icon-search"></button><button type="submit" class="form-input refine" name="refine" value="1">{{ T("refine")}}</button>
{{end}}
{{block search_refine(url="") }}
<div style="{{ if !Search.ShowRefine }}display:none;{{ end }}" class="box refine">
</span>
<form style="display: grid;" method="GET" action="{{ url }}">
<h3>{{ T("refine_search") }}</h3>
<div>
<div class="refine-container-1">
<span class="form-refine">
<span class="spacing">{{ T("search_for") }}:</span>
<input type="text" class="form-input refine-searchbox" size="30" name="q" value="{{Search.NameLike}}" placeholder="{{ T("search_for") }}"/><select name="c" class="form-input refine-category"/>
<option value="_">{{ T("all_categories")}}</option>
{{ range _, cat := GetCategories(true, true) }}
<option value="{{ cat.ID }}" {{if Search.Category == cat.ID }}selected{{end}}>{{ T(cat.Name) }}</option>
{{ end }}
</select>
</span>
<span class="form-refine">
<span class="spacing">{{ T("show") }}:</span>
<select name="s" class="form-input spacing" style="max-width: 21%;min-width: 100px;">
<option value="0">{{ T("show_all")}}</option>
<option value="2" {{if Search.Status == 2}}selected{{end}}>{{ T("filter_remakes")}}</option>
<option value="3" {{if Search.Status == 3}}selected{{end}}>{{ T("trusted")}}</option>
<option value="4" {{if Search.Status == 4}}selected{{end}}>A+</option>
</select>
Limit: <input type="number" name="limit" value="{{ Navigation.MaxItemPerPage }}" class="form-input spacing" min="1" max="300"/>
From: <input type="text" name="user" placeholder="Username/ID" value="{{ Search.User }}" class="form-input refine-user"/>
</span>
<span class="form-refine">
<span class="spacing">{{ T("between")}}</span>
<input class="form-input" size="7" name="minSize" type="text" value="{{Search.MinSize}}"/>
{{ T("and")}}
<input size="7" class="form-input" name="maxSize" type="text" value="{{Search.MaxSize}}"/>
<select name="sizeType" class="form-input">
<option value="b"{{if Search.SizeType == "b"}} selected{{end}}>B</option>
<option value="k"{{if Search.SizeType == "k"}} selected{{end}}>KiB</option>
<option value="m"{{if Search.SizeType == "m"}} selected{{end}}>MiB</option>
<option value="g"{{if Search.SizeType == "g"}} selected{{end}}>GiB</option>
</select>
{{ T("large")}}
</span>
<span class="form-refine">
<span class="spacing">{{ T("from")}}</span>
<input class="form-input refine-date" name="fromDate" type="text" value="{{Search.FromDate}}" placeholder="YYYY/MM/DD"/>
{{ T("to")}}
<input class="form-input refine-date spacing" size="7" name="toDate" type="text" value="{{Search.ToDate}}" placeholder="YYYY/MM/DD"/>
Exclude: <input type="number" name="nuserID" placeholder="UserID" value="" class="form-input refine-userid"/>
</span>
<span class="form-refine show-xs" style="margin-bottom: 2px;">
<span class="spacing">{{T("sort_by")}}</span>
<select name="sort" class="form-input">
<option value="1"{{if Search.Sort == 1}}selected{{end}}>{{T("name")}}</option>
<option value="4"{{if Search.Sort == 4}}selected{{end}}>{{T("size")}}</option>
<option value="5"{{if Search.Sort == 5}}selected{{end}}>{{T("seeders")}}</option>
<option value="6"{{if Search.Sort == 6}}selected{{end}}>{{T("leechers")}}</option>
<option value="7"{{if Search.Sort == 7}}selected{{end}}>{{T("completed")}}</option>
<option value="2"{{if Search.Sort == 2 || Search.Sort == 0}}selected{{end}}>{{T("date")}}</option>
</select>
<select name="order" class="form-input">
<option value="true">{{T("ascending")}}</option>
<option value="false"{{if !Search.Order}}selected{{end}}>{{T("descending")}}</option>
</select>
</span>
</div>
<div class="refine-container-2">
<span class="form-refine">
<span class="spacing">Quality:</span>
<select name="vq" class="form-input">
<option value="">{{ T("show_all")}}</option>
{{ range _, vq := Config.Torrents.Tags.Types.Get("videoquality").Defaults }}
<option value="{{vq}}">{{T("tagvalue_" + vq)}}</option>
{{end}}
</select>
</span>
<span class="form-refine">
<span class="spacing">Tags:</span>
<input type="number" name="anidb" placeholder="AniDB" title="AniDB" value="" class="form-input"/>
<input type="number" name="vgmdb" placeholder="VGMdb" title="VGMdb" value="" class="form-input"/>
<input type="number" name="vndb" placeholder="VnDB" title="VnDB" value="" class="form-input"/>
<input type="number" name="dlsite" placeholder="DLsite" title="DLsite" value="" class="form-input"/>
</span>
<div name="language" class="form-refine form-input language">
{{ yield flagList(languages=GetTorrentLanguages(), selected=Search.Languages, inputname="lang", id="refine-search")}}
</div>
<button type="submit" class="form-input refine-btn" name="refine" value="1">{{ T("refine")}}</button>
</div>
</div>
</form>
</div>
{{end}}