diff --git a/pagure/static/request_ev.js b/pagure/static/request_ev.js index ff96c30..fc2631d 100644 --- a/pagure/static/request_ev.js +++ b/pagure/static/request_ev.js @@ -18,111 +18,94 @@ add_comment = function(data, username) { } if (data.notification){ - var _data = '
\ -
\ -
\ -
\ - \ - Just now
\ -
\ - ' + emojione.toImage(data.comment_added) + '\ -
\ -
'; + var _data = '
' + +'
' + + '' + +'
' + +'' + + data.comment_added + +'' + +'
' + + '' + + 'seconds ago' + +'
' + +'
' - } else if (inline) { - var _data = ' \ - \ -
\ -
\ - \ -
\ -
\ - ' + emojione.toImage(data.comment_added) + ' \ -
\ -
\ -
\ - \ -
\ - '; } else { var _csrf = $('#csrf_token').clone(); var _data = '
\ -
\ - \ -
\ -
\ -
\ - \ - ' - + emojione.toImage(data.comment_added) + '\ -
\ -
\ -
\ -
\ -
'; - if (data.comment_id) { - _data += '\ - \ - \ - '; - } - if ( data.comment_user == username && data.comment_id) { - _data += edit_btn + - ''; - } - _data += '
\ -
\ -
\ - \ - '; + + '/comment/drop" method="post" onsubmit="return try_async_comment(this, null)">' + + '
' + + '
' + + ' ' + + '
' + + '
' + + '
' + + ' ' + + ' ' + + ' '; + if ( data.comment_user == username) { + + _data = _data+ '' + + ' ' + + ' ' + + ' ' + } + + _data = _data + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + ' ' + + ' ' + + ' ' + + emojione.toImage(data.comment_added) + + ' ' + + '
' + + '
' + + '
' + + ' ' + + '
' + + '' + + '' + } if (inline){ // Inline comment console.log('Inline'); + + //add comment to files changed tab var field = $('[data-commit="' + data.commit_id + '"]').parent(); var id = field.children().children().attr('id').split('_')[0]; var row = $('#' + id + '_' + (parseInt(data.line) + 1)).parent().parent(); - row.before(_data); + row.after(''+_data+''); + console.log(row); + + //add comment to comments tab + var cfield = $('#request_comment'); + cfield.html(cfield.html() + _data); + } else { // Generic comment console.log('generic'); diff --git a/pagure/templates/_formhelper.html b/pagure/templates/_formhelper.html index 9927051..4afdb6c 100644 --- a/pagure/templates/_formhelper.html +++ b/pagure/templates/_formhelper.html @@ -107,7 +107,7 @@ {% endmacro %} -{% macro show_comment(comment, id, repo, username, issueid, form) %} +{% macro show_comment(comment, id, repo, username, issueid, form, PRinline=False) %}
@@ -121,7 +121,13 @@ href="#comment-{{ id }}"> commented {{ comment.date_created | humanize}} + }}">commented + {% if PRinline %} + on {{ + comment.line }} of {{ comment.filename }} + {% endif %} + {{ comment.date_created | humanize}}
diff --git a/pagure/templates/repo_pull_request.html b/pagure/templates/repo_pull_request.html index ae882d1..ade3190 100644 --- a/pagure/templates/repo_pull_request.html +++ b/pagure/templates/repo_pull_request.html @@ -366,23 +366,8 @@ {% for comment in pull_request.comments %} {% if comment.commit_id %} -
-
-
- {{ comment.user.user }} commented on line - {{ - comment.line }} of {{ comment.filename }}. -
- {{ - comment.date_created | humanize }}
-
- (Hide) -
- {{ comment.comment }} -
-
-
+ {{ show_comment(comment, comment.id, repo, username, + requestid, form, PRinline=True) }} {% elif comment.notification %}
diff --git a/pagure/ui/filters.py b/pagure/ui/filters.py index 01df37f..33bb6d6 100644 --- a/pagure/ui/filters.py +++ b/pagure/ui/filters.py @@ -171,14 +171,15 @@ def format_loc(loc, commit=None, filename=None, tree_id=None, prequest=None, output.append('') tpl_edit = '' \ '' \ '' tpl_edited = ' ' \ 'Edited %(human_edit_date)s by %(user)s ' - tpl_delete = '