From f40235d0a3cbea8cca0b1e2de8df9436ce24685a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 22 2016 08:48:30 +0000 Subject: Add the possibility to see inline comment in the main comments section of the PRs This will allow having always access to the comment even once it has been addressed and the file has been updated. --- diff --git a/pagure/static/pagure.css b/pagure/static/pagure.css index b34d36c..8ad1ded 100644 --- a/pagure/static/pagure.css +++ b/pagure/static/pagure.css @@ -449,3 +449,14 @@ pre.softwrap white-space: pre-wrap; word-wrap: break-word; } + +.inline-comments { + padding: 1rem 1rem; + background-color: white; + text-indent:4px; + border-radius: 0.25rem 0.25rem 0 0; +} + +.inline-btn { + cursor: pointer; +} diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 2b4f225..8b9eb05 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -323,12 +323,17 @@
{{comment.user.user}} commented on line - {{ - comment.line}} of {{comment.filename}} + {{ + comment.line}} of {{comment.filename}}.
{{ comment.date_created | humanize}}
+ (Show) +
+ {{ comment.comment }} +
{% elif comment.notification %} @@ -603,6 +608,17 @@ function setup_reply_btns() { $(document).ready(function() { + $(".inline-comments").hide(); + $( ".inline-btn" ).click(function() { + var msgid = $( this ).attr('data-id'); + if ($( this ).html() == 'Show') { + $( this ).html('Hide'); + } else { + $( this ).html('Show'); + } + $( '#inline-comment-' + msgid).toggle(); + }); + $( ".commit_msg_txt" ).hide(); $( ".commit_msg_btn" ).click(function() { var msgid = $( this ).attr('data-id');