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.
 
 
 
 
 
 

181 lines
8.9 KiB

@**
* Yobi, Project Hosting SW
*
* Copyright 2014 NAVER Corp.
* http://yobi.io
*
* @Author Keesun
*
* 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.
**@
@(org:Organization)
@import utils.TemplateHelper._
@import utils.JodaDateUtil
@import utils.AccessControl._
@import models._
@makeLeaveBtn(org: Organization, isShow: Boolean) = {
@if(!OrganizationApp.validateForLeave(org.name).hasError() && isShow) {
<button type="button" class="ybtn ybtn-minimum ybtn-danger pull-right" id="groupLeaveBtn" data-href="@routes.OrganizationApp.leave(org.name)">@Messages("organization.member.leave")</button>
}
}
@makeUser(organizationUser: OrganizationUser, isShow: Boolean) = {
@if(isShow) {
<li class="member">
<a href="@routes.UserApp.userInfo(organizationUser.user.loginId)" class="avatar-wrap" data-toggle="tooltip" data-placement="top" title="@organizationUser.user.loginId">
<img src="@organizationUser.user.avatarUrl" height="45" width="45" />
</a>
<a href="@routes.UserApp.userInfo(organizationUser.user.loginId)" data-toggle="tooltip" data-placement="top" title="@organizationUser.user.loginId">
@organizationUser.user.name
</a>
</li>
}
}
@organizationLayout(org.name, utils.MenuType.NONE, org) {
@header(org)
@menu(org)
<div class="page-wrap-outer">
<div class="project-page-wrap">
<div class="project-home-header row-fluid">
<div class="span9">
<div class="project-overview">
<h3><span id="project-description">@org.descr</span></h3>
</div>
<div class="project-search-wrap row-fluid mt10">
<div class="span7">
<div class="search-bar">
<input name="mylist-filter" id="mylist-filter" class="textbox full" type="text" value="" data-toggle="item-search" data-items="project-item">
<button type="button" class="search-btn"><i class="yobicon-search"></i></button>
</div>
</div>
<div class="span3">
<a href="@routes.ProjectApp.newProjectForm()?owner=@org.name" class="ybtn ybtn-primary">@Messages("button.newProject")</a>
</div>
</div>
<ul class="all-projects">
@for(project <- org.getVisibleProjects(UserApp.currentUser())) {
<li class="project" data-item="project-item" data-value="@project.name @project.overview">
<div class="info-wrap">
<div class="owner-avatar-wrap">
<a href="@routes.ProjectApp.project(project.owner,project.name)">
<img src="@urlToProjectLogo(project)" alt="@project.name"/>
</a>
</div>
<div style="float:left">
<div class="header">
<a href="@routes.ProjectApp.project(project.owner, project.name)" class="black">@project.name</a>
@if(project.isForkedFromOrigin()){
<span class="small-font blue-txt">
<a class="origin-title" href='@routes.ProjectApp.project(project.originalProject.owner, project.originalProject.name)'>
<i class="yobicon-split"></i>
@project.originalProject.owner / @project.originalProject.name
</a>
</span>
}
@if(project.isPrivate){ <i class="yobicon-lock yobicon-small"></i> }
@for(label <- project.labels) {
<a class="project-label @label.category.toLowerCase()" href="@routes.ProjectApp.projects()?labelIds=@label.id">@label.name</a>
}
</div>
<div class="desc">
@project.overview
</div>
<p class="name-tag">by <a href="@routes.UserApp.userInfo(project.owner)" class="owner-name-small">@project.owner</a>
at <strong title="@JodaDateUtil.getDateString(project.createdDate)">@agoOrDateString(project.createdDate)</strong> <span class="small-font">@if(project.lastPushedDateAgo() != null) {, @Messages("project.codeUpdate") <strong title="@JodaDateUtil.getDateString(project.lastPushedDate)">@agoOrDateString(project.lastPushedDate)}</strong></span>
</p>
</div>
</div>
<div class="stats-wrap pull-right">
<div class="members">
<ul class="unstyled">
@for(member <- User.findUsersByProject(project.id)){
@if(member.loginId != project.owner){
<li>
<a href="@routes.UserApp.userInfo(member.loginId)" class="avatar-wrap">
<img src="@member.avatarUrl" alt="@member.name">
</a>
</li>
}
}
</ul>
<p>
@Html(Messages("project.onmember", User.findUsersByProject(project.id).size))
<i class="yobicon-eye yobicon-middle"></i> @Html(Messages("project.onwatching", project.getWatchingCount))
</p>
</div>
</div>
</li>
}
</ul>
</div>
<div class="span3">
<div class="bubble-wrap gray project-home">
<div class="inner member-info">
<header>
<h3>@Messages("user.role.org_admin")</h3>
@makeLeaveBtn(org, OrganizationUser.isAdmin(org.id, UserApp.currentUser().id))
</header>
<div class="member-wrap ">
<ul class="project-members">
@for(organizationUser <- org.users) {
@makeUser(organizationUser, OrganizationUser.isAdmin(org.id, organizationUser.user.id))
}
</ul>
</div>
</div>
</div>
<div class="bubble-wrap gray project-home mt10">
<div class="inner member-info">
<header>
<h3>@Messages("user.role.org_member")</h3>
@makeLeaveBtn(org, OrganizationUser.isMember(org.id, UserApp.currentUser().id))
</header>
<div class="member-wrap">
<ul class="unstyled project-members">
@for(organizationUser <- org.users) {
@makeUser(organizationUser, OrganizationUser.isMember(org.id, organizationUser.user.id))
}
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@** Confirm to leave the project **@
<div id="alertLeave" class="modal hide">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>@Messages("organization.member.leave")</h3>
</div>
<div class="modal-body">
<p>@Messages("organization.member.leaveConfirm")</p>
</div>
<div class="modal-footer">
<button type="button" class="ybtn ybtn-info ybtn-mini" id="leaveBtn">@Messages("button.yes")</button>
<button type="button" class="ybtn ybtn-mini" data-dismiss="modal">@Messages("button.no")</button>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$yobi.loadModule("organization.View");
});
</script>
}