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/torrents.jet.html
kilo 5a184bfb50 "Alternating Colors" option in settings (#1440)
* Non-bold torrent name when using alternating background colors

* Add alternating colors for g.css

* Add alternating colors for classic.css

* Add alternating colors for tomorreuw

* Update classic.css

* Add alternating colors to settings page

* Add alt-colors class to tbody if enabled

* Add GetAltColorsFromRequest() function to get AltColors cookie value

* Create AltColors variable for usage in listing

* Make settings handle altColors input

* Add AltColors in user struct

* Returned the wrong variable here

* Turn function return value into bool

* Condition checks variable like a bool

* ditto

* better color for g.css

* even better color

* better

* Last change for g.css

* Improvement for tomorrow

* Update classic.css

* add alt-colors class to upload preview

* Add alt-colors to user profile

* more vivid color for g

* Fix typo

* Remove browser outline for refine when clicked on

* remove browser outline

* Fix rules that didn't apply and category icon being way too small on user profile thanks to usage of percentage

* Remove show-xs class for search inputs

* Turn refine button back into position: absolute to pin at very bottom of refine

* Alternating colors for g's trusted, remake & aplus

* Update tomorrow.css

* attempt at fixing travis

* test (will have to rollback that change)

* rollback

* will have to rollback

* will have to rollback

* will have to rollback

* will have to rollback

* add AltColors variable to template test

* rollback

* rollback

* rollback

* rollback
2017-08-30 15:21:45 +10:00

69 lignes
3 Kio
HTML

{{ extends "layouts/profile" }}
{{ import "layouts/partials/menu/profile" }}
{{ block profile_navigation()}}{{ yield profile_menu(route="profile") }}{{end}}
{{block profile_content()}}
{{ if len(UserProfile.Torrents) > 0 }}
<table {{if AltColors}}class="alt-colors"{{end}}>
<tr class="torrent-info">
<th class="tr-cat user-td">{{ T("category")}}</th>
<th class="tr-name user-td">{{ T("name")}}</th>
<th class="tr-links user-td">{{ T("links")}}</th>
<th class="tr-size user-td hide-xs">{{ T("size")}}</th>
<th class="tr-date user-td hide-smol">{{ T("date")}}</th>
</tr>
{{ range i, t := UserProfile.Torrents }}
{{ torrent := t.ToJSON() }}
<tr class="torrent-info
{{if torrent.Status == 2}}remake{{else if torrent.Status == 3}}trusted{{else if torrent.Status == 4}}aplus{{end}}
{{if t.Hidden && User.CurrentOrAdmin(t.Uploader.ID) }} hidden{{end}}">
<td class="tr-cat user-td">
{{ if Sukebei() }}
<div class="nyaa-cat sukebei-cat-{{ torrent.Category }}{{ torrent.SubCategory}}">
{{ else }}
<div class="nyaa-cat nyaa-cat-{{ torrent.SubCategory }}">
{{ end }}
<a href="{{URL.Parse ("/search?c="+ torrent.Category + "_" +torrent.SubCategory) }}" title="{{T(CategoryName(torrent.Category, torrent.SubCategory))}}" class="category">
{{ if torrent.Languages[0] != "" }}
<a href="{{ URL.Parse("/search?c="+torrent.Category+"_"+ torrent.SubCategory +"&lang=") }}{{ range key, language := torrent.Languages }}{{ language }}{{ if len(torrent.Languages) > 1 && (key+1) < len(torrent.Languages) }},{{ end }}{{ end }}">
<img src="/img/blank.gif" alt="{{ LanguageNameFromCode(torrent.Languages[0], T) }}" class="flag flag-{{ (len(torrent.Languages) == 1) ? FlagCode(torrent.Languages[0]) : "multiple" }}" title=" {{ range key, language := torrent.Languages }}{{ LanguageNameFromCode(language, T) }}{{ if len(torrent.Languages) > 1 && (key+1) < len(torrent.Languages) }},{{ end }}{{ end }}"/>
</a>
{{end}}
</a>
</div>
</td>
<td class="tr-name user-td">
<a href="/view/{{torrent.ID}}">
{{torrent.Name}}
</a>
</td>
<td class="tr-links user-td">
<a href="{{torrent.Magnet}}" title="{{ T("magnet_link") }}">
<div class="icon-magnet"></div>
</a>
{{if torrent.TorrentLink != ""}}
<a href="{{torrent.TorrentLink}}" title="{{ T("torrent_file") }}">
<div class="icon-floppy"></div>
</a>
{{end}}
</td>
<td class="tr-size user-td hide-xs">
{{ fileSize(torrent.Filesize, T) }}
</td>
<td class="tr-date user-td date-short hide-smol">{{torrent.Date}}</td>
</tr>
{{end}}
</table>
<nav class="torrentNav" aria-label="Page navigation">
<ul class="pagination">
<a href="/search?userID={{ UserProfile.ID }}" aria-label="Next">
<li>
<span class="glyphicon glyphicon-add"></span>
{{ T("see_more_torrents_from", UserProfile.Username) }}
</li>
</a>
</ul>
</nav>
{{else}}
<h2 style="text-align: center;">{{ T("no_torrents_uploaded") }}</h2>
{{end}}
{{end}}