From e8dfeaea4aec4258acfcfee46bd9a393c0c0387a Mon Sep 17 00:00:00 2001 From: kilo Date: Sun, 5 Nov 2017 07:43:53 +0100 Subject: [PATCH] Fix report creation from report template for anonymous users & small css adjustement (#1712) * Fix report creation from report template for anonymous users * small adjustement for styling of usernames in comment * lower margin-top for comment content * Update en-us.all.json * Update CHANGELOG.md * fix torrent link button's styling getting messed up from --- controllers/report/report.go | 21 +++++++++------------ public/css/main.css | 3 +++ public/css/themes/classic.css | 4 ++++ templates/site/torrents/view.jet.html | 4 ++-- translations/CHANGELOG.md | 1 + translations/en-us.all.json | 4 ++++ 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/controllers/report/report.go b/controllers/report/report.go index c04e408a..648050c1 100644 --- a/controllers/report/report.go +++ b/controllers/report/report.go @@ -59,17 +59,14 @@ func ReportViewTorrentHandler(c *gin.Context) { id, _ := strconv.ParseInt(c.Param("id"), 10, 32) messages := msg.GetMessages(c) currentUser := router.GetUser(c) - if currentUser.ID > 0 { - torrent, err := torrents.FindByID(uint(id)) - if err != nil { - messages.Error(err) - } - captchaID := "" - if currentUser.NeedsCaptcha() { - captchaID = captcha.GetID() - } - templates.Form(c, "site/torrents/report.jet.html", Report{torrent.ID, captchaID}) - } else { - c.Status(404) + + torrent, err := torrents.FindByID(uint(id)) + if err != nil { + messages.Error(err) } + captchaID := "" + if currentUser.ID == 0 { + captchaID = captcha.GetID() + } + templates.Form(c, "site/torrents/report.jet.html", Report{torrent.ID, captchaID}) } diff --git a/public/css/main.css b/public/css/main.css index 978f5081..33734c35 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -1236,6 +1236,9 @@ html, body { max-height: 500px; } +.comment-content :first-child { + margin-top: 8px; +} .comment-content :last-child { margin-bottom: 2px; } diff --git a/public/css/themes/classic.css b/public/css/themes/classic.css index 36f6e7a6..2ed6ce65 100644 --- a/public/css/themes/classic.css +++ b/public/css/themes/classic.css @@ -337,6 +337,10 @@ span.comment-index+p { text-decoration: none; line-height: 22px; } +span.comment-user:hover { + text-decoration: none; + +} .comment-user:hover { text-decoration: underline; } diff --git a/templates/site/torrents/view.jet.html b/templates/site/torrents/view.jet.html index f807fd06..a6c37138 100644 --- a/templates/site/torrents/view.jet.html +++ b/templates/site/torrents/view.jet.html @@ -364,14 +364,14 @@ Modal.Init({ Query.Get('/download/{{Torrent.Hash}}?js_query=true', function (data) { if(typeof data.exists != "undefined" && data.exists == true) { torrentLink.innerHTML = oldDownloadHtml - torrentLink.style = torrentLink.style + "opacity: 1!important;filter: grayscale(0);" + torrentLink.style = torrentLink.style.cssText + "opacity: 1!important;filter: grayscale(0);" torrentLink.removeEventListener("click", function (e) {}); torrentLink.click(); } else { if(new Date() - firstQueryDate < 20000) setTimeout(fileCreated, 3000) else { - torrentLink.innerHTML = downloadIconHtml + "Could not generate torrent file" + torrentLink.innerHTML = downloadIconHtml + "{{T("generating_torrent_failed")}}" torrentLink.removeEventListener("click", function (e) {}); disabledLink = true } diff --git a/translations/CHANGELOG.md b/translations/CHANGELOG.md index 02a6c384..c785a6ab 100644 --- a/translations/CHANGELOG.md +++ b/translations/CHANGELOG.md @@ -90,3 +90,4 @@ * - removed: old ## 2017/11/04 * + nsfw_content +* + generating_torrent_failed diff --git a/translations/en-us.all.json b/translations/en-us.all.json index 8f72114b..3bce2abf 100644 --- a/translations/en-us.all.json +++ b/translations/en-us.all.json @@ -2183,6 +2183,10 @@ "id": "generating_torrent", "translation": "Generating torrent file..." }, + { + "id": "generating_torrent_failed", + "translation": "Could not generate torrent file" + }, { "id": "enabled", "translation": "Enabled"