user-profile: Polishing view pages
Notice ---- User profile page will be more simplified in the future. It's easy to slow down, but it's not used very well. See: Yona Github issue #170
@335d0cc82ee1e9e97b36df29fe828754ff28e0a6
--- app/controllers/UserApp.java
+++ app/controllers/UserApp.java
... | ... | @@ -631,6 +631,12 @@ |
631 | 631 |
|
632 | 632 |
sortByLastPushedDateAndName(projects); |
633 | 633 |
} |
634 |
+ } else { |
|
635 |
+ projects = collectProjects(loginId, user, groupNames); |
|
636 |
+ collectDatum(projects, postings, issues, pullRequests, milestones, daysAgo); |
|
637 |
+ sortDatum(postings, issues, pullRequests, milestones); |
|
638 |
+ |
|
639 |
+ sortByLastPushedDateAndName(projects); |
|
634 | 640 |
} |
635 | 641 |
if (user.isAnonymous()) { |
636 | 642 |
return notFound(ErrorViews.NotFound.render("user.notExists.name")); |
--- app/views/user/partial_milestones.scala.html
+++ app/views/user/partial_milestones.scala.html
... | ... | @@ -60,8 +60,5 @@ |
60 | 60 |
</div> |
61 | 61 |
</div> |
62 | 62 |
</div> |
63 |
- <div class="completion-rate"><!-- |
|
64 |
- -->@milestone.getCompletionRate<!-- |
|
65 |
- --><i>%</i> |
|
66 |
- </div> |
|
63 |
+ <div class="completion-rate">@milestone.getCompletionRate %</div> |
|
67 | 64 |
</li> |
--- app/views/user/partial_projectlist.scala.html
+++ app/views/user/partial_projectlist.scala.html
... | ... | @@ -1,22 +1,8 @@ |
1 | 1 |
@** |
2 |
-* Yobi, Project Hosting SW |
|
2 |
+* Yona, 21st Century Project Hosting SW |
|
3 | 3 |
* |
4 |
-* Copyright 2013 NAVER Corp. |
|
5 |
-* http://yobi.io |
|
6 |
-* |
|
7 |
-* @author Suwon Chae |
|
8 |
-* |
|
9 |
-* Licensed under the Apache License, Version 2.0 (the "License"); |
|
10 |
-* you may not use this file except in compliance with the License. |
|
11 |
-* You may obtain a copy of the License at |
|
12 |
-* |
|
13 |
-* http://www.apache.org/licenses/LICENSE-2.0 |
|
14 |
-* |
|
15 |
-* Unless required by applicable law or agreed to in writing, software |
|
16 |
-* distributed under the License is distributed on an "AS IS" BASIS, |
|
17 |
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
18 |
-* See the License for the specific language governing permissions and |
|
19 |
-* limitations under the License. |
|
4 |
+* Copyright Yona & Yobi Authors & NAVER Corp. |
|
5 |
+* https://yona.io |
|
20 | 6 |
**@ |
21 | 7 |
@(project:Project, user:User) |
22 | 8 |
@import utils.JodaDateUtil._ |
... | ... | @@ -25,49 +11,38 @@ |
25 | 11 |
<li class="project"> |
26 | 12 |
<div class="info-wrap"> |
27 | 13 |
<div class="pull-left"> |
28 |
- <a href="@routes.ProjectApp.project(project.owner, project.name)" class="avatar-wrap large"> |
|
14 |
+ <a href="@routes.ProjectApp.project(project.owner, project.name)" class="avatar-wrap small"> |
|
29 | 15 |
<img src="@urlToProjectLogo(project)"> |
30 | 16 |
</a> |
31 | 17 |
</div> |
32 | 18 |
<div class="pull-left" style="margin-left: 10px;"> |
33 | 19 |
<div class="header"> |
34 |
- <a href="@routes.UserApp.userInfo(project.owner)" class="owner-name-small">@project.owner</a> / <a href="@routes.ProjectApp.project(project.owner, project.name)" class="project-name">@project.name</a> |
|
20 |
+ <a href="@routes.ProjectApp.project(project.owner, project.name)" class="project-name">@project.name</a> |
|
35 | 21 |
@if(project.isPrivate){ <i class="yobicon-lock yobicon-small"></i> } |
36 |
- </div> |
|
37 |
- @if(project.isForkedFromOrigin){ |
|
38 |
- <div class="forked label"> |
|
39 |
- <i class="yobicon-split yobicon-white vmiddle"></i> |
|
40 |
- @Messages("fork.original") |
|
41 |
- <span>/ <a href="@routes.UserApp.userInfo(project.originalProject.owner)">@project.originalProject.owner</a> / </span> |
|
42 |
- <a href="@routes.ProjectApp.project(project.originalProject.owner, project.originalProject.name)">@project.originalProject.name</a> |
|
43 |
- </div> |
|
44 |
- } |
|
45 |
- <div class="desc tag"> |
|
46 |
- @for(label <- project.labels) { |
|
47 |
- <span class="project-label @label.category.toLowerCase">@label.name</span> |
|
22 |
+ @if(project.isForkedFromOrigin){ |
|
23 |
+ <i class="yobicon-split yobicon-white vmiddle"></i> |
|
24 |
+ <span> <a href="@routes.ProjectApp.project(project.originalProject.owner, project.originalProject.name)">@project.originalProject.owner/@project.originalProject.name</a></span> |
|
48 | 25 |
} |
49 | 26 |
</div> |
50 | 27 |
<div class="desc">@project.overview</div> |
51 | 28 |
<div class="name-tag"> |
52 |
- @Messages("project.create") <strong title="@getDateString(project.createdDate)">@agoOrDateString(project.createdDate)</strong> |
|
53 |
- @if(project.lastPushedDateAgo() != null) {, @Messages("project.codeUpdate") <strong title="@getDateString(project.lastPushedDate)">@agoOrDateString(project.lastPushedDate)}</strong> |
|
29 |
+ @Html(Messages("project.onmember", User.findUsersByProject(project.id).size)) <a href="@routes.UserApp.userInfo(project.owner)" class="owner-name-small">@project.owner</a> <span title="@getDateString(project.createdDate)">@agoOrDateString(project.createdDate)</span> |
|
30 |
+ @if(project.lastPushedDateAgo() != null) {, @Messages("project.codeUpdate") <span title="@getDateString(project.lastPushedDate)">@agoOrDateString(project.lastPushedDate)}</span> |
|
54 | 31 |
</div> |
55 | 32 |
</div> |
56 | 33 |
</div> |
57 | 34 |
<div class="stats-wrap pull-right"> |
58 | 35 |
<div class="stats"> |
59 |
- @Html(Messages("project.onmember", User.findUsersByProject(project.id).size))<br/> |
|
60 |
- |
|
61 | 36 |
@if(UserApp.currentUser.loginId != project.owner ){ |
62 | 37 |
@if(User.isWatching(project)){ |
63 |
- <a href="@routes.WatchProjectApp.unwatch(project.owner, project.name)" class="nbtn blue medium watchBtn"> |
|
38 |
+ <a href="@routes.WatchProjectApp.unwatch(project.owner, project.name)" class="ybtn watchBtn"> |
|
64 | 39 |
<i class="yobicon-eye-open yobicon-middle yobicon-white"></i> |
65 |
- @Messages("notification.watch") |
|
40 |
+ @Messages("notification.unwatch") |
|
66 | 41 |
<span class="num-badge">@project.getWatchingCount</span> |
67 | 42 |
</a> |
68 | 43 |
} |
69 | 44 |
@if(!User.isWatching(project) && project.isPublic) { |
70 |
- <a href="@routes.WatchProjectApp.watch(project.owner, project.name)" class="nbtn medium watchBtn"> |
|
45 |
+ <a href="@routes.WatchProjectApp.watch(project.owner, project.name)" class="ybtn watchBtn"> |
|
71 | 46 |
<i class="yobicon-eye-close yobicon-middle yobicon-white"></i> |
72 | 47 |
@Messages("notification.watch") |
73 | 48 |
<span class="num-badge">@project.getWatchingCount</span> |
--- app/views/user/view.scala.html
+++ app/views/user/view.scala.html
... | ... | @@ -91,26 +91,28 @@ |
91 | 91 |
@Messages("project.projects") @showBadgeNumberIfExist(projects.size) |
92 | 92 |
</a> |
93 | 93 |
</li> |
94 |
- <li class="@isActiveTab("postings")"> |
|
95 |
- <a href="#postings" data-toggle="tab"> |
|
96 |
- @Messages("menu.board") @showBadgeNumberIfExist(postings.size) |
|
97 |
- </a> |
|
98 |
- </li> |
|
99 |
- <li class="@isActiveTab("pullRequests")"> |
|
100 |
- <a href="#pullRequests" data-toggle="tab"> |
|
101 |
- @Messages("menu.pullRequest") @showBadgeNumberIfExist(pullRequests.size) |
|
102 |
- </a> |
|
103 |
- </li> |
|
104 |
- <li class="@isActiveTab("issues")"> |
|
105 |
- <a href="#issues" data-toggle="tab"> |
|
106 |
- @Messages("menu.issue") @showBadgeNumberIfExist(issues.size) |
|
107 |
- </a> |
|
108 |
- </li> |
|
109 |
- <li class="@isActiveTab("milestones")"> |
|
110 |
- <a href="#milestones" data-toggle="tab"> |
|
111 |
- @Messages("milestone") @showBadgeNumberIfExist(milestones.size) |
|
112 |
- </a> |
|
113 |
- </li> |
|
94 |
+ @if(user.loginId.equals(UserApp.currentUser().loginId)) { |
|
95 |
+ <li class="@isActiveTab("postings")"> |
|
96 |
+ <a href="#postings" data-toggle="tab"> |
|
97 |
+ @Messages("menu.board") @showBadgeNumberIfExist(postings.size) |
|
98 |
+ </a> |
|
99 |
+ </li> |
|
100 |
+ <li class="@isActiveTab("pullRequests")"> |
|
101 |
+ <a href="#pullRequests" data-toggle="tab"> |
|
102 |
+ @Messages("menu.pullRequest") @showBadgeNumberIfExist(pullRequests.size) |
|
103 |
+ </a> |
|
104 |
+ </li> |
|
105 |
+ <li class="@isActiveTab("issues")"> |
|
106 |
+ <a href="#issues" data-toggle="tab"> |
|
107 |
+ @Messages("menu.issue") @showBadgeNumberIfExist(issues.size) |
|
108 |
+ </a> |
|
109 |
+ </li> |
|
110 |
+ <li class="@isActiveTab("milestones")"> |
|
111 |
+ <a href="#milestones" data-toggle="tab"> |
|
112 |
+ @Messages("milestone") @showBadgeNumberIfExist(milestones.size) |
|
113 |
+ </a> |
|
114 |
+ </li> |
|
115 |
+ } |
|
114 | 116 |
</ul> |
115 | 117 |
|
116 | 118 |
<div class="tab-content"> |
... | ... | @@ -126,54 +128,56 @@ |
126 | 128 |
} |
127 | 129 |
</ul> |
128 | 130 |
</div> |
129 |
- <div id="postings" class="tab-pane @isActiveTab("postings")"> |
|
130 |
- @if(postings.size==0){ |
|
131 |
- <div class="error-wrap"> |
|
132 |
- <p>@Messages("userinfo.daysAgo.prefix") @Messages("post.is.empty")</p> |
|
133 |
- </div> |
|
134 |
- } |
|
135 |
- <ul class="post-list-wrap"> |
|
136 |
- @for(post <- postings){ |
|
131 |
+ @if(user.loginId.equals(UserApp.currentUser().loginId)) { |
|
132 |
+ <div id="postings" class="tab-pane @isActiveTab("postings")"> |
|
133 |
+ @if(postings.size == 0) { |
|
134 |
+ <div class="error-wrap"> |
|
135 |
+ <p>@Messages("userinfo.daysAgo.prefix") @Messages("post.is.empty")</p> |
|
136 |
+ </div> |
|
137 |
+ } |
|
138 |
+ <ul class="post-list-wrap"> |
|
139 |
+ @for(post <- postings) { |
|
137 | 140 |
@partial_postings(post, post.project) |
138 | 141 |
} |
139 |
- </ul> |
|
140 |
- </div> |
|
141 |
- <div id="issues" class="tab-pane @isActiveTab("issues")"> |
|
142 |
- @if(issues.size==0){ |
|
143 |
- <div class="error-wrap"> |
|
144 |
- <p>@Messages("userinfo.daysAgo.prefix") @Messages("issue.is.empty")</p> |
|
145 |
- </div> |
|
146 |
- } |
|
147 |
- <ul class="post-list-wrap row-fluid"> |
|
148 |
- @for(issue <- issues){ |
|
149 |
- @partial_issues(issue, issue.project) |
|
150 |
- } |
|
151 |
- </ul> |
|
152 |
- </div> |
|
153 |
- <div id="pullRequests" class="tab-pane @isActiveTab("pullRequests")"> |
|
154 |
- @if(pullRequests.size==0){ |
|
155 |
- <div class="error-wrap"> |
|
156 |
- <p>@Messages("userinfo.daysAgo.prefix") @Messages("pullRequest.is.empty")</p> |
|
157 |
- </div> |
|
158 |
- } |
|
159 |
- <ul class="post-list-wrap row-fluid"> |
|
160 |
- @for(pull <- pullRequests){ |
|
161 |
- @partial_pullRequests(pull, pull.toProject) |
|
162 |
- } |
|
163 |
- </ul> |
|
164 |
- </div> |
|
165 |
- <div id="milestones" class="tab-pane @isActiveTab("milestones")"> |
|
166 |
- @if(milestones.size==0){ |
|
167 |
- <div class="error-wrap"> |
|
168 |
- <p>@Messages("milestone.is.empty")</p> |
|
169 |
- </div> |
|
170 |
- } |
|
171 |
- <ul class="milestones"> |
|
172 |
- @for(milestone <- milestones){ |
|
173 |
- @partial_milestones(milestone, milestone.project) |
|
174 |
- } |
|
175 |
- </ul> |
|
176 |
- </div> |
|
142 |
+ </ul> |
|
143 |
+ </div> |
|
144 |
+ <div id="issues" class="tab-pane @isActiveTab("issues")"> |
|
145 |
+ @if(issues.size == 0) { |
|
146 |
+ <div class="error-wrap"> |
|
147 |
+ <p>@Messages("userinfo.daysAgo.prefix") @Messages("issue.is.empty")</p> |
|
148 |
+ </div> |
|
149 |
+ } |
|
150 |
+ <ul class="post-list-wrap row-fluid"> |
|
151 |
+ @for(issue <- issues) { |
|
152 |
+ @partial_issues(issue, issue.project) |
|
153 |
+ } |
|
154 |
+ </ul> |
|
155 |
+ </div> |
|
156 |
+ <div id="pullRequests" class="tab-pane @isActiveTab("pullRequests")"> |
|
157 |
+ @if(pullRequests.size == 0) { |
|
158 |
+ <div class="error-wrap"> |
|
159 |
+ <p>@Messages("userinfo.daysAgo.prefix") @Messages("pullRequest.is.empty")</p> |
|
160 |
+ </div> |
|
161 |
+ } |
|
162 |
+ <ul class="post-list-wrap row-fluid"> |
|
163 |
+ @for(pull <- pullRequests) { |
|
164 |
+ @partial_pullRequests(pull, pull.toProject) |
|
165 |
+ } |
|
166 |
+ </ul> |
|
167 |
+ </div> |
|
168 |
+ <div id="milestones" class="tab-pane @isActiveTab("milestones")"> |
|
169 |
+ @if(milestones.size == 0) { |
|
170 |
+ <div class="error-wrap"> |
|
171 |
+ <p>@Messages("milestone.is.empty")</p> |
|
172 |
+ </div> |
|
173 |
+ } |
|
174 |
+ <ul class="milestones"> |
|
175 |
+ @for(milestone <- milestones) { |
|
176 |
+ @partial_milestones(milestone, milestone.project) |
|
177 |
+ } |
|
178 |
+ </ul> |
|
179 |
+ </div> |
|
180 |
+ } |
|
177 | 181 |
</div> |
178 | 182 |
</div> |
179 | 183 |
</section> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?