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

change useredit to userinfo at site user mng
@145e00a9e6ea342b67d89e2ce537b64557eef6a8
--- app/controllers/UserApp.java
+++ app/controllers/UserApp.java
... | ... | @@ -200,11 +200,24 @@ |
200 | 200 |
newUserForm.reject("loginId", "user.loginId.duplicate"); |
201 | 201 |
} |
202 | 202 |
} |
203 |
+ |
|
204 |
+ public static Result memberInfo(Long userId) { |
|
205 |
+ User user = User.findById(userId); |
|
206 |
+ return ok(memberInfo.render(user)); |
|
207 |
+ } |
|
208 |
+ |
|
203 | 209 |
public static Result info() { |
204 | 210 |
User user = UserApp.currentUser(); |
205 | 211 |
return ok(info.render(user)); |
206 | 212 |
} |
207 | 213 |
|
214 |
+ public static Result memberEdit(Long userId) { |
|
215 |
+ User user = User.findById(userId); |
|
216 |
+ Form<User> userForm = new Form<User>(User.class); |
|
217 |
+ userForm = userForm.fill(user); |
|
218 |
+ return ok(edit.render(userForm)); |
|
219 |
+ } |
|
220 |
+ |
|
208 | 221 |
public static Result edit() { |
209 | 222 |
User user = UserApp.currentUser(); |
210 | 223 |
Form<User> userForm = new Form<User>(User.class); |
... | ... | @@ -223,6 +236,7 @@ |
223 | 236 |
Attachment.attachFiles(currentUser().id, null, Resource.USER, currentUser().id); |
224 | 237 |
return redirect(routes.UserApp.info()); |
225 | 238 |
} |
239 |
+ |
|
226 | 240 |
public static Result getProfilePic(String userName){ |
227 | 241 |
Long fileId = Attachment.findByContainer(Resource.USER, User.findByName(userName).id).get(0).containerId; |
228 | 242 |
return TODO; |
--- app/views/project/projectHome.scala.html
+++ app/views/project/projectHome.scala.html
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 |
@for(member <- User.findUsersByProject(project.id)){ |
47 | 47 |
<li class="member"> |
48 | 48 |
<a href="/uname" class="user-thumb"><img src="/assets/images/default-avatar-34.png" alt="uname"></a> |
49 |
- <a href="/uname"><strong>@member.loginId</strong></a> |
|
49 |
+ <a href="@routes.UserApp.memberInfo(member.id)"><strong>@member.loginId</strong></a> |
|
50 | 50 |
</li> |
51 | 51 |
} |
52 | 52 |
</ul> |
--- app/views/site/userList.scala.html
+++ app/views/site/userList.scala.html
... | ... | @@ -25,7 +25,7 @@ |
25 | 25 |
<td>@user.name</td> |
26 | 26 |
<td>@user.email</td> |
27 | 27 |
<td> |
28 |
- <a class="btn"data-toggle="modal" href="#alertEdit@user.loginId">@Messages("button.edit")</a> |
|
28 |
+ <a class="btn"data-toggle="modal" href="@routes.UserApp.memberInfo(user.id)">@Messages("button.detail")</a> |
|
29 | 29 |
<a class="btn btn-danger" data-toggle="modal" href="#alertDeletion@user.loginId">@Messages("button.delete")</a> |
30 | 30 |
</td> |
31 | 31 |
</tr> |
+++ app/views/user/memberInfo.scala.html
... | ... | @@ -0,0 +1,22 @@ |
1 | +@(user:User) | |
2 | + | |
3 | +@home("Users Info") { | |
4 | +<div class="page"> | |
5 | + <div>name : @user.name</div> | |
6 | + <div> | |
7 | + email : @user.email | |
8 | + </div> | |
9 | + <div> | |
10 | + 프로젝트 갯수 : @user.myProjects().size() | |
11 | + </div> | |
12 | + <div> | |
13 | + <ul> | |
14 | + @for(project <- user.myProjects()){ | |
15 | + <li> | |
16 | + @project.name | |
17 | + </li> | |
18 | + } | |
19 | + </ul> | |
20 | + </div> | |
21 | +</div> | |
22 | +} |
--- conf/messages.en
+++ conf/messages.en
... | ... | @@ -59,6 +59,7 @@ |
59 | 59 |
button.login = Login |
60 | 60 |
button.signup = Create an account |
61 | 61 |
button.newProject = Create your project |
62 |
+button.detail = Detail |
|
62 | 63 |
|
63 | 64 |
checkbox.commented = Comment |
64 | 65 |
checkbox.fileAttached = File Attached |
--- conf/messages.ko
+++ conf/messages.ko
... | ... | @@ -59,6 +59,7 @@ |
59 | 59 |
button.login = 로그인 |
60 | 60 |
button.signup = 가입하기 |
61 | 61 |
button.newProject = 여러분의 프로젝트를 만드세요. |
62 |
+button.detail = 상세조회 |
|
62 | 63 |
|
63 | 64 |
checkbox.commented = 댓글 |
64 | 65 |
checkbox.fileAttached = 첨부파일 |
--- conf/routes
+++ conf/routes
... | ... | @@ -15,7 +15,9 @@ |
15 | 15 |
GET /users/signup controllers.UserApp.signup() |
16 | 16 |
POST /users/signup controllers.UserApp.saveUser() |
17 | 17 |
GET /info controllers.UserApp.info() |
18 |
+GET /memberinfo controllers.UserApp.memberInfo(userId:Long) |
|
18 | 19 |
GET /info/edit controllers.UserApp.edit() |
20 |
+GET /memberinfo/edit controllers.UserApp.memberEdit(userId:Long) |
|
19 | 21 |
POST /info/edit controllers.UserApp.save() |
20 | 22 |
|
21 | 23 |
# Site |
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?