summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-04-20 17:37:54 +0200
committerMax Magorsch <arzano@gentoo.org>2020-04-20 17:37:54 +0200
commit88e5cdaec4ae8079637aa980386c745ce82e2aa4 (patch)
tree3371b92fce63e429f546618139bd4f48dad45ad9
parentCorrectly sort the comments (diff)
downloadglsamaker-88e5cdaec4ae8079637aa980386c745ce82e2aa4.tar.gz
glsamaker-88e5cdaec4ae8079637aa980386c745ce82e2aa4.tar.bz2
glsamaker-88e5cdaec4ae8079637aa980386c745ce82e2aa4.zip
Correctly display multi-line comments
Signed-off-by: Max Magorsch <arzano@gentoo.org>
-rw-r--r--web/packs/src/javascript/cvetool.js4
-rw-r--r--web/templates/glsa/edit.tmpl5
-rw-r--r--web/templates/glsa/show.tmpl5
3 files changed, 4 insertions, 10 deletions
diff --git a/web/packs/src/javascript/cvetool.js b/web/packs/src/javascript/cvetool.js
index b43e806..b9a8272 100644
--- a/web/packs/src/javascript/cvetool.js
+++ b/web/packs/src/javascript/cvetool.js
@@ -229,7 +229,7 @@ function format ( d ) {
commentsObjects.forEach(function (comment, index) {
if(comment.Message != "") {
var commentDate = '<small class="text-muted">' + comment.Date.split("T")[0] + ' ' + comment.Date.split("T")[1].split(".")[0] + ' UTC</small>';
- comments = comments + '<div class="col-3 text-right mb-3"><b>' + comment.User.Name + '</b><br/>' + commentDate + '</div><div class="col-9 mb-3"><div class="card" style="background: none;"><div class="card-body">' + escape(comment.Message) + '</div></div></div>';
+ comments = comments + '<div class="col-3 text-right mb-3"><b>' + comment.User.Name + '</b><br/>' + commentDate + '</div><div class="col-9 mb-3"><div class="card" style="background: none;"><div class="card-body" style="white-space: pre-wrap;">' + comment.Message + '</div></div></div>';
}
});
}
@@ -454,7 +454,7 @@ function changeState(cveid, reason, newState){
// add comment
var comment = JSON.parse(data);
var commentDate = '<small class="text-muted">' + comment.Date.split("T")[0] + ' ' + comment.Date.split("T")[1].split(".")[0] + ' UTC</small>';
- var newComment = '<div class="col-3 text-right mb-3"><b>' + comment.User + '</b><br/>' + commentDate + '</div><div class="col-9 mb-3"><div class="card" style="background: none;"><div class="card-body">' + escape(comment.Message) + '</div></div></div>';
+ var newComment = '<div class="col-3 text-right mb-3"><b>' + comment.User + '</b><br/>' + commentDate + '</div><div class="col-9 mb-3"><div class="card" style="background: none;"><div class="card-body" style="white-space: pre-wrap;">' + comment.Message + '</div></div></div>';
$('.comments-section[data-cveid="' + cveid + '"]').append(newComment);
}
diff --git a/web/templates/glsa/edit.tmpl b/web/templates/glsa/edit.tmpl
index eed5c44..dcd6ed3 100644
--- a/web/templates/glsa/edit.tmpl
+++ b/web/templates/glsa/edit.tmpl
@@ -706,10 +706,7 @@
</div>
</div>
- <div class="card-body">
- {{if eq .Type "approve"}}<b class="mr-2">Approved: </b>{{else if eq .Type "decline"}}<b class="mr-2">Declined: </b>{{end}}
- {{.Message}}
- </div>
+ <div class="card-body" style="white-space: pre-wrap;">{{if eq .Type "approve"}}<b class="mr-2">Approved: </b>{{else if eq .Type "decline"}}<b class="mr-2">Declined: </b>{{end}} {{.Message}}</div>
</div>
</div>
diff --git a/web/templates/glsa/show.tmpl b/web/templates/glsa/show.tmpl
index a07d471..161aa25 100644
--- a/web/templates/glsa/show.tmpl
+++ b/web/templates/glsa/show.tmpl
@@ -439,10 +439,7 @@
</div>
</div>
- <div class="card-body">
- {{if eq .Type "approve"}}<b class="mr-2">Approved: </b>{{else if eq .Type "decline"}}<b class="mr-2">Declined: </b>{{end}}
- {{.Message}}
- </div>
+ <div class="card-body" style="white-space: pre-wrap;">{{if eq .Type "approve"}}<b class="mr-2">Approved: </b>{{else if eq .Type "decline"}}<b class="mr-2">Declined: </b>{{end}} {{.Message}}</div>
</div>
</div>