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
Cette révision appartient à :
Parent
cc4e0fe5c0
révision
e8dfeaea4a
|
@ -59,17 +59,14 @@ func ReportViewTorrentHandler(c *gin.Context) {
|
||||||
id, _ := strconv.ParseInt(c.Param("id"), 10, 32)
|
id, _ := strconv.ParseInt(c.Param("id"), 10, 32)
|
||||||
messages := msg.GetMessages(c)
|
messages := msg.GetMessages(c)
|
||||||
currentUser := router.GetUser(c)
|
currentUser := router.GetUser(c)
|
||||||
if currentUser.ID > 0 {
|
|
||||||
torrent, err := torrents.FindByID(uint(id))
|
torrent, err := torrents.FindByID(uint(id))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
messages.Error(err)
|
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)
|
|
||||||
}
|
}
|
||||||
|
captchaID := ""
|
||||||
|
if currentUser.ID == 0 {
|
||||||
|
captchaID = captcha.GetID()
|
||||||
|
}
|
||||||
|
templates.Form(c, "site/torrents/report.jet.html", Report{torrent.ID, captchaID})
|
||||||
}
|
}
|
||||||
|
|
|
@ -1236,6 +1236,9 @@ html, body {
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.comment-content :first-child {
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
.comment-content :last-child {
|
.comment-content :last-child {
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,6 +337,10 @@ span.comment-index+p {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
|
span.comment-user:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
}
|
||||||
.comment-user:hover {
|
.comment-user:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
|
@ -364,14 +364,14 @@ Modal.Init({
|
||||||
Query.Get('/download/{{Torrent.Hash}}?js_query=true', function (data) {
|
Query.Get('/download/{{Torrent.Hash}}?js_query=true', function (data) {
|
||||||
if(typeof data.exists != "undefined" && data.exists == true) {
|
if(typeof data.exists != "undefined" && data.exists == true) {
|
||||||
torrentLink.innerHTML = oldDownloadHtml
|
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.removeEventListener("click", function (e) {});
|
||||||
torrentLink.click();
|
torrentLink.click();
|
||||||
} else {
|
} else {
|
||||||
if(new Date() - firstQueryDate < 20000)
|
if(new Date() - firstQueryDate < 20000)
|
||||||
setTimeout(fileCreated, 3000)
|
setTimeout(fileCreated, 3000)
|
||||||
else {
|
else {
|
||||||
torrentLink.innerHTML = downloadIconHtml + "Could not generate torrent file"
|
torrentLink.innerHTML = downloadIconHtml + "{{T("generating_torrent_failed")}}"
|
||||||
torrentLink.removeEventListener("click", function (e) {});
|
torrentLink.removeEventListener("click", function (e) {});
|
||||||
disabledLink = true
|
disabledLink = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,3 +90,4 @@
|
||||||
* - removed: old
|
* - removed: old
|
||||||
## 2017/11/04
|
## 2017/11/04
|
||||||
* + nsfw_content
|
* + nsfw_content
|
||||||
|
* + generating_torrent_failed
|
||||||
|
|
|
@ -2183,6 +2183,10 @@
|
||||||
"id": "generating_torrent",
|
"id": "generating_torrent",
|
||||||
"translation": "Generating torrent file..."
|
"translation": "Generating torrent file..."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "generating_torrent_failed",
|
||||||
|
"translation": "Could not generate torrent file"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "enabled",
|
"id": "enabled",
|
||||||
"translation": "Enabled"
|
"translation": "Enabled"
|
||||||
|
|
Référencer dans un nouveau ticket