i18n: Support english name if exist in LDAP
@730a4b7a6f1c0d73d17f46355c0947fc07e4dc4d
--- app/controllers/ProjectApp.java
+++ app/controllers/ProjectApp.java
... | ... | @@ -176,7 +176,7 @@ |
176 | 176 |
|
177 | 177 |
if ((!AccessControl.isGlobalResourceCreatable(user)) |
178 | 178 |
|| (Organization.isNameExist(owner) && !OrganizationUser.isAdmin(organization.id, user.id))) { |
179 |
- return forbidden(ErrorViews.Forbidden.render("'" + user.name + "' has no permission")); |
|
179 |
+ return forbidden(ErrorViews.Forbidden.render("'" + user.getDisplayName() + "' has no permission")); |
|
180 | 180 |
} |
181 | 181 |
|
182 | 182 |
if (validateWhenNew(filledNewProjectForm)) { |
... | ... | @@ -841,8 +841,8 @@ |
841 | 841 |
Map<String, String> projectUserMap = new HashMap<>(); |
842 | 842 |
if (user != null && StringUtils.isNotEmpty(user.loginId) && !user.loginId.equals(Constants.ADMIN_LOGIN_ID)) { |
843 | 843 |
projectUserMap.put("loginid", user.loginId); |
844 |
- projectUserMap.put("searchText", user.name + user.loginId); |
|
845 |
- projectUserMap.put("name", user.name); |
|
844 |
+ projectUserMap.put("searchText", user.getDisplayName() + user.loginId); |
|
845 |
+ projectUserMap.put("name", user.getDisplayName()); |
|
846 | 846 |
projectUserMap.put("image", user.avatarUrl()); |
847 | 847 |
users.add(projectUserMap); |
848 | 848 |
} |
--- app/controllers/UserApp.java
+++ app/controllers/UserApp.java
... | ... | @@ -1166,6 +1166,9 @@ |
1166 | 1166 |
|
1167 | 1167 |
localUserFoundByLdapLogin.refresh(); |
1168 | 1168 |
localUserFoundByLdapLogin.name = ldapUser.getDisplayName(); |
1169 |
+ if(StringUtils.isNotBlank(ldapUser.getEnglishName())){ |
|
1170 |
+ localUserFoundByLdapLogin.englishName = ldapUser.getEnglishName(); |
|
1171 |
+ } |
|
1169 | 1172 |
localUserFoundByLdapLogin.isGuest = ldapUser.isGuestUser(); |
1170 | 1173 |
localUserFoundByLdapLogin.update(); |
1171 | 1174 |
return localUserFoundByLdapLogin; |
--- app/controllers/api/IssueApi.java
+++ app/controllers/api/IssueApi.java
... | ... | @@ -387,7 +387,7 @@ |
387 | 387 |
private static void addUserToUsers(User user, List<ObjectNode> users) { |
388 | 388 |
ObjectNode userNode = Json.newObject(); |
389 | 389 |
userNode.put("loginId", user.loginId); |
390 |
- userNode.put("name", user.name); |
|
390 |
+ userNode.put("name", user.getDisplayName()); |
|
391 | 391 |
userNode.put("avatarUrl", user.avatarUrl()); |
392 | 392 |
|
393 | 393 |
if(!users.contains(userNode)) { |
... | ... | @@ -460,7 +460,7 @@ |
460 | 460 |
if(assigneeUser.isAnonymous()){ |
461 | 461 |
node.put("name", Messages.get("common.none")); |
462 | 462 |
} else { |
463 |
- node.put("name", assigneeUser.name); |
|
463 |
+ node.put("name", assigneeUser.getDisplayName()); |
|
464 | 464 |
} |
465 | 465 |
result.put("assignee", node); |
466 | 466 |
} |
--- app/models/User.java
+++ app/models/User.java
... | ... | @@ -74,6 +74,7 @@ |
74 | 74 |
* name to show at web pages |
75 | 75 |
*/ |
76 | 76 |
public String name; |
77 |
+ public String englishName; |
|
77 | 78 |
|
78 | 79 |
@Pattern(value = "^" + LOGIN_ID_PATTERN + "$", message = "user.wrongloginId.alert") |
79 | 80 |
@Required |
... | ... | @@ -993,6 +994,9 @@ |
993 | 994 |
} |
994 | 995 |
|
995 | 996 |
public String getPureNameOnly(){ |
997 |
+ if (StringUtils.isNotBlank(englishName) && lang != null && UserApp.currentUser().lang.startsWith("en")) { |
|
998 |
+ return englishName; |
|
999 |
+ } |
|
996 | 1000 |
String pureName = this.name; |
997 | 1001 |
String [] spliters = { "[", "(" }; |
998 | 1002 |
for(String spliter: spliters) { |
... | ... | @@ -1003,4 +1007,25 @@ |
1003 | 1007 |
|
1004 | 1008 |
return pureName; |
1005 | 1009 |
} |
1010 |
+ |
|
1011 |
+ public String extractDepartmentPart(){ |
|
1012 |
+ String departmentName = this.name; |
|
1013 |
+ String [] spliters = { "[", "(" }; |
|
1014 |
+ for(String spliter: spliters) { |
|
1015 |
+ if(departmentName.contains(spliter)){ |
|
1016 |
+ departmentName = this.name.substring(this.name.indexOf(spliter)); |
|
1017 |
+ } |
|
1018 |
+ } |
|
1019 |
+ |
|
1020 |
+ return departmentName; |
|
1021 |
+ |
|
1022 |
+ } |
|
1023 |
+ |
|
1024 |
+ public String getDisplayName(){ |
|
1025 |
+ if (StringUtils.isNotBlank(englishName) && lang != null && UserApp.currentUser().lang.startsWith("en")) { |
|
1026 |
+ return englishName + " " + extractDepartmentPart(); |
|
1027 |
+ } else { |
|
1028 |
+ return name; |
|
1029 |
+ } |
|
1030 |
+ } |
|
1006 | 1031 |
} |
--- app/models/support/LdapUser.java
+++ app/models/support/LdapUser.java
... | ... | @@ -24,8 +24,10 @@ |
24 | 24 |
private Attribute email; |
25 | 25 |
private Attribute userLoginId; |
26 | 26 |
private Attribute department; |
27 |
+ private Attribute englishName; |
|
27 | 28 |
|
28 |
- public LdapUser(Attribute displayName, Attribute email, Attribute userLoginId, Attribute department) { |
|
29 |
+ public LdapUser(Attribute displayName, Attribute email, Attribute userLoginId, |
|
30 |
+ Attribute department) { |
|
29 | 31 |
this.displayName = displayName; |
30 | 32 |
this.email = email; |
31 | 33 |
this.userLoginId = userLoginId; |
... | ... | @@ -88,14 +90,22 @@ |
88 | 90 |
return getString(department); |
89 | 91 |
} |
90 | 92 |
|
93 |
+ public void setEnglishName(Attribute englishName) { |
|
94 |
+ this.englishName = englishName; |
|
95 |
+ } |
|
96 |
+ |
|
97 |
+ public String getEnglishName() { |
|
98 |
+ return getString(englishName); |
|
99 |
+ } |
|
100 |
+ |
|
91 | 101 |
@Override |
92 | 102 |
public String toString() { |
93 | 103 |
return "LdapUser{" + |
94 |
- "displayName='" + getDisplayName() + '\'' + |
|
95 |
- ", email='" + getEmail() + '\'' + |
|
96 |
- ", userId='" + getUserLoginId() + '\'' + |
|
97 |
- ", department='" + getDepartment() + '\'' + |
|
98 |
- ", isGuest='" + isGuestUser() + '\'' + |
|
104 |
+ "displayName=" + displayName + |
|
105 |
+ ", email=" + email + |
|
106 |
+ ", userLoginId=" + userLoginId + |
|
107 |
+ ", department=" + department + |
|
108 |
+ ", englishName=" + englishName + |
|
99 | 109 |
'}'; |
100 | 110 |
} |
101 | 111 |
} |
--- app/utils/LdapService.java
+++ app/utils/LdapService.java
... | ... | @@ -8,6 +8,7 @@ |
8 | 8 |
|
9 | 9 |
import models.User; |
10 | 10 |
import models.support.LdapUser; |
11 |
+import org.apache.commons.lang3.StringUtils; |
|
11 | 12 |
import play.Play; |
12 | 13 |
|
13 | 14 |
import javax.annotation.Nonnull; |
... | ... | @@ -33,6 +34,8 @@ |
33 | 34 |
".options.fallbackToLocalLogin", false); |
34 | 35 |
private static final String EMAIL_PROPERTY = Play.application().configuration().getString("ldap" + |
35 | 36 |
".emailProperty", "mail"); |
37 |
+ private static final String ENGLISH_NAME_PROPERTY = Play.application().configuration() |
|
38 |
+ .getString("ldap.options.englishNameAttributeName", ""); |
|
36 | 39 |
private static final int TIMEOUT = 5000; //ms |
37 | 40 |
|
38 | 41 |
public LdapUser authenticate(String username, String password) throws NamingException { |
... | ... | @@ -74,10 +77,16 @@ |
74 | 77 |
|
75 | 78 |
private LdapUser getLdapUser(SearchResult searchResult) throws NamingException { |
76 | 79 |
Attributes attr = searchResult.getAttributes(); |
77 |
- return new LdapUser(attr.get(DISPLAY_NAME_PROPERTY), |
|
80 |
+ LdapUser ldapUser = new LdapUser(attr.get(DISPLAY_NAME_PROPERTY), |
|
78 | 81 |
attr.get(EMAIL_PROPERTY), |
79 | 82 |
attr.get(LOGIN_PROPERTY), |
80 | 83 |
attr.get("department")); |
84 |
+ |
|
85 |
+ if(StringUtils.isNotBlank(ENGLISH_NAME_PROPERTY)){ |
|
86 |
+ ldapUser.setEnglishName(attr.get(ENGLISH_NAME_PROPERTY)); |
|
87 |
+ } |
|
88 |
+ |
|
89 |
+ return ldapUser; |
|
81 | 90 |
} |
82 | 91 |
|
83 | 92 |
private String searchFilter(@Nonnull String username) { |
--- app/views/board/partial_list.scala.html
+++ app/views/board/partial_list.scala.html
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 |
<div class="infos"> |
31 | 31 |
@if(user.name){ |
32 | 32 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="infos-item infos-link-item" data-toggle="tooltip" data-placement="bottom" title="@user.loginId"> |
33 |
- @user.name |
|
33 |
+ @user.getDisplayName |
|
34 | 34 |
</a> |
35 | 35 |
} else { |
36 | 36 |
<span class="infos-item">@Messages("issue.noAuthor")</span> |
--- app/views/git/partial_list.scala.html
+++ app/views/git/partial_list.scala.html
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 |
<div class="infos"> |
34 | 34 |
@if(user.name){ |
35 | 35 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="infos-item infos-link-item" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
36 |
- @user.name |
|
36 |
+ @user.getDisplayName |
|
37 | 37 |
</a> |
38 | 38 |
} else { |
39 | 39 |
<span class="infos-item">@Messages("issue.noAuthor")</span> |
--- app/views/git/partial_pull_request_event.scala.html
+++ app/views/git/partial_pull_request_event.scala.html
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 |
@if(event.getNewValue == PullRequestReviewAction.DONE.name) { |
56 | 56 |
<li class="event" id="comment-@event.id"> |
57 | 57 |
<span class="state changed">@Messages("pullRequest.review")</span> |
58 |
- @Html(Messages("notification.pullrequest.reviewed",linkToUser(user.loginId, user.name))) |
|
58 |
+ @Html(Messages("notification.pullrequest.reviewed",linkToUser(user.loginId, user.getDisplayName))) |
|
59 | 59 |
<span class="date"> |
60 | 60 |
<a href="#event-@event.id" title="@getDateString(event.getDate())">@agoOrDateString(event.getDate())</a> |
61 | 61 |
</span> |
... | ... | @@ -63,7 +63,7 @@ |
63 | 63 |
} else { |
64 | 64 |
<li class="event" id="comment-@event.id"> |
65 | 65 |
<span class="state changed">@Messages("pullRequest.unreview")</span> |
66 |
- @Html(Messages("notification.pullrequest.unreviewed", linkToUser(user.loginId, user.name))) |
|
66 |
+ @Html(Messages("notification.pullrequest.unreviewed", linkToUser(user.loginId, user.getDisplayName))) |
|
67 | 67 |
<span class="date"> |
68 | 68 |
<a href="#event-@event.id" title="@getDateString(event.getDate())">@agoOrDateString(event.getDate())</a> |
69 | 69 |
</span> |
... | ... | @@ -75,11 +75,11 @@ |
75 | 75 |
<span class="state @event.getNewValue">@Messages("pullRequest.event." + event.getNewValue)</span> |
76 | 76 |
@State.getValue(event.getNewValue) match { |
77 | 77 |
case State.MERGED => { |
78 |
- @Html(Messages("pullRequest.event.message." + event.getNewValue, linkToUser(user.loginId, user.name), |
|
78 |
+ @Html(Messages("pullRequest.event.message." + event.getNewValue, linkToUser(user.loginId, user.getDisplayName), |
|
79 | 79 |
linkToCommit(event.pullRequest.toProject, event.pullRequest.mergedCommitIdTo))) |
80 | 80 |
} |
81 | 81 |
case _ => { |
82 |
- @Html(Messages("pullRequest.event.message." + event.getNewValue, linkToUser(user.loginId, user.name))) |
|
82 |
+ @Html(Messages("pullRequest.event.message." + event.getNewValue, linkToUser(user.loginId, user.getDisplayName))) |
|
83 | 83 |
} |
84 | 84 |
} |
85 | 85 |
<span class="date"> |
... | ... | @@ -91,7 +91,7 @@ |
91 | 91 |
case EventType.PULL_REQUEST_MERGED => { |
92 | 92 |
<li class="event" id="comment-@event.id"> |
93 | 93 |
<span class="state @event.getNewValue">@Messages("pullRequest.event." + event.getNewValue)</span> |
94 |
- @Html(Messages("pullRequest.event.message." + event.getNewValue, linkToUser(user.loginId, user.name))) |
|
94 |
+ @Html(Messages("pullRequest.event.message." + event.getNewValue, linkToUser(user.loginId, user.getDisplayName))) |
|
95 | 95 |
<span class="date"> |
96 | 96 |
<a href="#event-@event.id" title="@getDateString(event.getDate())">@agoOrDateString(event.getDate())</a> |
97 | 97 |
</span> |
... | ... | @@ -101,7 +101,7 @@ |
101 | 101 |
case EventType.PULL_REQUEST_COMMIT_CHANGED => { |
102 | 102 |
<li class="event" id="comment-@event.id"> |
103 | 103 |
<span class="state changed">@Messages("pullRequest.event.commit")</span> |
104 |
- @Html(Messages("pullRequest.event.message.commit", linkToUser(user.loginId, user.name))) |
|
104 |
+ @Html(Messages("pullRequest.event.message.commit", linkToUser(user.loginId, user.getDisplayName))) |
|
105 | 105 |
<span class="date"> |
106 | 106 |
<a href="#event-@event.id" title="@getDateString(event.getDate())">@agoOrDateString(event.getDate())</a> |
107 | 107 |
</span> |
--- app/views/index/partial_notifications.scala.html
+++ app/views/index/partial_notifications.scala.html
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 |
</div> |
81 | 81 |
} |
82 | 82 |
@if(user != null) { |
83 |
- <a href="@routes.UserApp.userInfo(user.loginId)" class="author">@user.name</a>@@@user.loginId |
|
83 |
+ <a href="@routes.UserApp.userInfo(user.loginId)" class="author">@user.getDisplayName</a>@@@user.loginId |
|
84 | 84 |
} |
85 | 85 |
<span class="ago pull-right" title="@JodaDateUtil.getDateString(noti.created)"> |
86 | 86 |
@agoOrDateString(noti.created) |
--- app/views/issue/my_partial_list.scala.html
+++ app/views/issue/my_partial_list.scala.html
... | ... | @@ -41,7 +41,7 @@ |
41 | 41 |
@if(!isAuthoredMeTab) { |
42 | 42 |
@if(user.name) { |
43 | 43 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="infos-item infos-link-item" data-toggle="tooltip" data-placement="bottom" title="@user.loginId"> |
44 |
- @user.name |
|
44 |
+ @user.getDisplayName |
|
45 | 45 |
</a> |
46 | 46 |
} else { |
47 | 47 |
<span class="infos-item">@Messages("issue.noAuthor")</span> |
--- app/views/issue/partial_assignee.scala.html
+++ app/views/issue/partial_assignee.scala.html
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 |
data-login-id="@user.loginId" |
14 | 14 |
@if(!users.contains(user)) { data-non-member="true" } |
15 | 15 |
@flag> |
16 |
- @user.name |
|
16 |
+ @user.getDisplayName |
|
17 | 17 |
</option> |
18 | 18 |
} |
19 | 19 |
|
--- app/views/issue/partial_comments.scala.html
+++ app/views/issue/partial_comments.scala.html
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 |
<img src="@User.findByLoginId(comment.authorLoginId).avatarUrl(64)" width="32" height="32" alt="@comment.authorLoginId"> |
81 | 81 |
</a> |
82 | 82 |
</span> |
83 |
- <a href="@userInfo(comment.authorLoginId)" data-toggle="tooltip" data-placement="top" title="@comment.authorLoginId"><strong>@comment.authorName</strong></a> |
|
83 |
+ <a href="@userInfo(comment.authorLoginId)" data-toggle="tooltip" data-placement="top" title="@comment.authorLoginId"><strong>@User.findByLoginId(comment.authorLoginId).getDisplayName</strong></a> |
|
84 | 84 |
</span> |
85 | 85 |
<span class="ago-date"> |
86 | 86 |
<a href="#comment-@comment.id" class="ago" title="@JodaDateUtil.getDateString(comment.createdDate)">@utils.TemplateHelper.agoOrDateString(comment.createdDate)</a> |
... | ... | @@ -158,28 +158,28 @@ |
158 | 158 |
@defining(User.findByLoginId(event.senderLoginId)) { user => |
159 | 159 |
@event.eventType match { |
160 | 160 |
case EventType.ISSUE_STATE_CHANGED => { |
161 |
- <span class="state @event.newValue">@Messages("issue.state." + event.newValue)</span> @Html(Messages("issue.event." + event.newValue, linkToUser(user.loginId, user.name))) |
|
161 |
+ <span class="state @event.newValue">@Messages("issue.state." + event.newValue)</span> @Html(Messages("issue.event." + event.newValue, linkToUser(user.loginId, user.getDisplayName))) |
|
162 | 162 |
} |
163 | 163 |
case EventType.ISSUE_ASSIGNEE_CHANGED => { |
164 | 164 |
<span class="state changed">@Messages("issue.state.assigned")</span> |
165 |
- @Html(Messages(assginedMesssage(event.newValue, user), linkToUser(user.loginId, user.name), linkToUser(event.newValue,User.findByLoginId(event.newValue).name, true))) |
|
165 |
+ @Html(Messages(assginedMesssage(event.newValue, user), linkToUser(user.loginId, user.getDisplayName), linkToUser(event.newValue,User.findByLoginId(event.newValue).getDisplayName, true))) |
|
166 | 166 |
} |
167 | 167 |
case EventType.ISSUE_REFERRED_FROM_COMMIT => { |
168 | 168 |
<span class="state changed">@Messages("issue.event.referred.title")</span> |
169 |
- @Html(Messages("issue.event.referred",linkToUser(user.loginId, user.name),linkToCommit(event.newValue))) |
|
169 |
+ @Html(Messages("issue.event.referred",linkToUser(user.loginId, user.getDisplayName),linkToCommit(event.newValue))) |
|
170 | 170 |
} |
171 | 171 |
case EventType.ISSUE_MOVED => { |
172 | 172 |
<span class="state changed">@Messages("issue.event.moved.title")</span> |
173 |
- @Html(Messages("issue.event.moved", linkToUser(user.loginId, user.name), linkToProject(event.oldValue.split("/")(0), event.oldValue.split("/")(1)))) |
|
173 |
+ @Html(Messages("issue.event.moved", linkToUser(user.loginId, user.getDisplayName), linkToProject(event.oldValue.split("/")(0), event.oldValue.split("/")(1)))) |
|
174 | 174 |
} |
175 | 175 |
case EventType.ISSUE_REFERRED_FROM_PULL_REQUEST => { |
176 | 176 |
<span class="state changed">@Messages("issue.event.referred.title")</span> |
177 | 177 |
@defining(PullRequest.findById(Long.valueOf(event.newValue))) { pull => |
178 |
- @Html(Messages("issue.event.referred",linkToUser(user.loginId, user.name),linkToPullRequest(pull))) |
|
178 |
+ @Html(Messages("issue.event.referred",linkToUser(user.loginId, user.getDisplayName),linkToPullRequest(pull))) |
|
179 | 179 |
} |
180 | 180 |
} |
181 | 181 |
case _ => { |
182 |
- @event.newValue by @linkToUser(user.loginId, user.name) |
|
182 |
+ @event.newValue by @linkToUser(user.loginId, user.getDisplayName) |
|
183 | 183 |
} |
184 | 184 |
} |
185 | 185 |
} |
--- app/views/issue/partial_list.scala.html
+++ app/views/issue/partial_list.scala.html
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 |
} |
29 | 29 |
<div for="issue-@issue.id" class="issue-item-row"> |
30 | 30 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="avatar-wrap mlarge hide-in-mobile" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
31 |
- <img src="@User.findByLoginId(issue.authorLoginId).avatarUrl(64)" alt="@user.name" width="32" height="32"/> |
|
31 |
+ <img src="@User.findByLoginId(issue.authorLoginId).avatarUrl(64)" alt="@user.getDisplayName" width="32" height="32"/> |
|
32 | 32 |
</a> |
33 | 33 |
<div class="title-wrap"> |
34 | 34 |
<a href="@routes.IssueApp.issue(project.owner, project.name, issue.getNumber)" class="title"> |
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 |
<div class="infos"> |
43 | 43 |
@if(user.name){ |
44 | 44 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="infos-item infos-link-item" data-toggle="tooltip" data-placement="bottom" title="@user.loginId"> |
45 |
- @user.name |
|
45 |
+ @user.getDisplayName |
|
46 | 46 |
</a> |
47 | 47 |
} else { |
48 | 48 |
<span class="infos-item">@Messages("issue.noAuthor")</span> |
--- app/views/issue/partial_massupdate.scala.html
+++ app/views/issue/partial_massupdate.scala.html
... | ... | @@ -75,7 +75,7 @@ |
75 | 75 |
<span class="avatar-wrap smaller"> |
76 | 76 |
<img src="@user.avatarUrl(32)" width="20" height="20"> |
77 | 77 |
</span> |
78 |
- <strong class="name">@user.name</strong> |
|
78 |
+ <strong class="name">@user.getDisplayName</strong> |
|
79 | 79 |
<span class="loginid"> <strong>@{"@"}</strong>@user.loginId</span> |
80 | 80 |
</a> |
81 | 81 |
</li> |
--- app/views/issue/partial_searchform.scala.html
+++ app/views/issue/partial_searchform.scala.html
... | ... | @@ -63,7 +63,7 @@ |
63 | 63 |
} |
64 | 64 |
data-avatar-url="@user.avatarUrl" |
65 | 65 |
data-login-id="@user.loginId"> |
66 |
- @user.name |
|
66 |
+ @user.getDisplayName |
|
67 | 67 |
</option> |
68 | 68 |
} |
69 | 69 |
</select> |
--- app/views/issue/view.scala.html
+++ app/views/issue/view.scala.html
... | ... | @@ -136,7 +136,7 @@ |
136 | 136 |
<img src="@User.findByLoginId(issue.authorLoginId).avatarUrl(32)" width="20" height="20"> |
137 | 137 |
</span> |
138 | 138 |
@if(issue.authorLoginId != null){ |
139 |
- <strong class="name">@issue.getAuthor.name</strong> |
|
139 |
+ <strong class="name">@issue.getAuthor.getDisplayName</strong> |
|
140 | 140 |
<span class="loginid"> <strong>@{"@"}</strong>@issue.authorLoginId</span> |
141 | 141 |
} else { |
142 | 142 |
<strong class="name">@Messages("issue.noAuthor")</strong> |
... | ... | @@ -257,7 +257,7 @@ |
257 | 257 |
<span class="avatar-wrap smaller"> |
258 | 258 |
<img src="@User.findByLoginId(issue.assignee.user.loginId).avatarUrl" width="20" height="20"> |
259 | 259 |
</span> |
260 |
- <strong class="name">@issue.assigneeName</strong> |
|
260 |
+ <strong class="name">@issue.assignee.user.getDisplayName</strong> |
|
261 | 261 |
<span class="loginid"> <strong>@{"@"}</strong>@issue.assignee.user.loginId</span> |
262 | 262 |
</a> |
263 | 263 |
} else { |
--- app/views/organization/group_board_list_partial.scala.html
+++ app/views/organization/group_board_list_partial.scala.html
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 |
<div class="infos"> |
40 | 40 |
@if(user.name){ |
41 | 41 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="infos-item infos-link-item" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
42 |
- @user.name |
|
42 |
+ @user.getDisplayName |
|
43 | 43 |
</a> |
44 | 44 |
} else { |
45 | 45 |
<span class="infos-item">@Messages("issue.noAuthor")</span> |
--- app/views/organization/group_issue_list_partial.scala.html
+++ app/views/organization/group_issue_list_partial.scala.html
... | ... | @@ -48,7 +48,7 @@ |
48 | 48 |
<div class="infos"> |
49 | 49 |
@if(user.name){ |
50 | 50 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="infos-item infos-link-item" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
51 |
- @user.name |
|
51 |
+ @user.getDisplayName |
|
52 | 52 |
</a> |
53 | 53 |
} else { |
54 | 54 |
<span class="infos-item">@Messages("issue.noAuthor")</span> |
--- app/views/organization/members.scala.html
+++ app/views/organization/members.scala.html
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 |
<a href="@routes.UserApp.userInfo(member.user.loginId)" class="avatar-wrap mlarge pull-left mr10"> |
52 | 52 |
<img src="@User.findByLoginId(member.user.loginId).avatarUrl" width="64" height="64"> |
53 | 53 |
</a> |
54 |
- <div class="member-name">@member.user.name</div> |
|
54 |
+ <div class="member-name">@member.user.getDisplayName</div> |
|
55 | 55 |
<div class="member-id">@{"@"}@member.user.loginId</div> |
56 | 56 |
<div class="member-setting"> |
57 | 57 |
<div class="btn-group" data-name="roleof-@member.user.loginId"> |
... | ... | @@ -99,7 +99,7 @@ |
99 | 99 |
</a> |
100 | 100 |
</div> |
101 | 101 |
<div class="pull-left" style="width: 60px;"> |
102 |
- <span><a href="@routes.UserApp.userInfo(user.loginId)"><strong>@user.name</strong></a></span> |
|
102 |
+ <span><a href="@routes.UserApp.userInfo(user.loginId)"><strong>@user.getDisplayName</strong></a></span> |
|
103 | 103 |
<span>(@user.loginId)</span> |
104 | 104 |
<button type="button" class="ybtn ybtn-info ybtn-mini blue enrollAcceptBtn" data-loginId="@user.loginId"><i class="yobicon-addfriend"></i>@Messages("button.add")</button> |
105 | 105 |
</div> |
--- app/views/organization/view.scala.html
+++ app/views/organization/view.scala.html
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 |
<img src="@organizationUser.user.avatarUrl" height="45" width="45" /> |
39 | 39 |
</a> |
40 | 40 |
<a href="@routes.UserApp.userInfo(organizationUser.user.loginId)" data-toggle="tooltip" data-placement="top" title="@organizationUser.user.loginId"> |
41 |
- @organizationUser.user.name |
|
41 |
+ @organizationUser.user.getDisplayName |
|
42 | 42 |
</a> |
43 | 43 |
</li> |
44 | 44 |
} |
--- app/views/project/home.scala.html
+++ app/views/project/home.scala.html
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 |
<img src="@member.avatarUrl" alt="@member.loginId" width="24" height="24"> |
133 | 133 |
</a> |
134 | 134 |
<a href="@routes.UserApp.userInfo(member.loginId)" class="name"> |
135 |
- <strong>@member.name (@member.loginId)</strong> |
|
135 |
+ <strong>@member.getDisplayName (@member.loginId)</strong> |
|
136 | 136 |
</a> |
137 | 137 |
</li> |
138 | 138 |
} |
--- app/views/project/members.scala.html
+++ app/views/project/members.scala.html
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 |
<a href="@routes.UserApp.userInfo(member.user.loginId)" class="avatar-wrap mlarge pull-left mr10"> |
52 | 52 |
<img src="@User.findByLoginId(member.user.loginId).avatarUrl" width="64" height="64"> |
53 | 53 |
</a> |
54 |
- <div class="member-name">@member.user.name</div> |
|
54 |
+ <div class="member-name">@member.user.getDisplayName</div> |
|
55 | 55 |
<div class="member-id">@{"@"}@member.user.loginId @if(member.user.isGuest){<span class="guest">GUEST</span>}</div> |
56 | 56 |
<div class="member-setting"> |
57 | 57 |
@if(!project.isOwner(member.user)) { |
... | ... | @@ -88,7 +88,7 @@ |
88 | 88 |
</a> |
89 | 89 |
</div> |
90 | 90 |
<div class="pull-left" style="width: 60px;"> |
91 |
- <span><a href="@routes.UserApp.userInfo(user.loginId)"><strong>@user.name</strong></a></span> |
|
91 |
+ <span><a href="@routes.UserApp.userInfo(user.loginId)"><strong>@user.getDisplayName</strong></a></span> |
|
92 | 92 |
<span>(@user.loginId)</span> |
93 | 93 |
<button type="button" class="ybtn ybtn-info ybtn-mini blue enrollAcceptBtn" data-loginId="@user.loginId"><i class="yobicon-addfriend"></i> @Messages("button.add")</button> |
94 | 94 |
</div> |
--- app/views/project/watchers.scala.html
+++ app/views/project/watchers.scala.html
... | ... | @@ -19,7 +19,7 @@ |
19 | 19 |
<a href="@routes.UserApp.userInfo(member.loginId)" class="avatar-wrap mlarge pull-left mr10"> |
20 | 20 |
<img src="@User.findByLoginId(member.loginId).avatarUrl" width="64" height="64"> |
21 | 21 |
</a> |
22 |
- <div class="member-name">@member.name</div> |
|
22 |
+ <div class="member-name">@member.getDisplayName</div> |
|
23 | 23 |
<div class="member-id">@{"@"}@member.loginId</div> |
24 | 24 |
</li> |
25 | 25 |
} |
--- app/views/reviewthread/partial_list.scala.html
+++ app/views/reviewthread/partial_list.scala.html
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 |
<div class="infos"> |
47 | 47 |
@if(user.name){ |
48 | 48 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="infos-item infos-link-item" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
49 |
- @user.name |
|
49 |
+ @user.getDisplayName |
|
50 | 50 |
</a> |
51 | 51 |
} else { |
52 | 52 |
<span class="infos-item">@Messages("issue.noAuthor")</span> |
--- app/views/search/partial_issue_comments.scala.html
+++ app/views/search/partial_issue_comments.scala.html
... | ... | @@ -53,7 +53,7 @@ |
53 | 53 |
} |
54 | 54 |
@if(user.name){ |
55 | 55 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="meta-item" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
56 |
- @user.name |
|
56 |
+ @user.getDisplayName |
|
57 | 57 |
</a> |
58 | 58 |
} else { |
59 | 59 |
<span class="meta-item">@Messages("issue.noAuthor")</span> |
--- app/views/search/partial_issues.scala.html
+++ app/views/search/partial_issues.scala.html
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 |
} |
56 | 56 |
@if(user.name){ |
57 | 57 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="meta-item" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
58 |
- @user.name |
|
58 |
+ @user.getDisplayName |
|
59 | 59 |
</a> |
60 | 60 |
} else { |
61 | 61 |
<span class="meta-item">@Messages("issue.noAuthor")</span> |
--- app/views/search/partial_post_comments.scala.html
+++ app/views/search/partial_post_comments.scala.html
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 |
} |
40 | 40 |
@if(user.name){ |
41 | 41 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="meta-item" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
42 |
- @user.name |
|
42 |
+ @user.getDisplayName |
|
43 | 43 |
</a> |
44 | 44 |
} else { |
45 | 45 |
<span class="meta-item">@Messages("posting.noAuthor")</span> |
--- app/views/search/partial_posts.scala.html
+++ app/views/search/partial_posts.scala.html
... | ... | @@ -53,7 +53,7 @@ |
53 | 53 |
} |
54 | 54 |
@if(user.name){ |
55 | 55 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="meta-item" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
56 |
- @user.name |
|
56 |
+ @user.getDisplayName |
|
57 | 57 |
</a> |
58 | 58 |
} else { |
59 | 59 |
<span class="meta-item">@Messages("issue.noAuthor")</span> |
--- app/views/search/partial_reviews.scala.html
+++ app/views/search/partial_reviews.scala.html
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 |
} |
68 | 68 |
@if(user.name){ |
69 | 69 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="meta-item" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
70 |
- @user.name |
|
70 |
+ @user.getDisplayName |
|
71 | 71 |
</a> |
72 | 72 |
} else { |
73 | 73 |
<span class="meta-item">@Messages("issue.noAuthor")</span> |
--- app/views/site/issueList.scala.html
+++ app/views/site/issueList.scala.html
... | ... | @@ -60,7 +60,7 @@ |
60 | 60 |
} |
61 | 61 |
</a> |
62 | 62 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="post-meta-item"> |
63 |
- @user.name |
|
63 |
+ @user.getDisplayName |
|
64 | 64 |
</a> |
65 | 65 |
<span class="post-meta-item" title="@JodaDateUtil.getDateString(issue.createdDate)"> |
66 | 66 |
@agoOrDateString(issue.createdDate) |
--- app/views/user/partial_issues.scala.html
+++ app/views/user/partial_issues.scala.html
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 |
<div class="infos"> |
47 | 47 |
@if(user.name){ |
48 | 48 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="infos-item infos-link-item" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
49 |
- @user.name |
|
49 |
+ @user.getDisplayName |
|
50 | 50 |
</a> |
51 | 51 |
} else { |
52 | 52 |
<span class="infos-item">@Messages("issue.noAuthor")</span> |
--- app/views/user/partial_postings.scala.html
+++ app/views/user/partial_postings.scala.html
... | ... | @@ -40,7 +40,7 @@ |
40 | 40 |
<div class="infos"> |
41 | 41 |
@if(user.name){ |
42 | 42 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="infos-item infos-link-item" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
43 |
- @user.name |
|
43 |
+ @user.getDisplayName |
|
44 | 44 |
</a> |
45 | 45 |
} else { |
46 | 46 |
<span class="infos-item">@Messages("post.noAuthor")</span> |
--- app/views/user/partial_pullRequests.scala.html
+++ app/views/user/partial_pullRequests.scala.html
... | ... | @@ -45,7 +45,7 @@ |
45 | 45 |
<div class="infos"> |
46 | 46 |
@if(user.name){ |
47 | 47 |
<a href="@routes.UserApp.userInfo(user.loginId)" class="infos-item infos-link-item" data-toggle="tooltip" data-placement="top" title="@user.loginId"> |
48 |
- @user.name |
|
48 |
+ @user.getDisplayName |
|
49 | 49 |
</a> |
50 | 50 |
} else { |
51 | 51 |
<span class="infos-item">@Messages("issue.noAuthor")</span> |
--- app/views/user/view.scala.html
+++ app/views/user/view.scala.html
... | ... | @@ -53,6 +53,7 @@ |
53 | 53 |
</div> |
54 | 54 |
<div class="whoami usf-group"> |
55 | 55 |
<span class="name">@user.name</span> |
56 |
+ <span class="name">@user.englishName</span> |
|
56 | 57 |
<span class="loginid">@{"@"}@user.loginId</span> |
57 | 58 |
@if(Application.SHOW_USER_EMAIL){ |
58 | 59 |
<span class="email">@user.email</span> |
+++ conf/evolutions/default/18.sql
... | ... | @@ -0,0 +1,5 @@ |
1 | +# --- !Ups | |
2 | +ALTER TABLE n4user ADD COLUMN english_name VARCHAR(255); | |
3 | + | |
4 | +# --- !Downs | |
5 | +ALTER TABLE n4user DROP COLUMN english_name;(No newline at end of file) |
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?