From 7264ab0d0a016d9d791c3baec9d9e9f9f0eaf844 Mon Sep 17 00:00:00 2001 From: kilo Date: Tue, 19 Sep 2017 02:00:30 +0200 Subject: [PATCH] Small fixes (#1593) * Update torrent_file_missing.jet.html * Update en-us.all.json * Update CHANGELOG.md * Update main.css * Update upload.jet.html * Remove unused refine inputs from URL when doing a refine search * fix cookie warning not showing up --- public/css/main.css | 3 ++ public/js/main.js | 33 +++++++++++++++++++ .../errors/torrent_file_missing.jet.html | 2 +- templates/site/torrents/listing.jet.html | 2 +- templates/site/torrents/upload.jet.html | 2 +- translations/CHANGELOG.md | 2 ++ translations/en-us.all.json | 6 +--- 7 files changed, 42 insertions(+), 8 deletions(-) diff --git a/public/css/main.css b/public/css/main.css index ba25d0db..87230d19 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -1912,6 +1912,9 @@ span.tag { p.upload-rules { margin-top: 0; } +p.upload-rules a { + text-decoration: underline; +} #upload-button { width: 120px; } diff --git a/public/js/main.js b/public/js/main.js index d6dcad8c..368417fc 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -228,6 +228,39 @@ document.getElementsByClassName("form-input refine")[0].addEventListener("click" } }) +document.getElementsByClassName("form-input refine-btn")[0].addEventListener("click", function (e) { + var inputs = document.querySelectorAll(".box.refine form input") + var select = document.querySelectorAll(".box.refine form select") + + for(var i = 0; i < inputs.length; i++) + if(inputs[i].value == "") inputs[i].disabled = true; + + for(var i = 0; i < select.length; i++) + if(select[i].selectedIndex == 0) select[i].disabled = true; + + + if(document.querySelector(".box.refine form input[name='limit']").value == "50") + document.querySelector(".box.refine form input[name='limit']").disabled = true + + if(document.querySelector(".box.refine form select[name='sort']").selectedIndex == 5) + document.querySelector(".box.refine form select[name='sort']"). disabled = true; + else document.querySelector(".box.refine form select[name='sort']"). disabled = false; + + if(document.querySelector(".box.refine form select[name='order']").selectedIndex == 1) + document.querySelector(".box.refine form select[name='order']"). disabled = true; + else document.querySelector(".box.refine form select[name='order']"). disabled = false; + + if(document.querySelector(".box.refine form select[name='sizeType']").selectedIndex == 2 && + document.querySelector(".box.refine form input[name='minSize']").value == "" && + document.querySelector(".box.refine form input[name='maxSize']").value == "") + document.querySelector(".box.refine form select[name='sizeType']"). disabled = true + else document.querySelector(".box.refine form select[name='sizeType']"). disabled = false + + if(document.querySelector(".box.refine form select[name='order']").selectedIndex == 1) + document.querySelector(".box.refine form select[name='order']"). disabled = true; + else document.querySelector(".box.refine form select[name='order']"). disabled = false; +}) + function humanFileSize(bytes, si) { if (bytes == 0) return "Unknown" diff --git a/templates/errors/torrent_file_missing.jet.html b/templates/errors/torrent_file_missing.jet.html index a9065da3..6655c04d 100644 --- a/templates/errors/torrent_file_missing.jet.html +++ b/templates/errors/torrent_file_missing.jet.html @@ -3,7 +3,7 @@ {{block content_body()}}

{{ T("err_no_torrent_file")}}

- {{ if magnet != "" }} + {{ if isset(magnet) && magnet != "" }}
{{ T("magnet_link")}}
diff --git a/templates/site/torrents/listing.jet.html b/templates/site/torrents/listing.jet.html index 88c06162..c38bbfef 100644 --- a/templates/site/torrents/listing.jet.html +++ b/templates/site/torrents/listing.jet.html @@ -138,7 +138,6 @@
-{{ if !EUCookieLaw }}{{ end }} {{end}} +{{ if !EUCookieLaw }}{{ end }} {{end}} {{ block footer_js()}} diff --git a/templates/site/torrents/upload.jet.html b/templates/site/torrents/upload.jet.html index a79241f2..61320c1c 100644 --- a/templates/site/torrents/upload.jet.html +++ b/templates/site/torrents/upload.jet.html @@ -52,7 +52,7 @@ - + diff --git a/translations/CHANGELOG.md b/translations/CHANGELOG.md index 50b7cd48..ab4088f9 100644 --- a/translations/CHANGELOG.md +++ b/translations/CHANGELOG.md @@ -43,3 +43,5 @@ ## 2017/09/17 * + torrent_name * + read_rules +## 2017/09/18 +* - language_not_mandatory diff --git a/translations/en-us.all.json b/translations/en-us.all.json index ffb0dcba..dd9eda85 100644 --- a/translations/en-us.all.json +++ b/translations/en-us.all.json @@ -1354,10 +1354,6 @@ "id": "torrent_language", "translation": "Torrent language" }, - { - "id": "language_not_mandatory", - "translation": "Language is not mandatory anymore" - }, { "id": "language_en-us_name", "translation": "English" @@ -1816,7 +1812,7 @@ }, { "id": "torrent_name", - "translation": "Torrent name" + "translation": "Torrent Name" }, { "id": "torrent_name_invalid",