From 771793f32e006a144caef53310352520e9397b23 Mon Sep 17 00:00:00 2001 From: Maximilian Grundke Date: Thu, 24 Aug 2017 11:48:26 +0200 Subject: [PATCH] Show edit and delete buttons for comments that can be edited by the user --- .../stylesheets/request-for-comments.css.scss | 15 ++++++++++++++- app/views/request_for_comments/show.html.erb | 10 ++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/request-for-comments.css.scss b/app/assets/stylesheets/request-for-comments.css.scss index c5749ed8..71f7a34a 100644 --- a/app/assets/stylesheets/request-for-comments.css.scss +++ b/app/assets/stylesheets/request-for-comments.css.scss @@ -65,9 +65,13 @@ p.comment { margin-bottom: 10px; } +.popover-action-button { + display: none; +} + #otherComments { h5 { - margin-top: 0px; + margin-top: 0; } .container { @@ -75,6 +79,15 @@ p.comment { max-height: 200px; overflow-y: auto; border: 1px solid #cccccc; + + .popover-actions { + display: flex; + + .popover-action-button { + display: block; + margin-right: 5px; + } + } } } diff --git a/app/views/request_for_comments/show.html.erb b/app/views/request_for_comments/show.html.erb index b93f7594..88f4181b 100644 --- a/app/views/request_for_comments/show.html.erb +++ b/app/views/request_for_comments/show.html.erb @@ -193,8 +193,14 @@ also, all settings from the rails model needed for the editor configuration in t '<%= t('request_for_comments.comment_edited') %>' + '' } - htmlContent += ''; - htmlContent += '
' + preprocess(comment.text) + '
'; + htmlContent += '' + + '
' + preprocess(comment.text) + '
'; + if (comment.editable) { + htmlContent += '
' + + '' + + '' + + '
'; + } htmlContent += '

'; }); return htmlContent;