File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
@**
* Yobi, Project Hosting SW
*
* Copyright 2013 NAVER Corp.
* http://yobi.io
*
* @author Deokhong 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)
@import utils._
@import utils.TemplateHelper._
@import utils.AccessControl._
@import models.enumeration.ResourceType
@import models.enumeration.Operation
@import controllers.UserApp
@watchHelpMessages = {
<div class="pop-content">
<p>@Messages("notification.help")</p>
<ul class="icons-ul">
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.new")</li>
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.new.comment")</li>
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.update.issue")</li>
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.update.pullrequest")</li>
</ul>
</div>
}
@amIWatching = @{
if(User.isWatching(project)) {
"watch-on"
}
}
@isFavoriteProject = @{
FavoriteProject.findByProjectId(UserApp.currentUser().id, project.id) != null
}
<div class="project-header-outer" style="background-image:url(@urlToProjectBG(project))">
<div class="project-header-inner">
<div class="project-header-wrap">
<div class="project-header-avatar">
<img src="@urlToProjectLogo(project)" />
</div>
<div class="project-breadcrumb-wrap @if(project.isForkedFromOrigin){fork}">
<div class="project-breadcrumb">
<span class="project-author hide-in-mobile"><a href="@routes.UserApp.userInfo(project.owner)">@project.owner</a></span>
<span class="project-separator hide-in-mobile">/</span>
<span class="project-name"><a href="@routes.ProjectApp.project(project.owner, project.name)">@project.name</a></span>
<span class="user-project-list" data-project-id="@project.id">
<i class="@if(isFavoriteProject){starred} star material-icons va-text-top">star</i>
</span>
@if(project.isPrivate){
<span class="project-private">
<i class="yobicon-lock"></i>
</span>
}
@if(project.isProtected){
<span class="project-protected" title="Group Project">
G
</span>
}
</div>
@if(project.isForkedFromOrigin){
<div class="project-origin">
<span class="project-origin-title">@Messages("fork.original")</span>
<a href="@routes.ProjectApp.project(project.originalProject.owner, project.originalProject.name)" class="project-origin-name">
@project.originalProject.owner / @project.originalProject.name
</a>
</div>
}
</div>
<div class="project-util-wrap">
<ul class="project-util">
@if(ProjectUser.isGuest(project, UserApp.currentUser)) {
<li>
@if(User.enrolled(project)) {
<button class="ybtn ybtn-small ybtn-info dropdown-toggle" type="button" data-toggle="dropdown">
<i class="yobicon-addfriend"></i>
</button>
<div class="dropdown-menu flat right title">
<div class="pop-title">@Messages("project.you.want.to.be.a.member", project)</div>
<div class="pop-content">
@Messages("project.member.enrollment.help")
</div>
<div class="pop-content btn-wrap">
<a class="ybtn enrollBtn" href="@routes.EnrollProjectApp.cancelEnroll(project.owner, project.name)" id="enrollBtn">
<i class="yobicon-removefriend"></i>
@Messages("button.cancel.enrollment")
</a>
</div>
</div>
} else {
<button class="ybtn ybtn-small dropdown-toggle" type="button" data-toggle="dropdown">
<i class="yobicon-addfriend"></i>@Messages("organization.member.enrollment.title")
</button>
<div class="dropdown-menu flat right title">
<div class="pop-title">@Messages("project.you.may.want.to.be.a.member", project)</div>
<div class="pop-content">
@Messages("project.member.enrollment.will.help")
</div>
<div class="pop-content btn-wrap">
<a class="ybtn ybtn-info enrollBtn" href="@routes.EnrollProjectApp.enroll(project.owner, project.name)" id="enrollBtn">
<i class="yobicon-addfriend"></i>
@Messages("button.new.enrollment")
</a>
</div>
</div>
}
</li>
}
@if(isAllowed(UserApp.currentUser(), project.asResource(), Operation.WATCH)) {
<li>
<div class="btn-group dropdown watch-btn">
<a class="btn watcher-count no-border @amIWatching" data-toggle="tooltip" title="@Messages("project.watcher.number")" href="@routes.ProjectApp.watchers(project.owner, project.name)">@project.getWatchingCount</a>
@if(User.isWatching(project)) {
<div class="dropdown-menu flat right title">
<div class="pop-title">@Messages("project.you.are.watching", project.name)</div>
@watchHelpMessages
<div class="pop-content btn-wrap">
<a class="ybtn" href="@routes.UserApp.editUserInfoByTabForm("notifications")#@project.id">
<i class="yobicon-alert2"></i>
@Messages("userinfo.changeNotifications")
</a>
<a class="ybtn ybtn-watching watchBtn" href="@routes.WatchProjectApp.unwatch(project.owner, project.name)">
<i class="yobicon-eye-off"></i>
@Messages("project.unwatch")
</a>
</div>
</div>
<button class="btn nofocus no-border down-arrow" type="button" data-toggle="dropdown">
@Messages("project.unwatch")
</button>
} else {
<div class="dropdown-menu flat right title">
<div class="pop-title">@Messages("project.you.are.not.watching", project.name)</div>
@watchHelpMessages
<div class="pop-content btn-wrap">
<a class="ybtn" href="@routes.UserApp.editUserInfoByTabForm("notifications")#@project.id">
<i class="yobicon-alert2"></i>
@Messages("userinfo.changeNotifications")
</a>
<a class="ybtn ybtn-watching watchBtn" href="@routes.WatchProjectApp.watch(project.owner, project.name)">
<i class="yobicon-eye"></i>
@Messages("project.watch")
</a>
</div>
</div>
<button class="btn nofocus no-border down-arrow" type="button" data-toggle="dropdown">
@Messages("project.watch")
</button>
}
</div>
</li>
}
</ul>
</div>
</div>
</div>
</div>