Albirew/nyaa-pantsu
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/upload.jet.html

249 lignes
12 KiB
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/csrf" }}
{{ import "layouts/partials/helpers/captcha" }}
{{ import "layouts/partials/helpers/flags" }}
Tag Search + Tests + Search slight refactor [DONE] (#1342) * Tag Search + Tests + Search slight refactor First commit improving search. Different struct have their own file with their tests. This way of separating struct by files is inspired by the go packages I've seen so far. Added new behaviour as discussed in #1334 * fix fallback to ES * Added some comments to explain PG fallback + log err moved * Refactored search Nearly fully covered WhereParams struct has disappeared for Query struct instead In DB model, we use an interface implementing Query struct methods * 1rst Refactor of Tags (WTF already?!) Prepare Tags for the refactored system. Now there will be descriptive tags for a particular release (ecchi, BDSM, ....) and typed tags. Typed tags are tags relevant to all torrents and can be limited to some input value. For example, video quality is a typed tag limited to some values (hd, full hd, sd, ...). In the same way, anidbid is also a typed tag but doesn't have default values. Furthermore, the location storage of tags have changed, now accepted descriptive tags are stored in the torrents table in the column "tags" and they are separated by commas. In the opposite, accepted typed tags can have have their own column in the torrents table. For example, anidbid, vndbid will populate the column DbID when accepted. On the other hand, videoquality will populate the same way as descriptive tags. This behaviour depends on the callbackOnType function in tag/helpers.go * fix for modtools :') * Added anidb, vndb, dlsite & vmdb id fields in torrent model. Tags don't have an accepted field anymore. Accepted Tags are in torrent.AcceptedTags and non-accepted ones in torrrent.Tags. New Helper + New Changelog for translation string. * New upload/edit form for torrent tags. Now the inputs are dynamically generated by the helper tag_form. No more modal window in those form, only inputs. Support of tags in API New translation string for the link to the modal on torrent view. More comments in the functions for tags * Improving how config for tags work. Adding a test on them with understandable messages. Config for tags have now a Field attribute which is linked to the Torrent model. For example anidbid tag type has now a AnidbID field in config which is the name of the field in torrent model (AnidbID). Every new tag type need to have a field attribute with its counterpart in torrent Model. Fixing some errors * Fix compile error + Tests Errors * Improve performance by caching the list of tags with an index Adding/removing tags works/tested New translation strings TODO: test/fix adding tag on upload/edit * Mini fix to display video quality + tags works/tested on modo edit * Fix editing tags on modpanel * Edit tags works * Add translation string * Add search backend for tags. ?tags=xxx,eee,ddd ?anidb=21 ?vndb=23 ?vgmdb=24 ?vq=full_hd * Fix Ajax tag Removal&Add * Added form for descriptive tags * Forgot to add the link between database and form for descriptive tags. * Adding the increase/decrease pantsu for descriptive tags * Fix #1370 * When you actually forgot to commit files after having forgotten commits
2017-08-22 03:48:10 +02:00
{{ import "layouts/partials/helpers/tag_form" }}
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 title()}}{{ T("upload")}}{{end}}
{{block content_body()}}
<div style="text-align: left;" class="box">
<p class="upload-rules">{{ T("read_rules")|raw }}</p>
<form enctype="multipart/form-data" method="POST">
2017-07-24 07:03:43 +02:00
{{ yield csrf_field() }}
<div class="upload-errors">
{{ yield errors(name="name")}}
{{ yield errors(name="torrent")}}
{{ yield errors(name="magnet")}}
{{ yield errors(name="c")}}
{{ yield errors(name="remake")}}
{{ yield errors(name="hidden")}}
{{ yield errors(name="website_link")}}
{{ yield errors(name="tags")}}
</div>
"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
<table class="upload-form-table">
<tbody>
<tr>
<td class="table-input-label"><label for="name">{{ T("name")}}</label></td>
<td class="table-input"><input type="text" name="name" id="name" class="form-input up-input form-torrent-name" placeholder="{{ T("torrent_name")}}" value="{{Form.Name}}" autofocus></td>
</tr>
<tr class="table-torrent-link">
<td class="table-input-label"><label for="torrent">{{ T("torrent_file")}} / {{ T("magnet_link")}}</label></td>
<td class="table-input"><input type="file" name="torrent" id="torrent" class="up-input" accept=".torrent" {{ if Form.Magnet != "" }}disabled{{end}}/><input type="text" name="magnet" id="magnet" class="form-input up-input" placeholder="{{ T("magnet_link")}}" value="{{Form.Magnet}}"/></td>
</tr>
<tr>
<td class="table-input-label"><label for="c">{{ T("category")}}</label></td>
<td class="table-input">
<select name="c" id="c" class="form-input up-input form-torrent-category" required>
<option value="">{{ T("select_a_torrent_category")}}</option>
{{ range _, cat := GetCategories(false, true) }}
<option value="{{ cat.ID }}" {{if Form.Category == cat.ID }}selected{{end}}>{{ T(cat.Name) }}</option>
{{ end }}
</select>
</td>
</tr>
<tr>
<td class="table-input-label">{{ T("torrent_language")}}</td>
<td class="table-input">
<div class="form-input language">
{{ yield flagList(languages=GetTorrentLanguages(), selected=Form.Languages, inputname="languages", id="upload-lang")}}
</div>
[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
<div class="table-checkboxes">
<div class="form-group">
2017-10-31 03:20:32 +01:00
<input type="checkbox" value="true" name="remake" id="remake" class="form-torrent-remake"/ {{if Form.Remake}}checked{{end}}><label for="remake">{{ T("mark_as_remake")}}</label>
[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
</div>
<div class="form-group">
2017-10-31 03:20:32 +01:00
<input type="checkbox" value="true" name="hidden" id="hidden" class="form-torrent-hidden {{ if User.ID == 0 }}hidden{{end}}" {{ if User.ID == 0}}disabled checked{{else if Form.Hidden }}checked{{end}}><label for="hidden" {{ if User.ID == 0 }}class="hidden"{{end}}>{{ T("upload_as_anon")}}</label>
[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
</div>
</div>
</td>
</tr>
<tr>
<td class="table-input-label"><label for="website_link">{{ T("website_link")}}</label></td>
<td class="table-input"><input name="website_link" id="website_link" placeholder="http://" class="form-input up-input" type="text" value="{{Form.WebsiteLink}}"/></td>
</tr>
<tr>
<td class="table-input-label"><label for="desc">{{ T("torrent_description")}}</label></td>
<td class="table-input markdown-container"><textarea name="desc" id="desc" class="form-input up-input" style="height: 10rem;">{{Form.Description}}</textarea></td>
</tr>
Upload to nyaa.si, anidex & TokyoTosho [done] (#1633) * Update upload.go * Update helpers.go * Update template_test.go * Update upload_multiple.jet.html * change variable names * wrong copypaste * change variable name * ditto * Fix travis * Update main.css * Update upload.go * Update upload.jet.html * Update main.css * Update upload.go * More compact form * CSS changes to go along * Update main.css * Update upload.jet.html * Slightly lower bottom margin * Update upload_multiple.jet.html * tomorrow color adjustements * small css adjustements * Update upload.go * Update default_config.yml * Update default_config.yml * Update structs.go * Update user.go * Update structs.go * Update upload.go * Update default_config.yml * Update upload_multiple.jet.html * Update upload.go * Update upload.jet.html * Update template_test.go * this one is optional for anidex * Update default_config.yml * Possible improvement As mentionned in my comment, it seems that having a checkbox already checked and disabled for logged in user + having the input text for apikey is a bit tedious. Moreover, asking to check and fill the input text to upload in anidex when you are not logged is doing things twice. If you don't want to upload to anidex, don't fill the input. So this commit push a new behaviour: * If you are logged in and you have filled your anidex/nyaasi api key : the form should only show the checkbox asking if you want to upload to nyaasi. * If you're not logged in or you don't have filled your api key in your profile settings: you only show the input text for the api key and not the checkbox. If someone wants to upload to nyaasi/anidex, he will just need to fill the input. * This adds back the support of anonymous upload when logged in or not. This works simply by checking if the user wants to upload as anon (when he checks the checkbox "upload as anonymous") or by checking the emptyness of apikey. + reverts the condition statements since it was needed to have apikey empty * Forgot to save this file * This commit adds the go routines for each upload service (anidex, nyaasi, tosho). New controller and url to check the upload status (/upload/status/:id). If you add ?json at the end, it outputs a json format of the multi upload status. To prevent memory overload, we only keep in memory the multiupload status for 5 minutes. Moved multipleform struct from templates to upload utils. * fix form display on classic theme * This commit adds: * Javascript refreshing of the upload status * Localization of the pages * Fixed some bugs This works, only need to get torrent file now. * Added a new function to get the Path to the torrent file. * Added a function to check that a torrent file exists and if not generate it on multiupload * Enabled file upload through http post request to anidex * Fixed bugs * Modified the behaviour to generate torrent preivously. It is a synchrone function now. So we need to make it asynchronous in download.go Now torrents file are always generated at upload time in a background processus with the correct trackers (needed ones + the ones provided by the user). I made the anidex tracker as a needed one to allow multiupload even if the user hasn't included in his torrent file/magnet url. * Moving deadtrackers list to default config Support torrent file creation when upload without scraping * Fix possible bug where no one is seeding a torrent yet (first time upload) Add primary tracker in torrent file * Fixing issue with boolean pointer for private torrent * fixing index out of range for announcelist filtering Fixing anidex tracker not found * Fixing lang id error * Anidex upload works * Fix for multiupload with magnet * This adds TokyoTosho support. Since TokyoTosho API only support upload by URL (and not torrent file upload). We need to make the download url available without ddos protection. Also TokyoTosho doesn't need a category select. Since it does have limited option, we can automatically convert our categories to the tokyotosho one. * Removing the folder tosho and put categories.go directly in upload package. Added category conversion for nyaasi too. Added tests on category conversion. * This should add nyaasi support. Is not tested though. * Updated defaut config with new nyaa.si behaviour? * Forgot to commit this file
2018-01-03 09:21:07 +01:00
<tr>
<td class="table-input-label">{{ T("upload_to") }} Anidex, Nyaa.si, TokyoTosho:</td>
<td class="table-input">
<details id="anidex-upload-info">
<summary class="form-input">{{ T("upload_to_other") }}</summary>
<div class="form-input">
<p>{{ T("upload_to") }} <b>Anidex</b>:</p>
<div>
<div class="checkbox-container"><input type="checkbox" value="true" name="anidex_upload" id="anidex_upload" class="form-torrent" {{if User.AnidexAPIToken != ""}}checked{{end}} /></div>
<input name="anidex_api" id="anidex_api" placeholder="Anidex API token" class="form-input" type="text" value="{{User.AnidexAPIToken}}" {{if User.AnidexAPIToken != ""}}disabled{{end}}/>
<br/>
<select class="form-input" name="anidex_form_category">
<option>{{ T("choose_category") }}</option>
<option value="1" style="background-color: #9f9;">Anime - Sub</option>
<option value="2" style="background-color: #9c9;">Anime - Raw</option>
<option value="3" style="background-color: #3f3;">Anime - Dub</option>
<option value="4" style="background-color: #9ff;">LA - Sub</option>
<option value="5" style="background-color: #9cc;">LA - Raw</option>
<option value="6" style="background-color: #ff6;">Light Novel</option>
<option value="7" style="background-color: #f9f;">Manga - Translated</option>
<option value="8" style="background-color: #c9c;">Manga - Raw</option>
<option value="9" style="background-color: #f99;">Audio - Lossy</option>
<option value="10" style="background-color: #c99;">Audio - Lossless</option>
<option value="11" style="background-color: #f66;">Video</option>
<option value="12" style="background-color: #ff9;">Games</option>
<option value="13" style="background-color: #cc9;">Applications</option>
<option value="14" style="background-color: #99c;">Pictures</option>
{{if Sukebei()}}<option value="15" style="background-color: #99f;">Adult Video</option>{{end}}
<option value="16" style="background-color: #999;">Other</option>
</select>
<select class="form-input" name="anidex_form_lang">
<option>{{ T("choose_language") }}</option>
<option value="1">English</option>
<option value="2">Japanese</option>
<option value="3">Polish</option>
<option value="4">Serbo-Croatian</option>
<option value="5">Dutch</option>
<option value="6">Italian</option>
<option value="7">Russian</option>
<option value="8">German</option>
<option value="9">Hungarian</option>
<option value="10">French</option>
<option value="11">Finnish</option>
<option value="12">Vietnamese</option>
<option value="13">Greek</option>
<option value="14">Bulgarian</option>
<option value="15">Spanish</option>
<option value="16">Portuguese (Brasil)</option>
<option value="17">Portuguese (Portugal)</option>
<option value="18">Swedish</option>
<option value="19">Arabic</option>
<option value="20">Danish</option>
<option value="21">Chinese (Simplified)</option>
<option value="22">Bengali</option>
<option value="23">Romanian</option>
<option value="24">Czech</option>
<option value="25">Mongolian</option>
<option value="26">Turkish</option>
<option value="27">Indonesian</option>
<option value="28">Korean</option>
<option value="29">Spanish (LATAM)</option>
<option value="30">Persian</option>
<option value="31">Malaysian</option>
</select>
</div>
<p>{{ T("upload_to") }} <b>Nyaa.si</b>:</p>
<div>
<div class="checkbox-container"><input type="checkbox" value="true" name="nyaasi_upload" id="nyaasi_upload" class="form-torrent"/></div>
<input name="nyaasi_username" id="nyaasi_username" placeholder="Nyaa.si Username" class="form-input up-input" type="text" value="" />
<br/>
<input name="nyaasi_password" id="nyaasi_password" placeholder="Nyaa.si Password" class="form-input up-input" type="password" value="" />
</div>
<p>{{ T("upload_to") }} <b>TokyoTosho</b>:</p>
<div>
<div class="checkbox-container"><input type="checkbox" value="true" name="tokyot_upload" id="tokyot_upload" {{if User.TokyoTAPIToken != ""}}checked{{end}} class="form-torrent"/></div>
<input name="tokyot_api" id="tokyot_api" placeholder="TokyoTosho API token" class="form-input up-input" type="text" value="{{User.TokyoTAPIToken }}" {{if User.AnidexAPIToken != ""}}disabled{{end}}/>
</div>
</div>
</details>
</td>
</tr>
<tr>
<td class="table-input-label">{{ T("torrent_tags")}}:</td>
<td class="table-input">
2017-07-24 07:03:43 +02:00
<table class="upload-tag-table">
<tbody>
<tr>
{{ range _, tag := Config.Torrents.Tags.Types}}
<td>
{{ yield tagForm(tagType=tag, acceptedTag=Form.Tags.Get(tag.Name)) }}
{{ if _ % 3 == 1 && _ == len(Config.Torrents.Tags.Types) - 1}}
</td>
<td>
<div class="form-group">
<label class="input-label" for="tag_{{Config.Torrents.Tags.Default}}">{{ T("tagtype_tags") }}</label>
<input type="text" name="tag_{{Config.Torrents.Tags.Default}}" class="form-input" id="tag_{{Config.Torrents.Tags.Default}}" value="{{ Form.Tags.Get(Config.Torrents.Tags.Default).Tag }}" />
</div>
</td>
{{ else }}
{{ if _ % 3 == 2}}
</td></tr><tr>
{{else}}
</td>
{{end}}
{{end}}
{{ if _ % 3 != 1 && _ == len(Config.Torrents.Tags.Types) - 1}}
</tr>
<tr>
<td>
<div class="form-group">
<label class="input-label" for="tag_{{Config.Torrents.Tags.Default}}">{{ T("tagtype_tags") }}</label>
<input type="text" name="tag_{{Config.Torrents.Tags.Default}}" class="form-input" id="tag_{{Config.Torrents.Tags.Default}}" value="{{ Form.Tags.Get(Config.Torrents.Tags.Default).Tag }}" />
</div>
</td>
{{end}}
{{ end }}
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
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
<div style="width: 240px">
{{yield captcha(captchaid=Form.CaptchaID)}}
</div>
{{ yield errors(name="captchaID")}}
<button type="submit" class="form-input up-btn" id="upload-button">{{ T("upload")}}</button>
2017-07-24 07:03:43 +02:00
</form>
</div>
{{end}}
{{ block footer_js()}}
<script type="text/javascript" src="/js/translation.js?v={{ Config.Version}}{{ Config.Build }}"></script>
<script type="text/javascript" src="/js/template.js?v={{ Config.Version}}{{ Config.Build }}"></script>
<script type="text/javascript" src="/js/simplemde.min.js?v={{ Config.Version}}{{ Config.Build }}"></script>
<script type="text/javascript">
document.querySelector('#upload-button').addEventListener("click", (e) => {
if(document.querySelector('.upload-form-table select[name="c"]').selectedIndex == 0)
setTimeout(function(){ window.scrollBy(0, -70) }, 1);
})
document.querySelector("input[name='magnet']").addEventListener("keyup", (e) => {
var torrentInput = document.querySelector("input[name='torrent']")
torrentInput.disabled = e.target.value != ""
if (e.target.value == "") torrentInput.classList.remove("hidden")
else torrentInput.classList.add("hidden")
try{
torrentInput.value = '';
if (torrentInput.value) {
torrentInput.type = "text";
torrentInput.type = "file";
}
}catch(e){}
})
[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
document.querySelector("input[name='anidex_api']").addEventListener("keyup", (e) => {
var Checkbox = document.querySelector("input[name='anidex_upload']")
Checkbox.disabled = e.target.value != ""
Checkbox.checked = e.target.value != ""
})
document.querySelector("input[name='nyaasi_api']").addEventListener("keyup", (e) => {
var Checkbox = document.querySelector("input[name='nyaasi_upload']")
Checkbox.disabled = e.target.value != ""
Checkbox.checked = e.target.value != ""
})
document.querySelector("input[name='tokyot_api']").addEventListener("keyup", (e) => {
var Checkbox = document.querySelector("input[name='tokyot_upload']")
Checkbox.disabled = e.target.value != ""
Checkbox.checked = e.target.value != ""
})
</script>
<script type="text/javascript">new SimpleMDE({ element: document.getElementById("desc"), spellChecker: false, showIcons: [ "strikethrough", "code", "table", "horizontal-rule" ] });</script>
{{end}}