Skip to content

Commit e3bac82

Browse files
committed
Fix import to resolve errors in IntelliJ
1 parent 5f1d64f commit e3bac82

12 files changed

+76
-91
lines changed

src/main/twirl/gitbucket/gist/commentedit.scala.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@(content: String, commentId: Int, userName: String, repoName: String)(implicit context: gitbucket.core.controller.Context)
2-
@import context._
32
<span id="error-edit-content-@commentId" class="error"></span>
43
<textarea class="form-control" style="height: 100px;" id="edit-content-@commentId">@content</textarea>
54
<div style="margin-top: 6px;">
@@ -17,7 +16,7 @@
1716
$('#update-comment-@commentId').click(function(){
1817
$('#update-comment-@commentId, #cancel-comment-@commentId').attr('disabled', 'disabled');
1918
$.ajax({
20-
url: '@path/gist/@userName/@repoName/_comments/@commentId/_update',
19+
url: '@context.path/gist/@userName/@repoName/_comments/@commentId/_update',
2120
type: 'POST',
2221
data: {
2322
issueId : 0, // TODO
@@ -33,7 +32,7 @@
3332

3433
$('#cancel-comment-@commentId').click(function(){
3534
$('#update-comment-@commentId, #cancel-comment-@commentId').attr('disabled', 'disabled');
36-
$.get('@path/gist/@userName/@repoName/_comments/@commentId', callback);
35+
$.get('@context.path/gist/@userName/@repoName/_comments/@commentId', callback);
3736
return false;
3837
});
3938
});

src/main/twirl/gitbucket/gist/commentform.scala.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
@(gist: gitbucket.gist.model.Gist)(implicit context: gitbucket.core.controller.Context)
2-
@import context._
3-
@import gitbucket.core.view.helpers._
4-
@if(loginAccount.isDefined){
2+
@import gitbucket.core.view.helpers
3+
@if(context.loginAccount.isDefined){
54
<hr/><br/>
6-
<form method="POST" validate="true" action="@path/gist/@gist.userName/@gist.repositoryName/_comment">
7-
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
5+
<form method="POST" validate="true" action="@context.path/gist/@gist.userName/@gist.repositoryName/_comment">
6+
<div class="issue-avatar-image">@helpers.avatar(context.loginAccount.get.userName, 48)</div>
87
<div class="panel panel-default issue-comment-box">
98
<div class="panel-body">
109
@gitbucket.gist.html.commentpreview(

src/main/twirl/gitbucket/gist/commentlist.scala.html

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,38 @@
22
comments: Seq[gitbucket.gist.model.GistComment],
33
hasWritePermission: Boolean,
44
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
76
@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>
98
<div class="panel panel-default issue-comment-box" id="[email protected]">
109
<div class="panel-heading">
11-
@user(comment.commentedUserName, styleClass="username strong")
10+
@helpers.user(comment.commentedUserName, styleClass="username strong")
1211
<span class="muted">
1312
commented
1413
@gitbucket.core.helper.html.datetimeago(comment.registeredDate)
1514
</span>
1615
<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))){
1817
<a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-pencil" aria-label="Edit"></i></a>&nbsp;
1918
<a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-x" aria-label="Remove"></i></a>
2019
}
2120
</span>
2221
</div>
2322
<div class="panel-body issue-content markdown-body" id="[email protected]">
24-
@markdown(comment.content, repository, false, true, true, hasWritePermission)
23+
@helpers.markdown(comment.content, repository, false, true, true, hasWritePermission)
2524
</div>
2625
</div>
2726
}
2827
<script>
2928
$(function(){
3029
$('.issue-comment-box i.octicon-pencil').click(function(){
3130
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;
3332
var $content = $('#commentContent-' + id);
3433

3534
if(!id){
3635
id = $(this).closest('a').data('issue-id');
37-
url = '@url(repository)/issues/_data/' + id;
36+
url = '@helpers.url(repository)/issues/_data/' + id;
3837
$content = $('#issueContent');
3938
}
4039

@@ -46,7 +45,7 @@
4645
$('.issue-comment-box i.octicon-x').click(function(){
4746
if(confirm('Are you sure you want to delete this?')) {
4847
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',
5049
function(data){
5150
if(data > 0) {
5251
$('#comment-' + id).prev('div.issue-avatar-image').remove();
@@ -58,7 +57,7 @@
5857
});
5958
$(document).on('click', '.commit-comment-box i.icon-pencil', function(){
6059
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;
6261
var $content = $('.commit-commentContent-' + id, $(this).closest('.box'));
6362

6463
$.get(url, { dataType : 'html' }, function(data){
@@ -69,7 +68,7 @@
6968
$(document).on('click', '.commit-comment-box i.icon-remove-circle', function(){
7069
if(confirm('Are you sure you want to delete this?')) {
7170
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',
7372
function(data){
7473
if(data > 0) {
7574
$('.commit-comment-' + id).closest('.not-diff').remove();

src/main/twirl/gitbucket/gist/commentpreview.scala.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
style: String = "",
55
elastic: Boolean = false,
66
uid: Long = new java.util.Date().getTime())(implicit context: gitbucket.core.controller.Context)
7-
@import context._
8-
@import gitbucket.core._
9-
@import gitbucket.core.view.helpers._
7+
@import gitbucket.core.view.helpers
108
<div class="tabbable">
119
<ul class="nav nav-tabs fill-width" style="margin-bottom: 10px;">
1210
<li class="active"><a href="#tab@uid" data-toggle="tab">Write</a></li>
@@ -30,8 +28,8 @@
3028
}
3129

3230
$('#preview@uid').click(function(){
33-
$('#preview-area@uid').html('<img src="@assets/common/images/indicator.gif"> Previewing...');
34-
$.post('@path/gist/@gist.userName/@gist.repositoryName/_preview', {
31+
$('#preview-area@uid').html('<img src="@helpers.assets/common/images/indicator.gif"> Previewing...');
32+
$.post('@context.path/gist/@gist.userName/@gist.repositoryName/_preview', {
3533
content : $('#content@uid').val()
3634
}, function(data){
3735
$('#preview-area@uid').html(data);

src/main/twirl/gitbucket/gist/detail.scala.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
files: Seq[(String, String)],
66
comments: Seq[gitbucket.gist.model.GistComment],
77
editable: Boolean)(implicit context: gitbucket.core.controller.Context)
8-
@import context._
9-
@import gitbucket.core.view.helpers._
8+
@import gitbucket.core.view.helpers
109
@gitbucket.core.html.main(if(gist.description.isEmpty) gist.repositoryName else gist.description){
1110
@gitbucket.gist.html.style()
1211
@gitbucket.gist.html.header(gist, forkedCount, editable)
@@ -21,12 +20,12 @@
2120
<div class="panel-heading strong" style="padding: 6px; line-height: 30px;">
2221
@fileName
2322
<div class="pull-right">
24-
<a href="@path/gist/@gist.userName/@gist.repositoryName/raw/@revision/@fileName" class="btn btn-sm btn-default">Raw</a>
23+
<a href="@context.path/gist/@gist.userName/@gist.repositoryName/raw/@revision/@fileName" class="btn btn-sm btn-default">Raw</a>
2524
</div>
2625
</div>
27-
@if(isRenderable(fileName)){
26+
@if(helpers.isRenderable(fileName)){
2827
<div class="panel-body markdown-body" style="padding-left: 16px; padding-right: 16px;">
29-
@renderMarkup(List(fileName), content, "master", gist.toRepositoryInfo, false, false, true)
28+
@helpers.renderMarkup(List(fileName), content, "master", gist.toRepositoryInfo, false, false, true)
3029
</div>
3130
} else {
3231
<div class="panel-body">

src/main/twirl/gitbucket/gist/edit.scala.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
@(gist: Option[gitbucket.gist.model.Gist],
22
files: Seq[(String, gitbucket.core.util.JGitUtil.ContentInfo)])(implicit context: gitbucket.core.controller.Context)
3-
@import context._
43
@import gitbucket.gist.model.Mode
5-
@import gitbucket.core.view.helpers._
4+
@import gitbucket.core.view.helpers
65
@gitbucket.core.html.main("Snippets"){
76
@gitbucket.gist.html.style()
87
<div class="container head">
@@ -11,9 +10,9 @@
1110
<h1 style="margin: 0px;">New snippet</h1>
1211
} else {
1312
@gist.map { x =>
14-
@avatar(gist.get.userName, 24)
13+
@helpers.avatar(gist.get.userName, 24)
1514
Editing
16-
<a class="strong" href="@path/gist/@gist.get.userName/@gist.get.repositoryName">@gist.get.title</a>
15+
<a class="strong" href="@context.path/gist/@gist.get.userName/@gist.get.repositoryName">@gist.get.title</a>
1716
@if(gist.get.mode == Mode.Secret.code){
1817
<span class="label label-warning">Secret</span>
1918
}
@@ -28,7 +27,7 @@ <h1 style="margin: 0px;">New snippet</h1>
2827
<a href="@path/gist/@gist.get.userName/@gist.get.repositoryName/secret" class="btn btn-default">Make secret</a>
2928
}
3029
*@
31-
<a href="@path/gist/@gist.get.userName/@gist.get.repositoryName/delete" class="btn btn-danger" id="delete">Delete</a>
30+
<a href="@context.path/gist/@gist.get.userName/@gist.get.repositoryName/delete" class="btn btn-danger" id="delete">Delete</a>
3231
</div>
3332
<div class="muted" style="margin-left: 30px; font-size: 80%;">
3433
Created at @gist.get.registeredDate
@@ -49,7 +48,7 @@ <h1 style="margin: 0px;">New snippet</h1>
4948
<input type="button" value="Add file" class="btn btn-default" id="add_file">
5049
<div class="pull-right">
5150
@if(gist.isDefined){
52-
<a href="@path/gist/@gist.get.userName/@gist.get.repositoryName" class="btn btn-default">Cancel</a>
51+
<a href="@context.path/gist/@gist.get.userName/@gist.get.repositoryName" class="btn btn-default">Cancel</a>
5352
}
5453
<div class="btn-group" data-toggle="buttons">
5554
<label class="btn btn-default btn-mini @if(gist.isEmpty || gist.get.mode == Mode.Public.code ){active}"><input type="radio" value="PUBLIC" name="mode">Public</label>
@@ -77,20 +76,20 @@ <h1 style="margin: 0px;">New snippet</h1>
7776
<script>
7877
$(function(){
7978
$('#create_snippet').click(function(){
80-
$('#form').attr('action', '@path/gist/_new')
79+
$('#form').attr('action', '@context.path/gist/_new')
8180
});
8281

8382
$('#add_file').click(function(){
8483
var count = parseInt($('#count').val());
85-
$.get('@path/gist/_add?count=' + count, function(html){
84+
$.get('@context.path/gist/_add?count=' + count, function(html){
8685
$('#editors').append(html);
8786
$('#count').val(count + 1);
8887
});
8988
});
9089

9190
$('#update_snippet').click(function(){
9291
@gist.map { gist =>
93-
$('#form').attr('action', '@path/gist/@gist.userName/@gist.repositoryName/edit')
92+
$('#form').attr('action', '@context.path/gist/@gist.userName/@gist.repositoryName/edit')
9493
}
9594
});
9695

src/main/twirl/gitbucket/gist/editor.scala.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
@(i: Int,
22
fileName: String,
33
content: gitbucket.core.util.JGitUtil.ContentInfo)(implicit context: gitbucket.core.controller.Context)
4-
@import context._
5-
@import gitbucket.core.view.helpers._
4+
@import gitbucket.core.view.helpers
65
<div class="panel panel-default">
76
<div class="panel-heading" style="padding: 6px;">
87
<div class="pull-right">
@@ -31,7 +30,7 @@
3130
editor.setTheme("ace/theme/monokai");
3231

3332
@if(fileName.nonEmpty){
34-
editor.getSession().setMode("ace/mode/@editorType(fileName)");
33+
editor.getSession().setMode("ace/mode/@helpers.editorType(fileName)");
3534
}
3635

3736
$('#wrap-@i').change(function(){

src/main/twirl/gitbucket/gist/forks.scala.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
repositoryUrl: gitbucket.gist.util.GistUtils.GistRepositoryURL,
44
forkedGists: Seq[gitbucket.gist.model.Gist],
55
editable: Boolean)(implicit context: gitbucket.core.controller.Context)
6-
@import context._
7-
@import gitbucket.core.view.helpers._
6+
@import gitbucket.core.view.helpers
87
@gitbucket.core.html.main("Snippets"){
98
@gitbucket.gist.html.style()
109
@gitbucket.gist.html.header(gist, forkedCount, editable)
@@ -13,10 +12,10 @@
1312
<div style="margin-right: 260px;">
1413
@forkedGists.map { forkedGist =>
1514
<div class="block">
16-
@avatar(forkedGist.userName, 20)
17-
<a href="@path/gist/@forkedGist.userName/@forkedGist.repositoryName">@forkedGist.userName</a>
15+
@helpers.avatar(forkedGist.userName, 20)
16+
<a href="@context.path/gist/@forkedGist.userName/@forkedGist.repositoryName">@forkedGist.userName</a>
1817
<div class="pull-right">
19-
<a href="@path/gist/@forkedGist.userName/@forkedGist.repositoryName" class="btn btn-sm btn-default">View Fork</a>
18+
<a href="@context.path/gist/@forkedGist.userName/@forkedGist.repositoryName" class="btn btn-sm btn-default">View Fork</a>
2019
</div>
2120
</div>
2221
}

src/main/twirl/gitbucket/gist/header.scala.html

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
@(gist: gitbucket.gist.model.Gist,
22
forkedCount: Int,
33
editable: Boolean)(implicit context: gitbucket.core.controller.Context)
4-
@import context._
54
@import gitbucket.gist.model.Mode
6-
@import gitbucket.core.view.helpers._
5+
@import gitbucket.core.view.helpers
76
<div class="container head">
8-
@avatar(gist.userName, 24)
9-
<a href="@path/gist/@gist.userName">@gist.userName</a> /
10-
<a href="@path/gist/@gist.userName/@gist.repositoryName" class="strong">@gist.title</a>
7+
@helpers.avatar(gist.userName, 24)
8+
<a href="@context.path/gist/@gist.userName">@gist.userName</a> /
9+
<a href="@context.path/gist/@gist.userName/@gist.repositoryName" class="strong">@gist.title</a>
1110
@if(gist.mode == Mode.Secret.code){
1211
<span class="label label-warning">Secret</span>
1312
}
@@ -16,32 +15,32 @@
1615
}
1716
<div class="pull-right">
1817
@if(editable){
19-
<a href="@path/gist/@gist.userName/@gist.repositoryName/edit" class="btn btn-default">Edit</a>
20-
<a href="@path/gist/@gist.userName/@gist.repositoryName/delete" class="btn btn-danger" id="delete">Delete</a>
18+
<a href="@context.path/gist/@gist.userName/@gist.repositoryName/edit" class="btn btn-default">Edit</a>
19+
<a href="@context.path/gist/@gist.userName/@gist.repositoryName/delete" class="btn btn-danger" id="delete">Delete</a>
2120
}
2221
@if(gist.originUserName.isEmpty){
23-
@if(loginAccount.isEmpty){
24-
<a href="@path/signin?redirect=@urlEncode(s"${path}/gist/${gist.userName}/${gist.repositoryName}")" class="btn btn-default">Fork <span class="badge">@forkedCount</span></a>
22+
@if(context.loginAccount.isEmpty){
23+
<a href="@context.path/signin?redirect=@helpers.urlEncode(s"${context.path}/gist/${gist.userName}/${gist.repositoryName}")" class="btn btn-default">Fork <span class="badge">@forkedCount</span></a>
2524
} else {
2625
<a id="fork-link" href="javascript:void(0);" class="btn btn-default">Fork <span class="badge">@forkedCount</span></a>
2726
}
28-
@if(loginAccount.isDefined){
29-
<form id="fork-form" method="post" action="@path/gist/@gist.userName/@gist.repositoryName/fork">
27+
@if(context.loginAccount.isDefined){
28+
<form id="fork-form" method="post" action="@context.path/gist/@gist.userName/@gist.repositoryName/fork">
3029
</form>
3130
}
3231
}
3332
</div>
3433
<div class="muted" style="margin-left: 30px; font-size: 80%;">
3534
Created at @gist.registeredDate
3635
@if(gist.originUserName.isDefined){
37-
- forked from <a href="@path/gist/@gist.originUserName/@gist.originRepositoryName">@gist.originUserName/@gist.originRepositoryName</a>
36+
- forked from <a href="@context.path/gist/@gist.originUserName/@gist.originRepositoryName">@gist.originUserName/@gist.originRepositoryName</a>
3837
}
3938
</div>
4039
</div>
4140
<hr style="margin-bottom: 20px;"/>
4241
<script>
4342
$(function(){
44-
@if(loginAccount.isDefined){
43+
@if(context.loginAccount.isDefined){
4544
$(document).on("click", "a#fork-link", function(e) {
4645
e.preventDefault();
4746
$('#fork-form').submit();

0 commit comments

Comments
 (0)