[Notice] Announcing the End of Demo Server [Read me]

user-expression: improve username expression
- show name & avatar at content page with popover - fix alignment with ago date - remove transparency of tooltip
@dbcebe6bfc775a6459fd41fc8cb4df06ae707f77
--- app/assets/stylesheets/less/_common.less
+++ app/assets/stylesheets/less/_common.less
... | ... | @@ -159,6 +159,7 @@ |
159 | 159 |
.bgorange { background:@orange; } |
160 | 160 |
.bggray { background:#f5f5f5; } |
161 | 161 |
.vmiddle { vertical-align:middle !important; } |
162 |
+.vertical-top { vertical-align:top !important; } |
|
162 | 163 |
.vtop { vertical-align:top !important; } |
163 | 164 |
|
164 | 165 |
/** form elements **/ |
--- app/assets/stylesheets/less/_mixins.less
+++ app/assets/stylesheets/less/_mixins.less
... | ... | @@ -19,9 +19,9 @@ |
19 | 19 |
|
20 | 20 |
// Drop shadows |
21 | 21 |
.box-shadow(@shadow: 0 1px 2px rgba(0, 0, 0, .25)){ |
22 |
- -webkit-box-shadow: @shadow !important; |
|
23 |
- -moz-box-shadow: @shadow !important; |
|
24 |
- box-shadow: @shadow !important; |
|
22 |
+ -webkit-box-shadow: @shadow; |
|
23 |
+ -moz-box-shadow: @shadow; |
|
24 |
+ box-shadow: @shadow; |
|
25 | 25 |
} |
26 | 26 |
|
27 | 27 |
// Transitions |
--- app/assets/stylesheets/less/_override.less
+++ app/assets/stylesheets/less/_override.less
... | ... | @@ -343,3 +343,14 @@ |
343 | 343 |
.select2-chosen .branch-label { |
344 | 344 |
margin-top:-2px; |
345 | 345 |
} |
346 |
+ |
|
347 |
+.tooltip { |
|
348 |
+ font-size: 12px; |
|
349 |
+} |
|
350 |
+ |
|
351 |
+.tooltip.in { |
|
352 |
+ font-size: 12px; |
|
353 |
+ opacity: 1; |
|
354 |
+ filter: alpha(opacity=100); |
|
355 |
+} |
|
356 |
+ |
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
... | ... | @@ -6165,3 +6165,19 @@ |
6165 | 6165 |
text-align: center; |
6166 | 6166 |
font-weight: bold; |
6167 | 6167 |
} |
6168 |
+ |
|
6169 |
+.no-margin-no-padding { |
|
6170 |
+ margin: 0px !important; |
|
6171 |
+ padding: 0px !important; |
|
6172 |
+ box-shadow: none !important; |
|
6173 |
+ border: none !important; |
|
6174 |
+} |
|
6175 |
+ |
|
6176 |
+.no-text-decoration{ |
|
6177 |
+ text-decoration: none !important; |
|
6178 |
+} |
|
6179 |
+ |
|
6180 |
+.ago-date { |
|
6181 |
+ vertical-align: middle; |
|
6182 |
+} |
|
6183 |
+ |
--- app/utils/AutoLinkRenderer.java
+++ app/utils/AutoLinkRenderer.java
... | ... | @@ -20,11 +20,13 @@ |
20 | 20 |
*/ |
21 | 21 |
package utils; |
22 | 22 |
|
23 |
+import controllers.UserApp; |
|
23 | 24 |
import models.Issue; |
24 | 25 |
import models.Project; |
25 | 26 |
import models.User; |
26 | 27 |
import org.apache.commons.lang.ArrayUtils; |
27 | 28 |
import org.apache.commons.lang.StringUtils; |
29 |
+import org.apache.commons.lang3.StringEscapeUtils; |
|
28 | 30 |
import org.jsoup.Jsoup; |
29 | 31 |
import org.jsoup.nodes.Document; |
30 | 32 |
import org.jsoup.nodes.Element; |
... | ... | @@ -313,7 +315,13 @@ |
313 | 315 |
if (user.isAnonymous()) { |
314 | 316 |
return Link.EMPTY_LINK; |
315 | 317 |
} else { |
316 |
- return new Link(RouteUtil.getUrl(user), "@" + user.loginId); |
|
318 |
+ String avatarImage; |
|
319 |
+ if( user.avatarUrl().equals(UserApp.DEFAULT_AVATAR_URL) ){ |
|
320 |
+ avatarImage = ""; |
|
321 |
+ } else { |
|
322 |
+ avatarImage = "<img src='" + user.avatarUrl() + "' class='avatar-wrap smaller no-margin-no-padding vertical-top' alt='@" + user.loginId + "'> "; |
|
323 |
+ } |
|
324 |
+ return new Link(RouteUtil.getUrl(user), "no-text-decoration", "<span data-toggle='popover' data-placement='top' data-trigger='hover' data-html='true' data-content=\"" + StringEscapeUtils.escapeHtml4(avatarImage + user.name) + "\">" + user.loginId + "</span>"); |
|
317 | 325 |
} |
318 | 326 |
} |
319 | 327 |
|
--- app/views/board/partial_comments.scala.html
+++ app/views/board/partial_comments.scala.html
... | ... | @@ -50,7 +50,9 @@ |
50 | 50 |
<strong>@comment.authorLoginId </strong> |
51 | 51 |
</a> |
52 | 52 |
</span> |
53 |
- <a href="#comment-@comment.id" class="ago" title="@JodaDateUtil.getDateString(comment.createdDate)">@utils.TemplateHelper.agoOrDateString(comment.createdDate)</a> |
|
53 |
+ <span class="ago-date"> |
|
54 |
+ <a href="#comment-@comment.id" class="ago" title="@JodaDateUtil.getDateString(comment.createdDate)">@utils.TemplateHelper.agoOrDateString(comment.createdDate)</a> |
|
55 |
+ </span> |
|
54 | 56 |
<span class="act-row pull-right"> |
55 | 57 |
@if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.UPDATE)) { |
56 | 58 |
<button type="button" class="btn-transparent mr10" data-toggle="comment-edit" data-comment-id="@comment.id" title="@Messages("common.comment.edit")"><i class="yobicon-edit-2"></i></button> |
--- app/views/issue/partial_comments.scala.html
+++ app/views/issue/partial_comments.scala.html
... | ... | @@ -88,7 +88,9 @@ |
88 | 88 |
<strong>@comment.authorLoginId </strong> |
89 | 89 |
</a> |
90 | 90 |
</span> |
91 |
- <a href="#comment-@comment.id" class="ago" title="@JodaDateUtil.getDateString(comment.createdDate)">@utils.TemplateHelper.agoOrDateString(comment.createdDate)</a> |
|
91 |
+ <span class="ago-date"> |
|
92 |
+ <a href="#comment-@comment.id" class="ago" title="@JodaDateUtil.getDateString(comment.createdDate)">@utils.TemplateHelper.agoOrDateString(comment.createdDate)</a> |
|
93 |
+ </span> |
|
92 | 94 |
<span class="act-row pull-right"> |
93 | 95 |
@if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.READ) && comment.isInstanceOf[IssueComment]) { |
94 | 96 |
@defining(comment.asInstanceOf[IssueComment]) { issueComment => |
--- public/javascripts/common/yobi.Common.js
+++ public/javascripts/common/yobi.Common.js
... | ... | @@ -113,6 +113,8 @@ |
113 | 113 |
oModule = oModule[sDepth]; |
114 | 114 |
} |
115 | 115 |
|
116 |
+ $("[data-toggle=popover]").popover(); |
|
117 |
+ |
|
116 | 118 |
// temporary code for compatibility with nForge |
117 | 119 |
var oInstance; |
118 | 120 |
if(typeof oModule == "undefined"){ |
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?