|
2 | 2 | comments: Seq[gitbucket.gist.model.GistComment], |
3 | 3 | hasWritePermission: Boolean, |
4 | 4 | repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context) |
5 | | -@import context._ |
6 | | -@import gitbucket.core.view.helpers._ |
| 5 | +@import gitbucket.core.view.helpers |
7 | 6 | @comments.map { comment => |
8 | | - <div class="issue-avatar-image">@avatar(comment.commentedUserName, 48)</div> |
| 7 | + <div class="issue-avatar-image">@helpers.avatar(comment.commentedUserName, 48)</div> |
9 | 8 | <div class="panel panel-default issue-comment-box" id="comment-@comment.commentId"> |
10 | 9 | <div class="panel-heading"> |
11 | | - @user(comment.commentedUserName, styleClass="username strong") |
| 10 | + @helpers.user(comment.commentedUserName, styleClass="username strong") |
12 | 11 | <span class="muted"> |
13 | 12 | commented |
14 | 13 | @gitbucket.core.helper.html.datetimeago(comment.registeredDate) |
15 | 14 | </span> |
16 | 15 | <span class="pull-right"> |
17 | | - @if((hasWritePermission || loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false))){ |
| 16 | + @if((hasWritePermission || context.loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false))){ |
18 | 17 | <a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-pencil" aria-label="Edit"></i></a> |
19 | 18 | <a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-x" aria-label="Remove"></i></a> |
20 | 19 | } |
21 | 20 | </span> |
22 | 21 | </div> |
23 | 22 | <div class="panel-body issue-content markdown-body" id="commentContent-@comment.commentId"> |
24 | | - @markdown(comment.content, repository, false, true, true, hasWritePermission) |
| 23 | + @helpers.markdown(comment.content, repository, false, true, true, hasWritePermission) |
25 | 24 | </div> |
26 | 25 | </div> |
27 | 26 | } |
28 | 27 | <script> |
29 | 28 | $(function(){ |
30 | 29 | $('.issue-comment-box i.octicon-pencil').click(function(){ |
31 | 30 | var id = $(this).closest('a').data('comment-id'); |
32 | | - var url = '@path/gist/@gist.userName/@gist.repositoryName/_comments/' + id; |
| 31 | + var url = '@context.path/gist/@gist.userName/@gist.repositoryName/_comments/' + id; |
33 | 32 | var $content = $('#commentContent-' + id); |
34 | 33 |
|
35 | 34 | if(!id){ |
36 | 35 | id = $(this).closest('a').data('issue-id'); |
37 | | - url = '@url(repository)/issues/_data/' + id; |
| 36 | + url = '@helpers.url(repository)/issues/_data/' + id; |
38 | 37 | $content = $('#issueContent'); |
39 | 38 | } |
40 | 39 |
|
|
46 | 45 | $('.issue-comment-box i.octicon-x').click(function(){ |
47 | 46 | if(confirm('Are you sure you want to delete this?')) { |
48 | 47 | var id = $(this).closest('a').data('comment-id'); |
49 | | - $.post('@path/gist/@gist.userName/@gist.repositoryName/_comments/' + id + '/_delete', |
| 48 | + $.post('@context.path/gist/@gist.userName/@gist.repositoryName/_comments/' + id + '/_delete', |
50 | 49 | function(data){ |
51 | 50 | if(data > 0) { |
52 | 51 | $('#comment-' + id).prev('div.issue-avatar-image').remove(); |
|
58 | 57 | }); |
59 | 58 | $(document).on('click', '.commit-comment-box i.icon-pencil', function(){ |
60 | 59 | var id = $(this).closest('a').data('comment-id'); |
61 | | - var url = '@path/gist/@gist.userName/@gist.repositoryName/_comments/' + id; |
| 60 | + var url = '@context.path/gist/@gist.userName/@gist.repositoryName/_comments/' + id; |
62 | 61 | var $content = $('.commit-commentContent-' + id, $(this).closest('.box')); |
63 | 62 |
|
64 | 63 | $.get(url, { dataType : 'html' }, function(data){ |
|
69 | 68 | $(document).on('click', '.commit-comment-box i.icon-remove-circle', function(){ |
70 | 69 | if(confirm('Are you sure you want to delete this?')) { |
71 | 70 | var id = $(this).closest('a').data('comment-id'); |
72 | | - $.post('@path/gist/@gist.userName/@gist.repositoryName/_comments/' + id + '/_delete', |
| 71 | + $.post('@context.path/gist/@gist.userName/@gist.repositoryName/_comments/' + id + '/_delete', |
73 | 72 | function(data){ |
74 | 73 | if(data > 0) { |
75 | 74 | $('.commit-comment-' + id).closest('.not-diff').remove(); |
|
0 commit comments