
show just committer's name without a user page link, when the committer's email doesn't exist in HIVE
@6860b879c3d4f498c9e9bda19394f2be99387ea7
--- app/models/History.java
+++ app/models/History.java
... | ... | @@ -78,7 +78,12 @@ |
78 | 78 |
if(commits != null) { |
79 | 79 |
for(Commit commit : commits) { |
80 | 80 |
History commitHistory = new History(); |
81 |
- setUserPageUrl(commitHistory, User.findByEmail(commit.getAuthorEmail())); |
|
81 |
+ String authorEmail = commit.getAuthorEmail(); |
|
82 |
+ if(User.isEmailExist(authorEmail)) { |
|
83 |
+ setUserPageUrl(commitHistory, User.findByEmail(authorEmail)); |
|
84 |
+ } else { |
|
85 |
+ commitHistory.setWho(commit.getAuthorName()); |
|
86 |
+ } |
|
82 | 87 |
commitHistory.setWhen(commit.getCommitterDate()); |
83 | 88 |
commitHistory.setWhere(project.name); |
84 | 89 |
commitHistory.setWhat("commit"); |
--- app/views/project/overview.scala.html
+++ app/views/project/overview.scala.html
... | ... | @@ -21,16 +21,16 @@ |
21 | 21 |
|
22 | 22 |
<div class="input-prepend project-hometop-wrap"> |
23 | 23 |
<div class="vcs-wrap pull-left"> |
24 |
- <span class="clone-label"><strong class="@project.vcs">@project.vcs</strong></span><!-- |
|
24 |
+ <span class="clone-label"><strong class="@project.vcs">@project.vcs</strong></span><!-- |
|
25 | 25 |
--><input id="repositoryURL" type="text" class="text repo-url" readonly="readonly" value="@CodeApp.getURL(project.owner, project.name)"> |
26 | 26 |
</div> |
27 | 27 |
<div class="issue-wrap btn-group pull-right"> |
28 | 28 |
<button class="btn" disabled="true">@Messages("menu.issue")</button> |
29 | 29 |
<a href="@routes.IssueApp.issues(project.owner, project.name, State.OPEN.state)" class="btn"> |
30 |
- @Messages("issue.state.open") <strong class="num open">@Issue.countIssues(project.id, State.OPEN)</strong> |
|
30 |
+ @Messages("issue.state.open") <strong class="num open">@Issue.countIssues(project.id, State.OPEN)</strong> |
|
31 | 31 |
</a> |
32 | 32 |
<a href="@routes.IssueApp.issues(project.owner, project.name, State.CLOSED.state)" class="btn"> |
33 |
- @Messages("issue.state.closed") <strong class="num">@Issue.countIssues(project.id, State.CLOSED)</strong> |
|
33 |
+ @Messages("issue.state.closed") <strong class="num">@Issue.countIssues(project.id, State.CLOSED)</strong> |
|
34 | 34 |
</a> |
35 | 35 |
</div> |
36 | 36 |
</div> |
... | ... | @@ -92,7 +92,13 @@ |
92 | 92 |
@for(history <- histories.iterator()) { |
93 | 93 |
<tr> |
94 | 94 |
<td>@agoString(ago(history.getWhen()))</td> |
95 |
- <td><a href="@history.getUserPageUrl()">@history.getWho()</a></td> |
|
95 |
+ <td> |
|
96 |
+ @if(history.getUserPageUrl() != null) { |
|
97 |
+ <a href="@history.getUserPageUrl()">@history.getWho()</a> |
|
98 |
+ } else { |
|
99 |
+ @history.getWho() |
|
100 |
+ } |
|
101 |
+ </td> |
|
96 | 102 |
<td>@history.getWhat()</td> |
97 | 103 |
<td><a href="@history.getUrl()">@history.getHow()</a></td> |
98 | 104 |
</tr> |
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?