Keesun Baik 2013-05-07
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
+++ app/models/History.java
@@ -78,7 +78,12 @@
         if(commits != null) {
             for(Commit commit : commits) {
                 History commitHistory = new History();
-                setUserPageUrl(commitHistory, User.findByEmail(commit.getAuthorEmail()));
+                String authorEmail = commit.getAuthorEmail();
+                if(User.isEmailExist(authorEmail)) {
+                    setUserPageUrl(commitHistory, User.findByEmail(authorEmail));
+                } else {
+                    commitHistory.setWho(commit.getAuthorName());
+                }
                 commitHistory.setWhen(commit.getCommitterDate());
                 commitHistory.setWhere(project.name);
                 commitHistory.setWhat("commit");
app/views/project/overview.scala.html
--- app/views/project/overview.scala.html
+++ app/views/project/overview.scala.html
@@ -21,16 +21,16 @@
 
     <div class="input-prepend project-hometop-wrap">
     	<div class="vcs-wrap pull-left">
-    		<span class="clone-label"><strong class="@project.vcs">@project.vcs</strong></span><!-- 
+    		<span class="clone-label"><strong class="@project.vcs">@project.vcs</strong></span><!--
     	 --><input id="repositoryURL" type="text" class="text repo-url" readonly="readonly" value="@CodeApp.getURL(project.owner, project.name)">
         </div>
         <div class="issue-wrap btn-group pull-right">
             <button class="btn" disabled="true">@Messages("menu.issue")</button>
             <a href="@routes.IssueApp.issues(project.owner, project.name, State.OPEN.state)" class="btn">
-                @Messages("issue.state.open") <strong class="num open">@Issue.countIssues(project.id, State.OPEN)</strong> 
+                @Messages("issue.state.open") <strong class="num open">@Issue.countIssues(project.id, State.OPEN)</strong>
             </a>
             <a href="@routes.IssueApp.issues(project.owner, project.name, State.CLOSED.state)" class="btn">
-                @Messages("issue.state.closed") <strong class="num">@Issue.countIssues(project.id, State.CLOSED)</strong> 
+                @Messages("issue.state.closed") <strong class="num">@Issue.countIssues(project.id, State.CLOSED)</strong>
             </a>
         </div>
     </div>
@@ -92,7 +92,13 @@
                 @for(history <- histories.iterator()) {
                     <tr>
                         <td>@agoString(ago(history.getWhen()))</td>
-                        <td><a href="@history.getUserPageUrl()">@history.getWho()</a></td>
+                        <td>
+                            @if(history.getUserPageUrl() != null) {
+                                <a href="@history.getUserPageUrl()">@history.getWho()</a>
+                            } else {
+                                @history.getWho()
+                            }
+                        </td>
                         <td>@history.getWhat()</td>
                         <td><a href="@history.getUrl()">@history.getHow()</a></td>
                     </tr>
Add a comment
List