k16wire 2013-01-09
fix user info link error at board
@cea82c21d774581199920c33441ae0f574f3a7bb
app/controllers/BoardApp.java
--- app/controllers/BoardApp.java
+++ app/controllers/BoardApp.java
@@ -4,18 +4,27 @@
 
 package controllers;
 
-import models.*;
-import models.enumeration.*;
+import java.io.File;
+
+import models.Attachment;
+import models.Comment;
+import models.Post;
+import models.Project;
+import models.enumeration.Direction;
+import models.enumeration.Operation;
+import models.enumeration.Resource;
 import play.Logger;
 import play.data.Form;
-import play.mvc.*;
+import play.mvc.Controller;
 import play.mvc.Http.MultipartFormData;
 import play.mvc.Http.MultipartFormData.FilePart;
 import play.mvc.Http.Request;
-import utils.*;
-import views.html.board.*;
-
-import java.io.*;
+import play.mvc.Result;
+import utils.AccessControl;
+import utils.Constants;
+import views.html.board.editPost;
+import views.html.board.newPost;
+import views.html.board.postList;
 
 public class BoardApp extends Controller {
     
@@ -76,6 +85,7 @@
         } else {
             Post post = postForm.get();
             post.authorId = UserApp.currentUser().id;
+            post.authorLoginId = UserApp.currentUser().loginId;
             post.authorName = UserApp.currentUser().name;
             post.commentCount = 0;
             post.filePath = saveFile(request());
@@ -116,6 +126,7 @@
             Comment comment = commentForm.get();
             comment.post = Post.findById(postId);
             comment.authorId = UserApp.currentUser().id;
+            comment.authorLoginId = UserApp.currentUser().loginId;
             comment.authorName = UserApp.currentUser().name;
             comment.filePath = saveFile(request());
 
app/controllers/ProjectApp.java
--- app/controllers/ProjectApp.java
+++ app/controllers/ProjectApp.java
@@ -22,7 +22,7 @@
 import views.html.project.newProject;
 import views.html.project.projectHome;
 import views.html.project.setting;
-import views.html.projectList;
+import views.html.project.projectList;
 
 import com.avaje.ebean.ExpressionList;
 import com.avaje.ebean.Page;
app/controllers/UserApp.java
--- app/controllers/UserApp.java
+++ app/controllers/UserApp.java
@@ -210,7 +210,7 @@
 		return ok(memberInfo.render(user));
 	}
 	
-	public static Result user(String loginId){
+	public static Result userInfo(String loginId){
 	    User user = User.findByLoginId(loginId);
 	    return ok(memberInfo.render(user));
 	}
app/views/board/post.scala.html
--- app/views/board/post.scala.html
+++ app/views/board/post.scala.html
@@ -14,10 +14,10 @@
   </div>
   <div class="board-body">
     <div class="author-info">
-      <a href="@routes.UserApp.user(post.authorLoginId)" class="pull-left img-rounded"><img src="/assets/images/default-avatar-34.png" class="media-object" width="32" height="32" alt="avatar"></a>
+      <a href="@routes.UserApp.userInfo(post.authorLoginId)" class="pull-left img-rounded"><img src="/assets/images/default-avatar-34.png" class="media-object" width="32" height="32" alt="avatar"></a>
       <div class="media-body">
         <p>
-          <a href="@routes.UserApp.user(post.authorLoginId)"><strong>@post.authorName</strong></a> <!--<span class="name">(Loren Brichter)</span>-->
+          <a href="@routes.UserApp.userInfo(post.authorLoginId)"><strong>@post.authorName</strong></a> <!--<span class="name">(Loren Brichter)</span>-->
         </p>
         <p class="status">
           <!--Hit <strong class="num">777</strong> -->Comment <strong class="num">@post.commentCount</strong><!-- Like <i class="ico ico-like-small"></i> <strong class="num">522</strong>-->
@@ -37,12 +37,12 @@
     <ul class="comments">
       @for(comment <-post.comments){
       <li class="comment">
-        <a href="@routes.UserApp.user(comment.authorLoginId)" class="pull-left img-rounded"><img src="/assets/images/default-avatar-34.png" width="32" height="32" class="media-object" alt="avatar"></a>
+        <a href="@routes.UserApp.userInfo(comment.authorLoginId)" class="pull-left img-rounded"><img src="/assets/images/default-avatar-34.png" width="32" height="32" class="media-object" alt="avatar"></a>
         <div class="media-body">
           @roleCheck(session.get("userId"), project.id, Resource.BOARD_COMMENT, Operation.DELETE, comment.id){
           <a class="pull-right close" href="@routes.BoardApp.deleteComment(project.owner, project.name, post.id, comment.id)">&times;</a>
           }
-            <p class="commenter"><a href="@routes.UserApp.user(comment.authorLoginId)"><strong>@comment.authorName</strong></a><!-- <span class="name">(Sam sstephenson)</span> --> <span class="date">@utils.TemplateHelper.agoString(post.ago())</span></p>
+            <p class="commenter"><a href="@routes.UserApp.userInfo(comment.authorLoginId)"><strong>@comment.authorName</strong></a><!-- <span class="name">(Sam sstephenson)</span> --> <span class="date">@utils.TemplateHelper.agoString(post.ago())</span></p>
             <div class="comment-body" markdown resourceType=@Resource.BOARD_COMMENT resourceId=@comment.id>@comment.contents</div>
             <!--
             <ul class="attaches">
app/views/board/postList.scala.html
--- app/views/board/postList.scala.html
+++ app/views/board/postList.scala.html
@@ -59,13 +59,13 @@
       <div class="attach-wrap"></div>
       <div class="contents">
         <p class="title"><a href="@routes.BoardApp.post(project.owner, project.name, post.id)">@post.title</a></p>
-        <p class="infos nm">by <a href="@routes.UserApp.user(post.authorLoginId)" class="author">@post.authorName</a> <span class="date">@utils.TemplateHelper.agoString(post.ago())</span></p>
+        <p class="infos nm">by <a href="@routes.UserApp.userInfo(post.authorLoginId)" class="author">@post.authorName</a> <span class="date">@utils.TemplateHelper.agoString(post.ago())</span></p>
       </div>
       <div class="right-panel">
         <div class="comment-wrap">
             <i class="ico ico-comment-bubble"></i><span class="num">@post.commentCount</span>
         </div>
-        <a href="@routes.UserApp.user(post.authorLoginId)" class="author-avatar img-rounded pull-right">
+        <a href="@routes.UserApp.userInfo(post.authorLoginId)" class="author-avatar img-rounded pull-right">
         <img class="user-picture" src="@urlToPicture(User.find.byId(post.authorId).email, 34)" alt="@post.authorName">
       </div>
     </li>
app/views/issue/issueList.scala.html
--- app/views/issue/issueList.scala.html
+++ app/views/issue/issueList.scala.html
@@ -113,7 +113,7 @@
           <td class="attachmend attached">@if(Attachment.findByContainer(Resource.ISSUE_POST, issue.id).size > 0){<span class="icon-file"/>}</td>
           <td class="info">
             <p><a href="@routes.IssueApp.issue(project.owner, project.name, issue.id)">@issue.title</a></p>
-            <p class="author">by <a href="@routes.UserApp.user(issue.authorLoginId)">@Option(issue.getAuthorName).orElse(Option(Messages("issue.noAuthor"))).get</a> @agoString(issue.ago)</p>
+            <p class="author">by <a href="@routes.UserApp.userInfo(issue.authorLoginId)">@Option(issue.getAuthorName).orElse(Option(Messages("issue.noAuthor"))).get</a> @agoString(issue.ago)</p>
           </td>
           <td class="state @issue.state.toString.toLowerCase">@Messages(issue.state.state)</td>
           <td class="comments">
app/views/project/projectList.scala.html (Renamed from app/views/projectList.scala.html)
--- app/views/projectList.scala.html
+++ app/views/project/projectList.scala.html
No changes
conf/initial-data.yml
--- conf/initial-data.yml
+++ conf/initial-data.yml
@@ -77,6 +77,7 @@
         title:          게시판이 새로 생성되었습니다.
         contents:       새로운 게시판에서 많은 활동 부탁드립니다. 
         authorId:       2
+        authorLoginId:  hobi
         authorName:     hobi
         commentCount:   1
         project:        !!models.Project
conf/routes
--- conf/routes
+++ conf/routes
@@ -141,4 +141,4 @@
 
 # Statistics
 GET     /:user/:project/statistics                      controllers.StatisticsApp.statistics(user, project)
-GET     /:user                                          controllers.UserApp.user(user)
+GET     /:user                                          controllers.UserApp.userInfo(user)
Add a comment
List