| |
@@ -41,23 +41,25 @@
|
| |
+ ' <a href="/user/' + data.comment_user + '"'
|
| |
+ ' class="notblue font-weight-bold">'+data.comment_user+'</a>'
|
| |
+ ' <a class="notblue" title="Permalink to this headline"'
|
| |
- + ' href="#comment-' + data.comment_id + '">'
|
| |
- + ' <span>commented seconds ago</span>'
|
| |
+ if (data.comment_id) {
|
| |
+ _data += ' href="#comment-' + data.comment_id + '"';
|
| |
+ }
|
| |
+ _data += '><span>commented seconds ago</span>'
|
| |
+ ' </a>'
|
| |
+ ' </div>';
|
| |
|
| |
- if ( data.comment_user == username && data.comment_id !== 'undefined') {
|
| |
- _data = _data
|
| |
- + ' <div class="issue_actions ml-auto">'
|
| |
- + ' <a href="/' + data.project + '/pull-request/' + data.request_id + '/comment/' + data.comment_id + '/edit"'
|
| |
- + ' class="btn btn-outline-primary border-0" data-comment="' + data.comment_id + '" data-objid="' + data.request_id + '">'
|
| |
- + ' <i class="fa fa-pencil" title="Edit comment"></i>'
|
| |
- + ' </a>'
|
| |
- + ' <button class="btn btn-outline-primary border-0" title="Remove comment" name="drop_comment" '
|
| |
- + ' value="' + data.comment_id + '" type="submit" onclick="return confirm(\'Do you really want to remove this comment?\');" >'
|
| |
- + ' <i class="fa fa-trash"></i>'
|
| |
- + ' </button>'
|
| |
- + ' </div>'
|
| |
+ if ( data.comment_user == username && data.comment_id !== undefined) {
|
| |
+ _data = _data
|
| |
+ + ' <div class="issue_actions ml-auto">'
|
| |
+ + ' <a href="/' + data.project + '/pull-request/' + data.request_id + '/comment/' + data.comment_id + '/edit"'
|
| |
+ + ' class="btn btn-outline-primary border-0" data-comment="' + data.comment_id + '" data-objid="' + data.request_id + '">'
|
| |
+ + ' <i class="fa fa-pencil" title="Edit comment"></i>'
|
| |
+ + ' </a>'
|
| |
+ + ' <button class="btn btn-outline-primary border-0" title="Remove comment" name="drop_comment" '
|
| |
+ + ' value="' + data.comment_id + '" type="submit" onclick="return confirm(\'Do you really want to remove this comment?\');" >'
|
| |
+ + ' <i class="fa fa-trash"></i>'
|
| |
+ + ' </button>'
|
| |
+ + ' </div>';
|
| |
}
|
| |
|
| |
_data = _data
|
| |
If there is no identifier (which is the case when the comment is added
using ajax rather than being received by SSE), the edit and delete
buttons on the comment won't work, so there is no point in showing them,
the users will just have to refresh the page to see them.
In addition, this commit removes the link to the comment itself, for the
same reason.
Fixes https://pagure.io/pagure/issue/4210