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/torrents/listing.jet.html

249 lignes
11 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/index_site" }}
{{ import "layouts/partials/helpers/search" }}
2017-10-31 05:28:30 +01:00
{{block title()}}{{if Search.UserName == ""}}{{ T("home")}}{{else}}{{Search.UserName}}{{end}}{{end}}
{{block contclass()}}{{if User.HasAdmin() }}content-admin{{end}}{{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
{{block content_body()}}
{{ if OldNav || Theme == "classic"}}
{{ include "layouts/partials/helpers/oldNav" }}
{{ end }}
"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 07:21:45 +02:00
<!-- Contain the table within a grid, as for better sizing -->
<div class="results box {{ if OldNav || Theme == "classic" }}old-nav{{end}}" >
2017-07-24 07:03:43 +02:00
<table>
<thead class="torrent-info">
<tr>
{{ if User.HasAdmin() }}
<th class="tr-cb hide">
<input type="checkbox" name="select_all" onchange="TorrentsMod.selectAll(this.checked)"/>
</th>
{{end}}
<th class="tr-cat">{{ T("category")}}</th>
<th class="tr-name">
<a href="{{ genSearchWithOrdering(URL, "1", Search.SearchURL) }}">
2017-07-24 07:03:43 +02:00
{{ T("name")}}
<span class="sort-arrows">{{ genSortArrows(URL, "1")|raw }}</span>
</a>
</th>
<th class="tr-cs" style="font-size: 0px;">Msg</th>
2017-07-24 07:03:43 +02:00
<th class="tr-links"></th>
<th class="tr-size hide-xs"><a href="{{ genSearchWithOrdering(URL, "4", Search.SearchURL) }}">{{ T("size")}}<span class="sort-arrows">{{ genSortArrows(URL, "4")|raw }}</span></a></th>
Frontend rewrite (DONE) (#723) * Remove Bootstrap and Jquery, and create basic nav * More improvements to navbar, as well as work on _badgemenu * Complete navbar HTML, obviously it still looks horrendous * Change layout on torrent table, using grids. * Remove Bootstrap and Jquery, and create basic nav * More improvements to navbar, as well as work on _badgemenu * Complete navbar HTML, obviously it still looks horrendous * Change layout on torrent table, using grids. * HOLY FUCK INDEX IS /DONE/ * DO UPLOAD PAGE, DELETE OLD SHITTY CSS * Complete login page * Remove Bootstrap and Jquery, and create basic nav * More improvements to navbar, as well as work on _badgemenu * Complete navbar HTML, obviously it still looks horrendous * Change layout on torrent table, using grids. * Remove Bootstrap and Jquery, and create basic nav * More improvements to navbar, as well as work on _badgemenu * Complete navbar HTML, obviously it still looks horrendous * HOLY FUCK INDEX IS /DONE/ * DO UPLOAD PAGE, DELETE OLD SHITTY CSS * Complete login page * Begin work on profile page * fucking git, man * Damn, that looks sexy * Complete login and register pages, include very minimal grid system, and delete all of view template * Do view page! * Finish view even more * Fix dates and filesizes in torrent table * Improve comment/captcha input * Actually add magnet and torrent buttons * Add open-iconic instead of fontawesome * Improve user side-panel * Rename Category_* to CategoryName * Beginning to finish up * Implement themes and add basic mobile support to front page * Fix some slight color errors * Fix captcha on dark * magnet and torrent links on view
2017-05-24 06:20:51 +02:00
2017-07-24 07:03:43 +02:00
<th class="tr-se hide-smol">
<a href="{{ genSearchWithOrdering(URL, "5", Search.SearchURL) }}">
2017-07-24 07:03:43 +02:00
{{ T("S")}}
<span class="sort-arrows">{{ genSortArrows(URL, "5")|raw }}</span>
</a>
</th>
<th class="tr-le hide-smol">
<a href="{{ genSearchWithOrdering(URL, "6", Search.SearchURL) }}">
2017-07-24 07:03:43 +02:00
{{ T("L")}}
<span class="sort-arrows">{{ genSortArrows(URL, "6")|raw }}</span>
</a>
</th>
<th class="tr-dl hide-xs">
<a href="{{ genSearchWithOrdering(URL, "7", Search.SearchURL) }}">
2017-07-24 07:03:43 +02:00
{{ T("D")}}
<span class="sort-arrows">{{ genSortArrows(URL, "7")|raw }}</span>
</a>
</th>
2017-09-08 20:34:04 +02:00
<!-- <th><span class="glyphicon glyphicon-comment"></span></th> -->
<th class="tr-date hide-xs"><a href="{{ genSearchWithOrdering(URL, "2", Search.SearchURL) }}">
2017-07-24 07:03:43 +02:00
{{ T("date")}}
<span class="sort-arrows">{{ genSortArrows(URL, "2")|raw }}</span>
</a>
</th>
</tr>
</thead>
"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 07:21:45 +02:00
<tbody id="torrentListResults" {{if AltColors}}class="alt-colors"{{end}}>
2017-07-24 07:03:43 +02:00
{{ range Models}}
<tr id="torrent_{{ .ID }}" class="torrent-info {{if .Status == 2}}remake{{else if .Status == 3}}trusted{{else if .Status == 4}}aplus{{end}}" >
{{ if User.HasAdmin() }}
<td class="tr-cb hide">
<input data-name="{{ .Name }}" type="checkbox" id="torrent_cb_{{ .ID }}" name="torrent_id" value="{{ .ID }}"/>
</td>
{{ end }}
<td class="tr-cat home-td">
<div class="nyaa-cat {{ if Sukebei() }}sukebei-cat-{{ .Category }}{{else}}nyaa-cat-{{end}}{{ .SubCategory}}">
<a href="{{ URL.Parse("/search?c="+.Category+"_"+ .SubCategory) }}" title="{{ T(CategoryName(.Category, .SubCategory)) }}" class="category">
</a>
{{if .Languages[0] != "" }}
<a href="{{ URL.Parse("/search?c="+.Category+"_"+ .SubCategory +"&lang=") }}{{ range key, language := .Languages }}{{ language }}{{ if len(.Languages) > 1 && (key+1) < len(.Languages) }},{{ end }}{{ end }}">
<img src="/img/blank.gif" alt="{{ range key, language := .Languages }}{{ LanguageNameFromCode(language, T) }}{{ if len(.Languages) > 1 && (key+1) < len(.Languages) }},{{ end }}{{ end }}" class="flag flag-{{ (len(.Languages) == 1) ? FlagCode(.Languages[0]) : "multiple" }}" title="{{ range key, language := .Languages }}{{ LanguageNameFromCode(language, T) }}{{ if len(.Languages) > 1 && (key+1) < len(.Languages) }},{{ end }}{{ end }}"/>
2017-07-24 07:03:43 +02:00
</a>
{{end}}
</div>
</td>
"No comments" message, avatar in comments, classic theme improvements, some other changes, Old Navigation (#1545) * Update view.jet.html * Update en-us.all.json * Update view.jet.html * Update CHANGELOG.md * fix travis * Update classic.css * Update view.jet.html * Update main.css * Update classic.css * Update classic.css * Update classic.css * add link to user page & avatar in comment * stylisation for avatar in main.css * Update classic.css * Fix wrongly placed ::before * Add rule list to terms of service * import rules on register * fix refine-container-2's inputs * Update base.jet.html * Update en-us.all.json * Update CHANGELOG.md * GenNav changes to constantly put HTML for nav arrows regardless of page * css changes for website nav etc etc * add OldNav global variable * Add OldNav to test.go * Update publicSettings.go * change OldNav's value type * Old navigation in settings * add OldNav in user variables * add oldNav input handler in settings.go * Change OldNav's default value into false * Create OldNav.jet.html * Update search.jet.html * remove character that had nothing to do here * fix wrong variable name * fix worng variable name and travis * Update classic.css * Add sort order & type to old nav * add toString() function in test * add toString() function * translation string for oldnav setting * Use translation string in settings.jet.html * fix few html errors * ditto * travis fix test * remove useless charset * remove useless things * add spaces before attributes * attempt at fixing travis 2 * fix wrong variable name * Update classic.css * fix travis plsss
2017-09-11 19:45:39 +02:00
<td class="tr-name home-td" {{ if len(.Comments) == 0 }}colspan="2"{{ end }}>
2017-07-24 07:03:43 +02:00
<a href="/view/{{ .ID }}">
{{.Name}}
</a>
</td>
{{ if len(.Comments) > 0 }}
<td class="tr-cs home-td" title="{{len(.Comments)}} {{T("comments")}}">
[WIP] Anidex, TT & Nyaa.si uploading (#1604) * Update main.css * Update tomorrow.css * Create upload_multiple.jet.html * Create upload.js * Update upload.jet.html * Update upload.jet.html * Update upload.jet.html * Update tomorrow.css * Update main.css * Update tomorrow.css * Update main.css * Update user.go * Update template_test.go * Update main.css * Update upload.jet.html * Update edit.jet.html * Update template_test.go * Update upload.jet.html * Update main.css * new design for user edit * Fix CRSF token * Update upload_multiple.jet.html * Update upload.jet.html * Update profile.jet.html * Update base.jet.html * Update edit.jet.html * Update forms.go * Update forms_test.go * Update forms_test.go * Update forms.go * Update forms_test.go * Update main.css * Fix 4+ torrent flags display on IE * Fix userprofile buttons on IE, remove fancy css * Fix torrent link being hidden on IE * Update listing.jet.html * Update main.css * Update listing.jet.html * Delete torrent_item_upload.jet.html * Update torrent_item.jet.html * Update main.css * Update classic.css * Update listing.jet.html * Update classic.css * Update profile.jet.html * Update upload.jet.html * Update classic.css * Update classic.css * Update main.css * Update user.go * Update upload.jet.html * Update upload.jet.html * Update edit.jet.html * Update template_test.go * Update forms.go * Update forms_test.go * Update main.css * Update classic.css * checkboxes next to language div * wooo responsive checkboxes * remove empty space * need an !important here * Fix flags being unaligned on IE * Fix some inputs being too big on classic.css, remove fancy shit * Update classic.css * fix travis * Update main.css * Update upload.jet.html * Update edit.jet.html
2017-09-30 15:10:47 +02:00
<a href="/view/{{ .ID }}#comments" class="icon-chat">{{len(.Comments)}}</a>
2017-07-24 07:03:43 +02:00
</td>
{{ end }}
<td class="tr-links home-td">
2017-07-24 07:03:43 +02:00
<a href="{{.Magnet}}" title="{{ T("magnet_link") }}">
<div class="icon-magnet"></div>
</a>
<a href="{{.TorrentLink}}" title="{{ T("torrent_file") }}" {{if !torrentFileExists(.Hash, .TorrentLink)}}class="hidden"{{end}}>
2017-07-24 07:03:43 +02:00
<div class="icon-floppy"></div>
</a>
</td>
<td class="tr-size home-td hide-xs">
2017-10-31 01:37:32 +01:00
{{ fileSize(.Filesize, T, true) }}
2017-07-24 07:03:43 +02:00
</td>
{{if .StatsObsolete[0] }}
[WIP] Anidex, TT & Nyaa.si uploading (#1604) * Update main.css * Update tomorrow.css * Create upload_multiple.jet.html * Create upload.js * Update upload.jet.html * Update upload.jet.html * Update upload.jet.html * Update tomorrow.css * Update main.css * Update tomorrow.css * Update main.css * Update user.go * Update template_test.go * Update main.css * Update upload.jet.html * Update edit.jet.html * Update template_test.go * Update upload.jet.html * Update main.css * new design for user edit * Fix CRSF token * Update upload_multiple.jet.html * Update upload.jet.html * Update profile.jet.html * Update base.jet.html * Update edit.jet.html * Update forms.go * Update forms_test.go * Update forms_test.go * Update forms.go * Update forms_test.go * Update main.css * Fix 4+ torrent flags display on IE * Fix userprofile buttons on IE, remove fancy css * Fix torrent link being hidden on IE * Update listing.jet.html * Update main.css * Update listing.jet.html * Delete torrent_item_upload.jet.html * Update torrent_item.jet.html * Update main.css * Update classic.css * Update listing.jet.html * Update classic.css * Update profile.jet.html * Update upload.jet.html * Update classic.css * Update classic.css * Update main.css * Update user.go * Update upload.jet.html * Update upload.jet.html * Update edit.jet.html * Update template_test.go * Update forms.go * Update forms_test.go * Update main.css * Update classic.css * checkboxes next to language div * wooo responsive checkboxes * remove empty space * need an !important here * Fix flags being unaligned on IE * Fix some inputs being too big on classic.css, remove fancy shit * Update classic.css * fix travis * Update main.css * Update upload.jet.html * Update edit.jet.html
2017-09-30 15:10:47 +02:00
<td class="tr-se home-td hide-smol">-</td>
<td class="tr-le home-td hide-smol">-</td>
<td class="tr-dl home-td hide-xs">-</td>
2017-07-24 07:03:43 +02:00
{{else}}
<td class="tr-se home-td hide-smol">{{.Seeders}}</td>
<td class="tr-le home-td hide-smol">{{.Leechers}}</td>
<td class="tr-dl home-td hide-xs">{{.Completed}}</td>
{{end}}
<td class="tr-date home-td date-short hide-xs" title="{{formatDate(.FullDate, false)}}">{{formatDate(.FullDate, true)}}</td>
2017-07-24 07:03:43 +02:00
</tr>
{{end}}
</tbody>
</table>
</div>
{{ if User.HasAdmin() }}
<div class="modtools">
<button id="show_actions" class="form-input" data-toggle-text="{{ T("hide_mod_tools")}}">{{ T("show_mod_tools")}}</button>
<span class="actions">
<span class="btn-group">
<select class="cb_action" name="category_id" style="width: 14em;">
<option value="">{{ T("category")}}</option>
{{ range _, cat := GetCategories(true, true) }}
<option value="{{ cat.ID }}">{{ T(cat.Name) }}</option>
{{ end }}
</select>
<input class="cb_action" type="number" name="owner_id" style="width: 10em;" placeholder="{{ T("owner_id_placeholder") }}"/>
<select class="cb_action" name="status_id">
<option value="">{{ T("torrent_status")}}</option>
<option value="5">{{ T("torrent_status_blocked") }}</option>
<option value="1">{{ T("torrent_status_normal")}}</option>
<option value="2" >{{ T("torrent_status_remake")}}</option>
<option value="3">{{ T("trusted")}}</option>
<option value="4">A+</option>
</select>
<button class="cb_action form-input btn-orange" id="edit">{{ T("edit") }}</button>
</span>
<span class="btn-group">
<button class="cb_action form-input btn-red" id="lock_delete">{{ T("lock_delete") }}</button>
<button class="cb_action form-input btn-red" id="delete">{{ T("delete") }}</button>
</span>
<span class="btn-group">
<button class="cb_submit form-input btn-green" id="modal_active">{{ T("save_changes") }}</button>
</span>
</span>
</div>
<!-- Modal -->
<div id="modal_mod_tools" class="modal">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<span class="close">&times;</span>
<h2>{{ T("following_changes_applied") }}</h2>
Frontend rewrite (DONE) (#723) * Remove Bootstrap and Jquery, and create basic nav * More improvements to navbar, as well as work on _badgemenu * Complete navbar HTML, obviously it still looks horrendous * Change layout on torrent table, using grids. * Remove Bootstrap and Jquery, and create basic nav * More improvements to navbar, as well as work on _badgemenu * Complete navbar HTML, obviously it still looks horrendous * Change layout on torrent table, using grids. * HOLY FUCK INDEX IS /DONE/ * DO UPLOAD PAGE, DELETE OLD SHITTY CSS * Complete login page * Remove Bootstrap and Jquery, and create basic nav * More improvements to navbar, as well as work on _badgemenu * Complete navbar HTML, obviously it still looks horrendous * Change layout on torrent table, using grids. * Remove Bootstrap and Jquery, and create basic nav * More improvements to navbar, as well as work on _badgemenu * Complete navbar HTML, obviously it still looks horrendous * HOLY FUCK INDEX IS /DONE/ * DO UPLOAD PAGE, DELETE OLD SHITTY CSS * Complete login page * Begin work on profile page * fucking git, man * Damn, that looks sexy * Complete login and register pages, include very minimal grid system, and delete all of view template * Do view page! * Finish view even more * Fix dates and filesizes in torrent table * Improve comment/captcha input * Actually add magnet and torrent buttons * Add open-iconic instead of fontawesome * Improve user side-panel * Rename Category_* to CategoryName * Beginning to finish up * Implement themes and add basic mobile support to front page * Fix some slight color errors * Fix captcha on dark * magnet and torrent links on view
2017-05-24 06:20:51 +02:00
</div>
2017-07-24 07:03:43 +02:00
<div class="modal-body">
<h3>{{ T("changes_in_following_order") }}</h3>
<div class="progress-bar" id="progress_modtool" style="display: none;">
<div class="progress-green"></div>
</div>
<hr>
<div class="logs_mess" style="display: none;"></div>
<h2>{{ T("edit_changes") }}</h2>
<div class="edit_changes"></div>
<h2>{{ T("delete_changes") }}</h2>
<div class="delete_changes"></div>
</div>
2017-07-24 07:03:43 +02:00
<div class="modal-footer">
<span>
<button id="confirm_changes" onclick="TorrentsMod.ApplyChanges();">{{ T("yes")}}</button>
<button class="close" onclick="Modal.CloseActive();">{{ T("no")}}</button>
</span>
<h3>{{ T("are_you_sure") }} </h3>
</div>
2017-07-24 07:03:43 +02:00
</div>
</div>
{{end}}
2017-05-05 13:06:41 +02:00
{{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
{{ block footer_js()}}
<script type="text/javascript" src="{{ URL.Parse("/js/template.js") }}"></script>
<script type="text/javascript" src="{{ URL.Parse("/js/modal.js") }}"></script>
<script type="text/javascript" src="{{ URL.Parse("/js/torrents.js") }}"></script>
<script type="text/javascript" src="{{ URL.Parse("/js/translation.js") }}"></script>
{{ if User.HasAdmin() }}
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
<script type="text/javascript" src="{{ URL.Parse("/js/torrentsMod.js") }}"></script>
2017-07-24 07:03:43 +02:00
<script type="text/javascript">
// We add translations string
T.Add({
try_new_attempt: "{{ T("try_new_attempt") }}",
query_is_broken: "{{ T("query_is_broken") }}",
query_executed_success: "{{ T("query_executed_success") }}",
all_operations_done: "{{ T("all_operations_done") }}",
refreshing_in: "{{ T("refreshing_in") }}",
delete_reports_with_torrents: "{{ T("delete_reports_with_torrents") }}",
with_st: "{{ T("with_st") }}",
and_reports: "{{ T("and_reports") }}",
reports: "{{ T("reports") }}",
lock: "{{ T("lock") }}",
status_js: "{{ T("status_js") }}",
owner_id_js: "{{ T("owner_id_js") }}",
category_js: "{{ T("category_js") }}",
no_changes: "{{ T("no_changes") }}",
query_nb: "{{ T("query_nb") }}"
});
// Modal initialization
Modal.Init({elements: document.getElementsByClassName("modal"),
button: "#modal_active",
before: function() {
TorrentsMod.generatingModal();
},
close: function() {
TorrentsMod.resetModal();
}
});
// Templates initialization
Templates.Add("torrents.delete.item", function(torrent) {
return '<div class="delete_item" id="list_item_'+torrent.id+'"><span>'+Templates.EncodeEntities(torrent.name)+'</span>'+
'<a href="#" onclick="return TorrentsMod.RemoveItemFromQueue('+torrent.key+', '+torrent.id+')"><i class="icon-trash"></i></a></div>'
});
Templates.Add("torrents.delete.block", function(torrentQuery){
return '<div class="delete_list" id="list_'+torrentQuery.unique_id+'"><div class="title">'+
'<h3 style="display:inline-block;" onclick="TorrentsMod.toggleList(this);">'+T.r("query_nb", torrentQuery.unique_id)+
'</h3>'+
'<span class="infos">'+torrentQuery.infos+'<a href="#" class="icon" onclick="return TorrentsMod.RemoveFromQueue('+torrentQuery.key+')"><div class="icon-trash"></div></a>'+
'</span></div>'+
'<div class="list">'+torrentQuery.list+'</div></div>';
});
Templates.Add("torrents.edit.item", function(torrent) {
return '<div class="edit_item" id="list_item_'+torrent.id+'"><span>'+Templates.EncodeEntities(torrent.name)+'</span>'+
'<a href="#" onclick="return TorrentsMod.RemoveItemFromQueue('+torrent.key+', '+torrent.id+')"><i class="icon-trash"></i></a></div>'
});
Templates.Add("torrents.edit.block", function(torrentQuery){
return '<div class="edit_list" id="list_'+torrentQuery.unique_id+'"><div class="title">'+
'<h3 style="display:inline-block;" onclick="TorrentsMod.toggleList(this);">'+T.r("query_nb", torrentQuery.unique_id)+
'</h3>'+
'<span class="infos">'+torrentQuery.infos+'<a href="#" class="icon" onclick="return TorrentsMod.RemoveFromQueue('+torrentQuery.key+')"><div class="icon-trash"></div></a>'+
'</span></div>'+
'<div class="list">'+torrentQuery.list+'</div></div>';
});
Templates.Add("torrents.logs.error", function(msg) {
return '<div class="error">'+msg+'</div>';
});
Templates.Add("torrents.logs.success", function(msg) {
return '<div class="success">'+msg+'</div>';
});
</script>
{{end}}
<!-- JS Template for torrents ajax -->
2017-07-24 07:03:43 +02:00
{{ include "layouts/partials/torrent_item" }}
2017-08-01 23:41:46 +02:00
<script type="text/javascript">
2017-07-24 07:03:43 +02:00
Torrents.LastID = {{ lastID(URL, Models) }};
if (Torrents.LastID > 0) Torrents.CanRefresh = true;
</script>
{{end}}