THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

test
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

145 lines
5.6 KiB

@**
* Yobi, Project Hosting SW
*
* Copyright 2013 NAVER Corp.
* http://yobi.io
*
* @Author Jihan Kim
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(project:Project, menuType:utils.MenuType, menuCSS:String)
@import utils._
@import utils.TemplateHelper._
@import utils.AccessControl._
@import models.enumeration.ResourceType;
@isActiveMenu(m_type:MenuType) = @{
if (m_type == menuType) {"active"}
}
@getPullRequestURL(project:Project) = @{
if(project.isForkedFromOrigin){
routes.PullRequestApp.sentPullRequests(project.owner, project.name)
} else {
routes.PullRequestApp.pullRequests(project.owner, project.name)
}
}
<div class="project-menu-outer">
<div class="project-menu-inner">
<ul class="project-menu-nav project-menu-gruop">
<li class="@isActiveMenu(MenuType.PROJECT_HOME)">
<a href="@routes.ProjectApp.project(project.owner, project.name)">
@Messages("title.projectHome")
</a>
</li>
@if(project.menuSetting.code) {
<li class="@isActiveMenu(MenuType.CODE)">
<a href="@routes.CodeApp.codeBrowser(project.owner, project.name)">
@Messages("menu.code")
</a>
</li>
}
@if(project.menuSetting.issue) {
<li class="@isActiveMenu(MenuType.ISSUE)">
<a href="@routes.IssueApp.issues(project.owner, project.name, "open")">
@Messages("menu.issue")
@if(Issue.countIssues(project.id, State.OPEN) > 0){
<span class="project-menu-count">@Issue.countIssues(project.id, State.OPEN)</span>
}
</a>
</li>
}
@if(project.menuSetting.pullRequest) {
@if(project.vcs.equals("GIT")){
<li class="@isActiveMenu(MenuType.PULL_REQUEST)">
<a href="@getPullRequestURL(project)">
@Messages("menu.pullRequest")
@if(PullRequest.countOpenedPullRequests(project) > 0){
<span class="project-menu-count">@PullRequest.countOpenedPullRequests(project)</span>
}
</a>
</li>
}
}
@if(project.menuSetting.review) {
<li class="@isActiveMenu(MenuType.PROJECT_REVIEW)">
<a href="@routes.ReviewThreadApp.reviewThreads(project.owner, project.name)">
@Messages("menu.review")
</a>
</li>
}
@if(project.menuSetting.milestone) {
<li class="@isActiveMenu(MenuType.MILESTONE)">
<a href="@routes.MilestoneApp.milestones(project.owner, project.name)">
@Messages("milestone")
</a>
</li>
}
@if(project.menuSetting.board) {
<li class="@isActiveMenu(MenuType.BOARD)">
<a href="@routes.BoardApp.posts(project.owner, project.name)">
@Messages("menu.board")
</a>
</li>
}
</ul>
@if(AccessControl.isAllowed(UserApp.currentUser(), project.asResource(), Operation.UPDATE)){
<div class="project-setting">
<ul class="project-menu-nav">
<li class="@isActiveMenu(MenuType.PROJECT_SETTING)">
<a href="@routes.ProjectApp.settingForm(project.owner, project.name)">
<i class="yobicon-cog"></i>
<span class="blind">@Messages("menu.admin")</span>
@if(project.enrolledUsers.size > 0){
<span class="project-menu-count">@project.enrolledUsers.size</span>
}
</a>
<li>
</ul>
</div>
}
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
var htKeyMap = {
"H": "@routes.ProjectApp.project(project.owner, project.name)"
@if(project.menuSetting.board) {
,"B": "@routes.BoardApp.posts(project.owner, project.name)"
}
@if(project.menuSetting.code) {
,"C": "@routes.CodeApp.codeBrowser(project.owner, project.name)"
}
@if(project.menuSetting.issue) {
,"I": "@routes.IssueApp.issues(project.owner, project.name,"open")"
}
@if(project.menuSetting.milestone) {
,"M": "@routes.MilestoneApp.milestones(project.owner, project.name)"
}
@if(project.menuSetting.pullRequest && project.vcs.equals("GIT")){
,"F": "@getPullRequestURL(project)"
}
@requestHeader.session.get("loginId") match {
case Some(role) if role.equals("manager") => { "Q": "@routes.ProjectApp.settingForm(project.owner, project.name)" }
case _ => { }
}
};
$yobi.loadModule("project.Global", {
"htKeyMap": htKeyMap,
"sRepoURL": "@CodeApp.getURLWithLoginId(project)"
});
});
</script>