Skip to content

Commit

Permalink
my-issues: Support favorite projects listing
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Jul 15, 2017
1 parent 2f2ae8c commit 3042e93
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 33 deletions.
27 changes: 27 additions & 0 deletions app/assets/stylesheets/less/_override.less
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,30 @@ input:-webkit-autofill {
}
}
}

.myissues {
.project-owner{
display: none;
}
.user-ul {
.favored {
border-bottom: 1px solid #eee;
}
}

.site-logo {
display: none;
}
.star-project {
display: none;
}
.project-item {
padding: 0 10px;
.project-name {
max-width: 150px;
}
}
.no-result {
display: none;
}
}
4 changes: 4 additions & 0 deletions app/assets/stylesheets/less/_page.less
Original file line number Diff line number Diff line change
Expand Up @@ -6863,3 +6863,7 @@ div.diff-body[data-outdated="true"] tr:hover .icon-comment {
box-shadow: 2px 2px 8px #000;
background: #FFF url('/assets/images/loading-gif-2.gif') no-repeat center;
}

.myissues-search-input {
margin: 20px 0 20px;
}
11 changes: 7 additions & 4 deletions app/assets/stylesheets/less/_usermenu.less
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@

.user-li {
color: #000;
border-left: 1px solid #fff;
border-top: 1px solid #fff;
border-right: 1px solid #fff;
&:hover {
color: #3592B5;
border: 1px solid #3592B5 !important;
}
cursor: pointer;
}
Expand Down Expand Up @@ -307,9 +311,9 @@
width: 29px;
min-height: 35px;
flex-shrink: 0;
color: #f4f4f4;
color: #eee;
&:hover {
color: white;
color: #e91e63;
}
}

Expand Down Expand Up @@ -450,11 +454,11 @@
padding: 5px;
}
.project-name{
word-wrap: break-word;
min-width: 50px;
max-width: 220px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
&.org-name {
max-width: 320px;
}
Expand Down Expand Up @@ -558,7 +562,6 @@

.project-list, .org-list {
&:hover {
background-color: #eee;
}
}

Expand Down
26 changes: 26 additions & 0 deletions app/views/index/displayProjectsWithFavored.scala.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@**
* Yona, 21st Century Project Hosting SW
*
* Copyright Yona & Yobi Authors & NAVER Corp.
* https://yona.io
**@
@(title:String, projects:List[Project], favoredProjects:List[Project], isActive:Boolean = false)

@if(projects.isEmpty && favoredProjects.isEmpty) {
<div id="@title" class="no-result tab-pane user-ul @if(isActive){active}">@Messages("title.no.results")</div>
} else {
<ul class="tab-pane user-ul @if(isActive){active}" id="@title">
@for(project <- favoredProjects){
@if(favoredProjects.last.equals(project)){
@views.html.index.myProjectList_partial(project, true, true)
} else {
@views.html.index.myProjectList_partial(project, true)
}
}
@for(project <- projects){
@if(!favoredProjects.contains(project)){
@views.html.index.myProjectList_partial(project, false)
}
}
</ul>
}
23 changes: 1 addition & 22 deletions app/views/index/myProjectList.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,6 @@
@(currentUser:User)
@import utils.TemplateHelper._

@displayProjectsWithFavored(title:String, projects:List[Project], favoredProjects:List[Project], isActive:Boolean = false) = {
@if(projects.isEmpty && favoredProjects.isEmpty) {
<div id="@title" class="no-result tab-pane user-ul @if(isActive){active}">@Messages("title.no.results")</div>
} else {
<ul class="tab-pane user-ul @if(isActive){active}" id="@title">
@for(project <- favoredProjects){
@if(favoredProjects.last.equals(project)){
@myProjectList_partial(project, true, true)
} else {
@myProjectList_partial(project, true)
}
}
@for(project <- projects){
@if(!favoredProjects.contains(project)){
@myProjectList_partial(project, false)
}
}
</ul>
}
}

@displayProjects(title:String, projects:List[Project], isActive:Boolean = false) = {
@if(projects.isEmpty) {
<div id="@title" class="no-result tab-pane user-ul @if(isActive){active}">@Messages("title.no.results")</div>
Expand Down Expand Up @@ -71,7 +50,7 @@
</ul>
</div>
<div class="tab-content">
@displayProjectsWithFavored("recentlyVisited", currentUser.getVisitedProjects, currentUser.getFavoriteProjects, true)
@views.html.index.displayProjectsWithFavored("recentlyVisited", currentUser.getVisitedProjects, currentUser.getFavoriteProjects, true)
@displayProjects("watching", currentUser.getWatchingProjects("name ASC"))
@displayProjects("createdByMe", Project.findProjectsCreatedByUser(currentUser.loginId, "createdDate desc"))
@displayProjects("joinmember", Project.findProjectsJustMemberAndNotOwner(currentUser, "name ASC"))
Expand Down
10 changes: 6 additions & 4 deletions app/views/issue/my_partial_search.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Copyright Yona & Yobi Authors & NAVER Corp.
* https://yona.io
**@
@import java.util
@(title: String, currentPage: com.avaje.ebean.Page[Issue], param:models.support.SearchCondition, project:Project)

@import helper._
Expand All @@ -24,8 +25,6 @@
<div class="inner advanced">
@my_partial_list_quicksearch(param)

<hr class="hide-in-mobile">

<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">
Expand All @@ -34,9 +33,9 @@
<input type="hidden" name="commenterId" value="@param.commenterId" data-search="commenterId">
<input type="hidden" name="assigneeId" value="@param.assigneeId" data-search="assigneeId">
<input type="hidden" name="mentionId" value="@param.mentionId" data-search="mentionId">
<div class="search">
<div class="search myissues-search-input">
<div class="search-bar">
<input name="filter" class="textbox full" type="text" value="@param.filter">
<input name="filter" class="textbox full" type="text" value="@param.filter" placeholder="@Messages("issue.search")">
<button type="submit" class="search-btn"><i class="yobicon-search"></i></button>
</div>
</div>
Expand All @@ -51,6 +50,9 @@
}
}
</div>
<div class="user-project-list myissues">
@views.html.index.displayProjectsWithFavored("recentlyVisited", new util.ArrayList(), UserApp.currentUser().getFavoriteProjects, true)
</div>
</div>
<div class="span10 span-hard-wrap" id="span10">
@common.twoColumnModeCheckboxArea()
Expand Down
2 changes: 1 addition & 1 deletion app/views/layout.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("stylesheets/yobicon/style.css")">
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("javascripts/lib/select2/select2.css")"/>
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("javascripts/lib/pikaday/pikaday.css")" />
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("stylesheets/yobi.css")">
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("stylesheets/usermenu.css")">
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("stylesheets/yobi.css")">
<link rel='stylesheet' href="@routes.Assets.at("javascripts/lib/nprogress/nprogress.css")"/>
<script type="text/javascript" src="@routes.Assets.at("javascripts/yona-layout.js")"></script>

Expand Down
2 changes: 1 addition & 1 deletion conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ issue.noAssignee = No assignee
issue.noAuthor = No author
issue.noMilestone = No milestone
issue.noDuedate = No due date
issue.search = SEARCH
issue.search = Search Issues
issue.subtask = Sub-Task
issue.subtask.select = - If you want to make a Sub-Task, select the parent issue -
issue.state = Status
Expand Down
2 changes: 1 addition & 1 deletion conf/messages.ko-KR
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ issue.noAssignee = 담당자 없음
issue.noAuthor = 작성자 없음
issue.noMilestone = 마일스톤 없음
issue.noDuedate = 목표 완료일 없음
issue.search = 검색
issue.search = 이슈 검색
issue.subtask = 이슈 옵션
issue.subtask.select = — 자식 이슈(Sub-Task)로 지정하고 싶으면 부모 이슈를 선택하세요 —
issue.state = 상태
Expand Down

0 comments on commit 3042e93

Please sign in to comment.