Change import to resolve resolving error in IntelliJ

This commit is contained in:
Naoki Takezoe
2016-07-09 14:22:23 +09:00
parent 4b5f22144e
commit cf97b63dab
11 changed files with 70 additions and 83 deletions

View File

@@ -1,11 +1,10 @@
@(account: gitbucket.core.model.Account,
groupNames: List[String],
activities: List[gitbucket.core.model.Activity])(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
@main(account, groupNames, "activity"){
@import gitbucket.core.view.helpers
@gitbucket.core.account.html.main(account, groupNames, "activity"){
<div class="pull-right">
<a href="@path/@{account.userName}.atom"><img src="@assets/common/images/feed.png" alt="activities"></a>
<a href="@context.path/@{account.userName}.atom"><img src="@{helpers.assets}/common/images/feed.png" alt="activities"></a>
</div>
@helper.html.activities(activities)
@gitbucket.core.helper.html.activities(activities)
}

View File

@@ -1,11 +1,9 @@
@(account: gitbucket.core.model.Account,
personalTokens: List[gitbucket.core.model.AccessToken],
gneratedToken: Option[(gitbucket.core.model.AccessToken, String)])(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
@html.main("Applications"){
@gitbucket.core.html.main("Applications"){
<div class="container body">
@menu("application", settings.ssh){
@gitbucket.core.account.html.menu("application", context.settings.ssh){
<div class="panel panel-default">
<div class="panel-heading strong">Personal access tokens</div>
<div class="panel-body">
@@ -19,9 +17,9 @@
<div class="alert alert-info">
Make sure to copy your new personal access token now. You won't be able to see it again!
</div>
<a href="@path/@account.userName/_personalToken/delete/@token.accessTokenId" class="btn btn-sm btn-danger pull-right">Delete</a>
<a href="@context.path/@account.userName/_personalToken/delete/@token.accessTokenId" class="btn btn-sm btn-danger pull-right">Delete</a>
<div style="width: 50%;">
@helper.html.copy("generated-token-copy", tokenString){
@gitbucket.core.helper.html.copy("generated-token-copy", tokenString){
<input type="text" value="@tokenString" class="form-control input-sm" readonly>
}
</div>
@@ -32,11 +30,11 @@
<hr>
}
<strong style="line-height: 30px;">@token.note</strong>
<a href="@path/@account.userName/_personalToken/delete/@token.accessTokenId" class="btn btn-sm btn-danger pull-right">Delete</a>
<a href="@context.path/@account.userName/_personalToken/delete/@token.accessTokenId" class="btn btn-sm btn-danger pull-right">Delete</a>
}
</div>
</div>
<form method="POST" action="@path/@account.userName/_personalToken" validate="true">
<form method="POST" action="@context.path/@account.userName/_personalToken" validate="true">
<div class="panel panel-default">
<div class="panel-heading strong">Generate new token</div>
<div class="panel-body">

View File

@@ -1,14 +1,13 @@
@(account: gitbucket.core.model.Account, info: Option[Any], error: Option[Any])(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.util.LDAPUtil
@import context._
@import gitbucket.core.view.helpers._
@html.main("Edit your profile"){
@import gitbucket.core.view.helpers
@gitbucket.core.html.main("Edit your profile"){
<div class="container body">
@menu("profile", settings.ssh){
@helper.html.information(info)
@helper.html.error(error)
@gitbucket.core.account.html.menu("profile", context.settings.ssh){
@gitbucket.core.helper.html.information(info)
@gitbucket.core.helper.html.error(error)
@if(LDAPUtil.isDummyMailAddress(account)){<div class="alert alert-danger">Please register your mail address.</div>}
<form action="@url(account.userName)/_edit" method="POST" validate="true">
<form action="@helpers.url(account.userName)/_edit" method="POST" validate="true">
<div class="panel panel-default">
<div class="panel-heading strong">Profile</div>
<div class="panel-body">
@@ -42,7 +41,7 @@
<div class="col-md-6">
<fieldset class="form-group">
<label for="avatar" class="strong">Image (optional):</label>
@helper.html.uploadavatar(Some(account))
@gitbucket.core.helper.html.uploadavatar(Some(account))
</fieldset>
</div>
</div>
@@ -50,10 +49,10 @@
</div>
<div>
<div class="pull-right">
<a href="@path/@account.userName/_delete" class="btn btn-danger" id="delete">Delete account</a>
<a href="@context.path/@account.userName/_delete" class="btn btn-danger" id="delete">Delete account</a>
</div>
<input type="submit" class="btn btn-success" value="Save"/>
@if(!LDAPUtil.isDummyMailAddress(account)){<a href="@url(account.userName)" class="btn btn-default">Cancel</a>}
@if(!LDAPUtil.isDummyMailAddress(account)){<a href="@helpers.url(account.userName)" class="btn btn-default">Cancel</a>}
</div>
</form>
}

View File

@@ -1,11 +1,10 @@
@(account: Option[gitbucket.core.model.Account], members: List[gitbucket.core.model.GroupMember])(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
@html.main(if(account.isEmpty) "Create group" else "Edit group"){
@import gitbucket.core.view.helpers
@gitbucket.core.html.main(if(account.isEmpty) "Create group" else "Edit group"){
<div class="content-wrapper main-center">
<div class="content body">
<h2>@{if(account.isEmpty) "Create group" else "Edit group"}</h2>
<form id="form" method="post" action="@if(account.isEmpty){@path/groups/new} else {@path/@account.get.userName/_editgroup}" validate="true">
<form id="form" method="post" action="@if(account.isEmpty){@context.path/groups/new} else {@context.path/@account.get.userName/_editgroup}" validate="true">
<div class="row">
<div class="col-md-5">
<fieldset class="form-group">
@@ -24,7 +23,7 @@
</fieldset>
<fieldset class="form-group">
<label for="avatar" class="strong">Image (Optional)</label>
@helper.html.uploadavatar(account)
@gitbucket.core.helper.html.uploadavatar(account)
</fieldset>
</div>
<div class="col-md-7">
@@ -32,7 +31,7 @@
<label class="strong">Members</label>
<ul id="member-list" class="collaborator">
</ul>
@helper.html.account("memberName", 200)
@gitbucket.core.helper.html.account("memberName", 200)
<input type="button" class="btn btn-default" value="Add" id="addMember"/>
<input type="hidden" id="members" name="members" value="@members.map(member => member.userName + ":" + member.isManager).mkString(",")"/>
<div>
@@ -44,12 +43,12 @@
<fieldset class="border-top">
@if(account.isDefined){
<div class="pull-right">
<a href="@url(account.get.userName)/_deletegroup" id="delete" class="btn btn-danger">Delete Group</a>
<a href="@helpers.url(account.get.userName)/_deletegroup" id="delete" class="btn btn-danger">Delete Group</a>
</div>
}
<input type="submit" class="btn btn-success" value="@if(account.isEmpty){Create Group} else {Update Group}"/>
@if(account.isDefined){
<a href="@url(account.get.userName)" class="btn btn-default">Cancel</a>
<a href="@helpers.url(account.get.userName)" class="btn btn-default">Cancel</a>
}
</fieldset>
</form>
@@ -81,7 +80,7 @@ $(function(){
}
// check existence
$.post('@path/_user/existence', {
$.post('@context.path/_user/existence', {
'userName': userName
}, function(data, status){
if(data == 'true'){
@@ -125,7 +124,7 @@ $(function(){
.append(memberButton)
.append(managerButton))
.append(' ')
.append($('<a>').attr('href', '@path/' + userName).text(userName))
.append($('<a>').attr('href', '@context.path/' + userName).text(userName))
.append(' ')
.append($('<a href="#" class="remove pull-right">(remove)</a>')));
}

View File

@@ -1,12 +1,11 @@
@(account: gitbucket.core.model.Account, groupNames: List[String], active: String,
isGroupManager: Boolean = false)(body: Html)(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
@html.main(account.userName){
@import gitbucket.core.view.helpers
@gitbucket.core.html.main(account.userName){
<div class="main-sidebar">
<div class="sidebar">
<div class="user-panel">
<div class="pull-left image">@avatar(account.userName, 40)</div>
<div class="pull-left image">@helpers.avatar(account.userName, 40)</div>
<div class="pull-left info">
<p>@account.userName</p>
@account.fullName
@@ -19,14 +18,14 @@
</p>
}
<p style="color: white;">
<i class="octicon octicon-clock"></i> Joined on @date(account.registeredDate)
<i class="octicon octicon-clock"></i> Joined on @helpers.date(account.registeredDate)
</p>
</div>
@if(groupNames.nonEmpty){
<ul class="sidebar-menu">
<li class="header">Groups</li>
@groupNames.map { groupName =>
<li>@avatarLink(groupName, 20, tooltip = true, label = true)</li>
<li>@helpers.avatarLink(groupName, 20, tooltip = true, label = true)</li>
}
</ul>
}
@@ -35,28 +34,28 @@
<div class="content-wrapper">
<div class="content body">
<ul class="nav nav-tabs" style="margin-bottom: 5px;">
<li@if(active == "repositories"){ class="active"}><a href="@url(account.userName)?tab=repositories">Repositories</a></li>
<li@if(active == "repositories"){ class="active"}><a href="@helpers.url(account.userName)?tab=repositories">Repositories</a></li>
@if(account.isGroupAccount){
<li@if(active == "members"){ class="active"}><a href="@url(account.userName)?tab=members">Members</a></li>
<li@if(active == "members"){ class="active"}><a href="@helpers.url(account.userName)?tab=members">Members</a></li>
} else {
<li@if(active == "activity"){ class="active"}><a href="@url(account.userName)?tab=activity">Public Activity</a></li>
<li@if(active == "activity"){ class="active"}><a href="@helpers.url(account.userName)?tab=activity">Public Activity</a></li>
}
@gitbucket.core.plugin.PluginRegistry().getProfileTabs.map { tab =>
@tab(account, context).map { link =>
<li@if(active == link.id){ class="active"}><a href="@path/@link.path">@link.label</a></li>
<li@if(active == link.id){ class="active"}><a href="@context.path/@link.path">@link.label</a></li>
}
}
@if(loginAccount.isDefined && loginAccount.get.userName == account.userName){
@if(context.loginAccount.isDefined && context.loginAccount.get.userName == account.userName){
<li class="pull-right">
<div class="button-group">
<a href="@url(account.userName)/_edit" class="btn btn-default">Edit Your Profile</a>
<a href="@helpers.url(account.userName)/_edit" class="btn btn-default">Edit Your Profile</a>
</div>
</li>
}
@if(loginAccount.isDefined && account.isGroupAccount && isGroupManager){
@if(context.loginAccount.isDefined && account.isGroupAccount && isGroupManager){
<li class="pull-right">
<div class="button-group">
<a href="@url(account.userName)/_editgroup" class="btn btn-default">Edit Group</a>
<a href="@helpers.url(account.userName)/_editgroup" class="btn btn-default">Edit Group</a>
</div>
</li>
}

View File

@@ -1,14 +1,13 @@
@(account: gitbucket.core.model.Account, members: List[String], isGroupManager: Boolean)(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
@main(account, Nil, "members", isGroupManager){
@import gitbucket.core.view.helpers
@gitbucket.core.account.html.main(account, Nil, "members", isGroupManager){
@if(members.isEmpty){
No members
} else {
@members.map { userName =>
<div class="block">
<div class="block-header">
@avatar(userName, 20) <a href="@url(userName)">@userName</a>
@helpers.avatar(userName, 20) <a href="@helpers.url(userName)">@userName</a>
</div>
</div>
}

View File

@@ -1,23 +1,22 @@
@(active: String, ssh: Boolean)(body: Html)(implicit context: gitbucket.core.controller.Context)
@import context._
<div class="main-sidebar">
<div class="sidebar">
<ul class="sidebar-menu">
<li@if(active=="profile"){ class="active"}>
<a href="@path/@loginAccount.get.userName/_edit">Profile</a>
<a href="@context.path/@context.loginAccount.get.userName/_edit">Profile</a>
</li>
@if(ssh){
<li@if(active=="ssh"){ class="active"}>
<a href="@path/@loginAccount.get.userName/_ssh">SSH Keys</a>
<a href="@context.path/@context.loginAccount.get.userName/_ssh">SSH Keys</a>
</li>
}
<li@if(active=="application"){ class="active"}>
<a href="@path/@loginAccount.get.userName/_application">Applications</a>
<a href="@context.path/@context.loginAccount.get.userName/_application">Applications</a>
</li>
@gitbucket.core.plugin.PluginRegistry().getAccountSettingMenus.map { menu =>
@menu(context).map { link =>
<li@if(active==link.id){ class="active"}>
<a href="@path/@link.path">@link.label</a>
<a href="@context.path/@link.path">@link.label</a>
</li>
}
}

View File

@@ -1,31 +1,30 @@
@(groupNames: List[String],
isCreateRepoOptionPublic: Boolean)(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
@html.main("Create a New Repository"){
@import gitbucket.core.view.helpers
@gitbucket.core.html.main("Create a New Repository"){
<div class="content-wrapper main-center">
<div class="content body">
<h2>Create a new repository</h2>
<p class="muted">
A repository contains all the files for your project, including the revision history.
</p>
<form id="form" method="post" action="@path/new" validate="true">
<form id="form" method="post" action="@context.path/new" validate="true">
<fieldset class="border-top form-group">
<dl style="float: left;">
<dt>Owner</dt>
<dd style="margin-left: 0px;">
<div class="btn-group" id="owner-dropdown">
<button class="btn dropdown-toggle btn-default" data-toggle="dropdown">
<span class="strong">@avatar(loginAccount.get.userName, 20) @loginAccount.get.userName</span>
<span class="strong">@helpers.avatar(context.loginAccount.get.userName, 20) @context.loginAccount.get.userName</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="javascript:void(0);" data-name="@loginAccount.get.userName"><i class="octicon octicon-check"></i> <span>@avatar(loginAccount.get.userName, 20) @loginAccount.get.userName</span></a></li>
<li><a href="javascript:void(0);" data-name="@context.loginAccount.get.userName"><i class="octicon octicon-check"></i> <span>@helpers.avatar(context.loginAccount.get.userName, 20) @context.loginAccount.get.userName</span></a></li>
@groupNames.map { groupName =>
<li><a href="javascript:void(0);" data-name="@groupName"><i class="octicon"></i> <span>@avatar(groupName, 20) @groupName</span></a></li>
<li><a href="javascript:void(0);" data-name="@groupName"><i class="octicon"></i> <span>@helpers.avatar(groupName, 20) @groupName</span></a></li>
}
</ul>
<input type="hidden" name="owner" id="owner" value="@loginAccount.get.userName"/>
<input type="hidden" name="owner" id="owner" value="@context.loginAccount.get.userName"/>
</div>
</dd>
</dl>

View File

@@ -1,11 +1,9 @@
@()(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
@html.main("Create your account"){
@gitbucket.core.html.main("Create your account"){
<div class="content-wrapper main-center">
<div class="content body">
<h2>Create your account</h2>
<form action="@path/register" method="POST" validate="true">
<form action="@context.path/register" method="POST" validate="true">
<div class="row">
<div class="col-md-6">
<fieldset>
@@ -39,7 +37,7 @@
<div class="col-md-6">
<fieldset>
<label for="avatar" class="strong">Image (optional):</label>
@helper.html.uploadavatar(None)
@gitbucket.core.helper.html.uploadavatar(None)
</fieldset>
</div>
</div>

View File

@@ -1,31 +1,31 @@
@(account: gitbucket.core.model.Account, groupNames: List[String],
repositories: List[gitbucket.core.service.RepositoryService.RepositoryInfo],
isGroupManager: Boolean)(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
@main(account, groupNames, "repositories", isGroupManager){
@import gitbucket.core.view.helpers
@import gitbucket.core.helper.html.datetimeago
@gitbucket.core.account.html.main(account, groupNames, "repositories", isGroupManager){
@if(repositories.isEmpty){
No repositories
} else {
@repositories.map { repository =>
<div class="block">
<div class="repository-icon">
@helper.html.repositoryicon(repository, true)
@gitbucket.core.helper.html.repositoryicon(repository, true)
</div>
<div class="repository-content">
<div class="block-header">
<a href="@url(repository)">@repository.name</a>
<a href="@helpers.url(repository)">@repository.name</a>
@if(repository.repository.isPrivate){
<i class="octicon octicon-lock"></i>
}
</div>
@if(repository.repository.originUserName.isDefined){
<div class="small muted">forked from <a href="@path/@repository.repository.parentUserName/@repository.repository.parentRepositoryName">@repository.repository.parentUserName/@repository.repository.parentRepositoryName</a></div>
<div class="small muted">forked from <a href="@context.path/@repository.repository.parentUserName/@repository.repository.parentRepositoryName">@repository.repository.parentUserName/@repository.repository.parentRepositoryName</a></div>
}
@if(repository.repository.description.isDefined){
<div>@repository.repository.description</div>
}
<div><span class="muted small">Updated @helper.html.datetimeago(repository.repository.lastActivityDate)</span></div>
<div><span class="muted small">Updated @datetimeago(repository.repository.lastActivityDate)</span></div>
</div>
</div>
}

View File

@@ -1,10 +1,8 @@
@(account: gitbucket.core.model.Account, sshKeys: List[gitbucket.core.model.SshKey])(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.ssh.SshUtil
@import context._
@import gitbucket.core.view.helpers._
@html.main("SSH Keys"){
@gitbucket.core.html.main("SSH Keys"){
<div class="container body">
@menu("ssh", settings.ssh){
@gitbucket.core.account.html.menu("ssh", context.settings.ssh){
<div class="panel panel-default">
<div class="panel-heading strong">SSH Keys</div>
<div class="panel-body">
@@ -16,11 +14,11 @@
<hr>
}
<strong style="line-height: 30px;">@key.title</strong> (@SshUtil.fingerPrint(key.publicKey).getOrElse("Key is invalid."))
<a href="@path/@account.userName/_ssh/delete/@key.sshKeyId" class="btn btn-sm btn-danger pull-right">Delete</a>
<a href="@context.path/@account.userName/_ssh/delete/@key.sshKeyId" class="btn btn-sm btn-danger pull-right">Delete</a>
}
</div>
</div>
<form method="POST" action="@path/@account.userName/_ssh" validate="true">
<form method="POST" action="@context.path/@account.userName/_ssh" validate="true">
<div class="panel panel-default">
<div class="panel-heading strong">Add an SSH Key</div>
<div class="panel-body">