From cedbec3246f6f482c8c765252decc877dfcad280 Mon Sep 17 00:00:00 2001 From: kilo Date: Sun, 17 Sep 2017 20:30:58 +0200 Subject: [PATCH] New design for upload form (#1574) * CSS for new upload form * add torrent_name in translation * Update CHANGELOG.md * New upload form HTML, don't load kilo.js * Update upload.jet.html * Update main.css * change placeholder of torrent name input * Update upload.jet.html * remove useless function call from upload * responsive upload form * Fix description being constantly bold in upload * fix vertical align of labels in upload * upload tags inputs in table too * tag table styling & remove old upload tag styling * Update main.css * Update main.css * Update main.css * Update upload.jet.html * fix flag misalignement in upload form * Remove rules
from upload, provide temporary link to rules in faq (maybe will turn into a modal in the future?), remove useless input * bigger upload button & no margin for upload rules text * Update en-us.all.json * Update CHANGELOG.md * add ID to rules div * Update upload.jet.html --- public/css/main.css | 71 ++++- .../layouts/partials/helpers/rules.jet.html | 2 +- templates/site/torrents/upload.jet.html | 269 ++++++------------ translations/CHANGELOG.md | 3 + translations/en-us.all.json | 9 +- 5 files changed, 161 insertions(+), 193 deletions(-) diff --git a/public/css/main.css b/public/css/main.css index f3f0f269..f8a39149 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -238,6 +238,7 @@ select.form-input { .language .input-group label { margin-bottom: 1px; + vertical-align: unset; } .language .input-group input { @@ -877,6 +878,9 @@ html, body { .torrent-hr { margin-bottom: 0; } + .upload-form-table .table-torrent-link input { + width: 100%!important; + } } @media (max-height: 750px),(max-width: 500px) { @@ -903,6 +907,9 @@ html, body { .form-refine { margin-bottom: 8px; } + .upload-form-table .table-input-label { + width: 23%; + } } @media (max-width: 565px) { @@ -955,6 +962,9 @@ html, body { .refine-container-2 input[type="number"],.refine-container-2 input[type="text"] { width: 87px!important; } + .upload-form-table .table-input-label { + display: none; + } } @media (max-width: 440px) { @@ -1895,30 +1905,63 @@ span.tag { border-left: 1px solid #d8d8d8; } -.upload-tag-form h3 { - margin: 10px 0; +p.upload-rules { + margin-top: 0; } - -.upload-tag-form .form-group { - width: 167px; - display:inline-block; - margin-bottom: 5px; - margin-right: 5px; +#upload-button { + width: 120px; } - -.upload-tag-form label { - display:inline-block; - width: 100%; +.upload-form-table { + max-width: 950px; + margin: 15px 0; + margin-bottom: 0; +} +.upload-form-table .table-input-label { + width: 185px; + font-weight: bold; + padding-top: 3px!important; +} +.upload-form-table .table-input-label, .upload-form-table td label{ + vertical-align: top; +} +.upload-form-table .upload-form-table .CodeMirror { + font-weight: normal; +} +.upload-form-table .table-input { + font-weight: bold; +} +.upload-form-table .table-checkboxes td { + padding: 3px 0; +} +.upload-form-table .table-torrent-link input[type="file"] { + width: 35%; +} +.upload-form-table .table-torrent-link input[type="text"] { + width: 65%; +} +#tag-h3 { + margin: 0 0 7px; +} +.upload-tag-table { + width: auto; +} +.upload-tag-table .input-label { + display: block; font-size: unset; margin-bottom: 1px; } - -.upload-tag-form input,.upload-tag-form select { +.upload-tag-table input, .upload-tag-table select { height: 25px; padding: 3px 3px; width: 100%; } +.upload-tag-table td { + padding-right: 7px; +} +.upload-tag-form h3 { + margin: 10px 0; +} .show-xs { display: none; diff --git a/templates/layouts/partials/helpers/rules.jet.html b/templates/layouts/partials/helpers/rules.jet.html index 733b6ccf..28645768 100644 --- a/templates/layouts/partials/helpers/rules.jet.html +++ b/templates/layouts/partials/helpers/rules.jet.html @@ -1,5 +1,5 @@ {{ block ruleList(open=false)}} -
+
{{ T("rules")}}
    diff --git a/templates/site/torrents/upload.jet.html b/templates/site/torrents/upload.jet.html index 65725589..e9b012a9 100644 --- a/templates/site/torrents/upload.jet.html +++ b/templates/site/torrents/upload.jet.html @@ -7,201 +7,116 @@ {{block title()}}{{ T("upload")}}{{end}} {{block content_body()}}
    - {{ yield ruleList() }} +

    {{ T("read_rules")|raw }}

    {{ yield csrf_field() }} -

    {{ T("name")}}

    - - {{ yield errors(name="name")}} + +
    + {{ 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")}} +
    - + + + + + {{ range _, tag := Config.Torrents.Tags.Types}} + + + {{ else }} + {{ if _ % 3 == 2}} + + {{else}} + + {{end}} + {{end}} + {{ if _ % 3 != 1 && _ == len(Config.Torrents.Tags.Types) - 1}} + + + + {{end}} + {{ end }} + + +

    {{ T("torrent_tags")}}

    + {{ yield tagForm(tagType=tag, acceptedTag=Form.Tags.Get(tag.Name)) }} + {{ if _ % 3 == 1 && _ == len(Config.Torrents.Tags.Types) - 1}} + +
    + + +
    +
    +
    + + +
    +
    -

    {{ T("torrent_file")}}

    - -

    {{ T("uploading_file_prefills_fields")}}

    - {{ yield errors(name="torrent")}} - -

    {{ T("magnet_link")}}

    - -

    {{ T("please_include_our_tracker") }}

    - {{ yield errors(name="magnet")}} - -

    {{ T("category")}}

    - - {{ yield errors(name="c")}} - -

    {{ T("torrent_language") }}

    -
    - {{ yield flagList(languages=GetTorrentLanguages(), selected=Form.Languages, inputname="languages", id="upload-lang")}} -
    -

    {{ T("language_not_mandatory") }}

    - -

    - - -

    - {{ yield errors(name="remake")}} - - {{ if User.ID > 0 }} -

    - - -

    - {{ yield errors(name="hidden")}} - {{ end }} - -

    {{ T("website_link")}}

    - - {{ yield errors(name="website_link")}} - -

    {{ T("torrent_description")}}

    -

    {{ T("description_markdown_notice")}}

    - - -
    -

    {{ T("torrent_tags")}}

    - {{ range Config.Torrents.Tags.Types }} - {{ yield tagForm(tagType=., acceptedTag=Form.Tags.Get(.Name)) }} - {{ end }} -
    - - -
    - {{ yield errors(name="tags")}} -
    {{yield captcha(captchaid=Form.CaptchaID)}}
    - {{ yield errors(name="captchaID")}} - +
    {{end}} {{ block footer_js()}} - {{ include "layouts/partials/torrent_item_upload" }}