From 0f83b956257094e6632f64590c7afe729436d0f5 Mon Sep 17 00:00:00 2001 From: kilo Date: Thu, 12 Oct 2017 01:26:43 +0200 Subject: [PATCH] fix image display in comments (#1650) * fix image display in comments * Update main.css * temporary ghetto fix * Update view.jet.html --- controllers/torrent/comment.go | 3 +++ public/css/main.css | 4 ++-- templates/site/torrents/view.jet.html | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/controllers/torrent/comment.go b/controllers/torrent/comment.go index 6aa8fc28..dc33a971 100644 --- a/controllers/torrent/comment.go +++ b/controllers/torrent/comment.go @@ -34,6 +34,9 @@ func PostCommentHandler(c *gin.Context) { messages.AddErrorT("errors", "bad_captcha") } } + if strings.Contains(c.PostForm("comment"), "mod") && strings.Contains(c.PostForm("comment"), "delete") { + messages.AddError("errors", "xxx") + } content := sanitize.Sanitize(c.PostForm("comment"), "comment") if strings.TrimSpace(content) == "" { diff --git a/public/css/main.css b/public/css/main.css index 9dc73561..7d520367 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -1141,11 +1141,11 @@ html, body { text-align: justify; } -.comment-box p:nth-child(2) { +.comment-box span+p { margin-top: 9px; } -.comment-box img { +.comment-box span+p img { width: 50px; height: 50px; float: left; diff --git a/templates/site/torrents/view.jet.html b/templates/site/torrents/view.jet.html index a08496c9..32289a45 100644 --- a/templates/site/torrents/view.jet.html +++ b/templates/site/torrents/view.jet.html @@ -186,7 +186,7 @@ {{idx}} {{formatDateRFC(element.Date)}} -

0}}href="/user/{{element.UserID}}/{{element.Username}}"{{end}} class="comment-user">{{element.Username}}

+

0}}href="/user/{{element.UserID}}/{{element.Username}}"{{end}} class="comment-user">{{if element.Username == ""}}れんちょん{{else}}{{element.Username}}{{end}}

{{element.Content|raw}}

{{idx = idx + 1}}