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.
 
 
 
 
 
 

129 lines
5.9 KiB

@**
* Yobi, Project Hosting SW
*
* Copyright 2013 NAVER Corp.
* http://yobi.io
*
* @Author Keesun Baik
*
* 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)
@import utils.TemplateHelper._
@orderString = @{"createdDate DESC"}
<ul class="gnb-usermenu">
@requestHeader.session.get("loginId") match {
case Some(loginId) => {
<li class="gnb-usermenu-dropdown">
<a href="javascript:void(0);" class="gnb-dropdown-toggle dropdwon-box-btn" data-toggle="dropdown">
<i class="yobicon-plus"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu flat right">
<li>
<a href="@routes.ProjectApp.newProjectForm()">
@Messages("button.newProject")
</a>
</li>
<li>
<a href="@routes.OrganizationApp.newForm()">
@Messages("title.newOrganization")
</a>
</li>
</ul>
</li>
@if(requestHeader.session.get("userId").equals("1")) {
<li class="gnb-usermenu-item">
<a href="@routes.SiteApp.userList()" data-toggle="tooltip" title="@Messages("menu.siteAdmin")" data-placement="bottom" class="usermenu-icon-button">
<i class="yobicon-wrench"></i>
</a>
</li>
}
<li class="gnb-usermenu-dropdown">
<a href="javascript:void(0);" class="gnb-dropdown-toggle" data-toggle="dropdown">
<span class="avatar-wrap smaller">
<img src="@User.findByLoginId(loginId).avatarUrl" />
</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu flat right">
<li class="title">
@User.findByLoginId(loginId).name <span class="disabled">@{"@"}@loginId</span>
</li>
<li>
<a href="@routes.IssueApp.userIssues()">@Messages("issue.myIssue")</a>
</li>
<li>
<a href="@routes.UserApp.userInfo(loginId)">@Messages("userinfo.profile")</a>
</li>
<li>
<a href="@routes.UserApp.editUserInfoForm()">
@Messages("userinfo.accountSetting")
</a>
</li>
<li>
<a href="@routes.UserApp.logout()">
@Messages("title.logout")
</a>
</li>
@defining(UserApp.currentUser.getOrganizations(5)) { groups =>
<li class="title">
@Messages("title.organization")
<span class="numberic">@groups.size</span>
</li>
@if(groups.size > 0) {
@for(organization <- groups){
<li><a href="@routes.OrganizationApp.organization(organization.name)">@if(hasOrganizationLogo(organization)){<img src="@urlToOrganizationLogo(organization)">}else{<span class="dummy-25px"> </span>} <span class="bold">@organization.name</span></a></li>
}
} else {
<li class="empty">@Messages("organization.is.empty")</li>
}
}
@defining(UserApp.currentUser.getVisitedProjects(10)){ visitedProjects =>
<li class="title">
@Messages("project.recently.visited")
<span class="numberic">@visitedProjects.size</span>
</li>
@if(visitedProjects.size > 0) {
@for(visited <- visitedProjects){
<li><a href="@routes.ProjectApp.project(visited.project.owner, visited.project.name)">@if(hasProjectLogo(visited.project)){<img src="@urlToProjectLogo(visited.project)">} else{<span class="dummy-25px"> </span>} <span class="bold">@visited.project.name</span> <span class="darkgray-txt small-font margin-right-15">of @visited.project.owner</span></a></li>
}
} else {
@defining(Project.findProjectsCreatedByUser(UserApp.currentUser.loginId, orderString)) { myProjects =>
@if(myProjects.size > 0) {
@for(project <- myProjects){
<li>@if(hasProjectLogo(project)){<img src="@urlToProjectLogo(project)">} <a href="@routes.ProjectApp.project(project.owner, project.name)"><span class="bold">@project.name</span> <span class="darkgray-txt small-font margin-right-15">of @project.owner</span></a></li>
}
} else {
<li class="empty">@Messages("project.is.empty")</li>
}
}
}
}
</ul>
</li>
}
case None => {
<li>
<a href="@routes.UserApp.signupForm()" class="ybtn ybtn-success">
@Messages("title.signup")
</a>
</li>
<li class="gnb-usermenu-item">
<a href="@routes.UserApp.loginForm()" class="user-item-btn" data-login="required">
@Messages("title.login")
</a>
</li>
}
}
</ul>