[Notice] Announcing the End of Demo Server [Read me]
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
2014-05-22
File name
Commit message
Commit date
2014-07-28
2014-07-28
@**
* Yobi, Project Hosting SW
*
* Copyright 2014 NAVER Corp.
* http://yobi.io
*
* @Author Suwon Chae
*
* 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.
**@
@(title: String, currentPage: com.avaje.ebean.Page[Issue], param:models.support.SearchCondition, project:Project)
@import helper._
@import utils.TemplateHelper._
@import utils.AccessControl._
@import scala.collection.immutable.Map
@import scala.collection.mutable.ArrayBuffer
@import models.enumeration._
@import org.apache.commons.lang.StringUtils
@import utils.HttpUtil._
@urlToList = {@routes.IssueApp.issues(project.owner, project.name, param.state, "html", currentPage.getPageIndex + 1)}
@paramForEveryone = @{ param.clone().setState(param.state).setAssigneeId(null).setAuthorId(null) }
@paramForIssuesAssignedToMe = @{ param.clone().setState(param.state).setAssigneeId(UserApp.currentUser().id).setAuthorId(null) }
@paramForIssuesAuthoredByMe = @{ param.clone().setState(param.state).setAssigneeId(null).setAuthorId(UserApp.currentUser().id) }
@getPageListUrl(pageIndex:Integer) = {@routes.IssueApp.userIssues(param.state, "html", pageIndex + 1)}
@makeFilterLink(fieldName:String, orderBy:String, orderDir:String, fieldText:String) = {
@if(orderBy.equals(fieldName)) {
<a href="#" orderBy="@orderBy" orderDir="@if(orderDir.equals("desc")){asc}else{desc}" class="filter active"><i class="ico btn-gray-arrow @if(orderDir.equals("desc")){ down }"></i>@fieldText</a>
} else {
<a href="#" orderBy="@fieldName" orderDir="desc" class="filter"><i class="ico btn-gray-arrow down"></i>@fieldText</a>
}
}
@getTabLinkByState(state:State) = {@routes.IssueApp.issues(project.owner, project.name, state.state)@if(param.assigneeId != null){?assigneeId=@param.assigneeId}@if(param.authorId != null){&authorId=@param.authorId}@if(param.milestoneId != null){&milestoneId=@param.milestoneId}}
<div pjax-container class="row-fluid issue-list-wrap">
<div class="span2">
<div class="inner advanced">
<ul class="lst-stacked unstyled">
@if(!UserApp.currentUser().isAnonymous()){
<li @if(param.assigneeId == UserApp.currentUser().id){ class="active"}>
<a pjax-filter href="#" mentionId="" authorId="" assigneeId="@User.findByLoginId(session.get("loginId")).id" milestoneId="@param.milestoneId">@Messages("issue.list.assignedToMe")
</a>
</li>
<li @if(param.authorId == UserApp.currentUser().id){ class="active"}>
<a pjax-filter href="#" mentionId="" authorId="@User.findByLoginId(session.get("loginId")).id" assigneeId="" milestoneId="@param.milestoneId">@Messages("issue.list.authoredByMe")
</a>
</li>
<li @if(param.mentionId == UserApp.currentUser().id){ class="active"}>
<a pjax-filter href="#" mentionId="@User.findByLoginId(session.get("loginId")).id" authorId="" assigneeId="" milestoneId="@param.milestoneId">@Messages("issue.list.mentionedOfMe")
</a>
</li>
}
</ul>
@if(param.milestoneId != null){
@defining(Milestone.findById(param.milestoneId)){ milestone =>
@if(milestone != null){
<hr>
@views.html.milestone.partial_status(milestone, project)
}
}
}
<form id="search" name="search" action="@routes.IssueApp.userIssues()" method="get">
<input type="hidden" name="orderBy" value="@param.orderBy">
<input type="hidden" name="orderDir" value="@param.orderDir">
<input type="hidden" name="state" value="@param.state">
<input type="hidden" name="authorId" value="@param.authorId">
<input type="hidden" name="assigneeId" value="@param.assigneeId">
<input type="hidden" name="mentionId" value="@param.mentionId">
<hr>
<div class="search">
<div class="search-bar">
<input name="filter" class="textbox full" type="text" value="@param.filter">
<button type="submit" class="search-btn"><i class="yobicon-search"></i></button>
</div>
</div>
</form>
</div>
</div>
<div class="span10" id="span10">
<ul class="nav nav-tabs nm">
@for(state <- Array(State.OPEN, State.CLOSED)) {
<li @if(param.state == state.state) { class="active" } data-pjax>
<a href="#" state="@state.state">
@Messages("issue.state." + state.name.toLowerCase)
<span class="num-badge">@Issue.countIssuesBy(param.clone.setState(state))</span>
</a>
</li>
}
</ul>
@if(currentPage.getList.size() > 0){
<div class="filter-wrap small-heights">
@if(currentPage.getList.size() > 1){
<div class="filters pull-right">
@makeFilterLink("updatedDate", param.orderBy, param.orderDir, Messages("common.order.updatedDate"))
@makeFilterLink("createdDate", param.orderBy, param.orderDir, Messages("common.order.date"))
@makeFilterLink("numOfComments", param.orderBy, param.orderDir, Messages("common.order.comments"))
</div>
}
</div>
@my_partial_list(currentPage.getList, param, currentPage.getPageIndex, currentPage.getTotalPageCount, project)
<div class="pull-left" style="padding:10px;">
</div>
<div id="pagination"><!-- pagination.js will fill here. --></div>
} else {
<div class="error-wrap">
<i class="ico ico-err1"></i>
<p>@Messages("issue.is.empty")</p>
</div>
}
</div>
<script type="text/javascript">
$(document).ready(function(){
$("a[pjax-filter]" ).bind("click",function(){
$("input[name='authorId']").val($(this).attr("authorId"));
$("input[name='assigneeId']").val($(this).attr("assigneeId"));
$("input[name='mentionId']").val($(this).attr("mentionId"));
$("#search" ).submit();
});
$yobi.loadModule("issue.List", {
"welSearchOrder": $("a[orderBy]"),
"welSearchState": $("a[state]"),
"welSearchAuthor": $("div[data-name='authorId']"),
"welSearchAssignee": $("div[data-name='assigneeId']"),
"welSearchMilestone": $("div[data-name='milestoneId']"),
"welSearchForm":$("form[name='search']"),
"welFilter": $("a[pjax-filter]"),
"elPagination": $("#pagination"),
"nTotalPages" : @currentPage.getTotalPageCount
});
});
</script>
</div>