|
1 | | -@(content: String, commentId: Int, userName: String, repoName: String)(implicit context: gitbucket.core.controller.Context) |
| 1 | +@(gist: gitbucket.gist.model.Gist, content: String, commentId: Int)(implicit context: gitbucket.core.controller.Context) |
2 | 2 | <span id="error-edit-content-@commentId" class="error"></span> |
3 | | -<textarea class="form-control" style="height: 100px;" id="edit-content-@commentId">@content</textarea> |
4 | | -<div style="margin-top: 6px;"> |
5 | | - <input type="button" id="cancel-comment-@commentId" class="btn btn-danger" value="Cancel"/> |
6 | | - <input type="button" id="update-comment-@commentId" class="btn btn-default pull-right" value="Update comment"/> |
| 3 | +@gitbucket.gist.html.commentpreview( |
| 4 | + gist = gist, |
| 5 | + content = content, |
| 6 | + style = "height: 100px; max-height: 150px;", |
| 7 | + elastic = true, |
| 8 | + uid = commentId |
| 9 | +) |
| 10 | +<div style="margin-top: 6px;" class="text-right"> |
| 11 | + <input type="button" id="cancel-comment-@commentId" class="btn btn-default" value="Cancel"/> |
| 12 | + <input type="button" id="update-comment-@commentId" class="btn btn-success" value="Update comment"/> |
7 | 13 | </div> |
8 | 14 | <script> |
9 | 15 | $(function(){ |
|
16 | 22 | $('#update-comment-@commentId').click(function(){ |
17 | 23 | $('#update-comment-@commentId, #cancel-comment-@commentId').attr('disabled', 'disabled'); |
18 | 24 | $.ajax({ |
19 | | - url: '@context.path/gist/@userName/@repoName/_comments/@commentId/_update', |
| 25 | + url: '@context.path/gist/@gist.userName/@gist.repositoryName/_comments/@commentId/_update', |
20 | 26 | type: 'POST', |
21 | 27 | data: { |
22 | 28 | issueId : 0, // TODO |
23 | | - content : $('#edit-content-@commentId').val() |
| 29 | + content : $('#content@commentId').val() |
24 | 30 | } |
25 | 31 | }).done( |
26 | 32 | callback |
|
32 | 38 |
|
33 | 39 | $('#cancel-comment-@commentId').click(function(){ |
34 | 40 | $('#update-comment-@commentId, #cancel-comment-@commentId').attr('disabled', 'disabled'); |
35 | | - $.get('@context.path/gist/@userName/@repoName/_comments/@commentId', callback); |
| 41 | + $.get('@context.path/gist/@gist.userName/@gist.repositoryName/_comments/@commentId', callback); |
36 | 42 | return false; |
37 | 43 | }); |
38 | 44 | }); |
|
0 commit comments