[Notice] Announcing the End of Demo Server [Read me]
project: Add starred project feature at project breadcromb
@d827f72d96cb57b2a5ec80250fb025117fcc5049
--- app/assets/stylesheets/less/_common.less
+++ app/assets/stylesheets/less/_common.less
... | ... | @@ -277,3 +277,7 @@ |
277 | 277 |
input.white:-moz-placeholder { color:#fff; opacity:0.8; } /* Firefox 18- */ |
278 | 278 |
input.white::-moz-placeholder { color:#fff; opacity:0.8; } /* Firefox 19+ */ |
279 | 279 |
input.white:-ms-input-placeholder { color:#fff; opacity:0.8; } |
280 |
+ |
|
281 |
+.va-text-top { |
|
282 |
+ vertical-align: text-top !important; |
|
283 |
+} |
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
... | ... | @@ -419,6 +419,19 @@ |
419 | 419 |
font-size: 14px; |
420 | 420 |
margin-left:5px; |
421 | 421 |
} |
422 |
+ |
|
423 |
+ .user-project-list { |
|
424 |
+ .star { |
|
425 |
+ color: rgba(255, 255, 255, 0.22); |
|
426 |
+ &:hover { |
|
427 |
+ color: #e91e63; |
|
428 |
+ cursor: pointer; |
|
429 |
+ } |
|
430 |
+ } |
|
431 |
+ .starred { |
|
432 |
+ color: #e91e63 !important; |
|
433 |
+ } |
|
434 |
+ } |
|
422 | 435 |
} |
423 | 436 |
|
424 | 437 |
.project-origin { |
--- app/models/FavoriteProject.java
+++ app/models/FavoriteProject.java
... | ... | @@ -49,4 +49,11 @@ |
49 | 49 |
favoriteProject.update(); |
50 | 50 |
} |
51 | 51 |
} |
52 |
+ |
|
53 |
+ public static FavoriteProject findByProjectId(Long userId, Long projectId){ |
|
54 |
+ return finder.where() |
|
55 |
+ .eq("user.id", userId) |
|
56 |
+ .eq("project.id", projectId) |
|
57 |
+ .findUnique(); |
|
58 |
+ } |
|
52 | 59 |
} |
--- app/views/project/header.scala.html
+++ app/views/project/header.scala.html
... | ... | @@ -45,6 +45,10 @@ |
45 | 45 |
} |
46 | 46 |
} |
47 | 47 |
|
48 |
+@isFavoriteProject = @{ |
|
49 |
+ FavoriteProject.findByProjectId(UserApp.currentUser().id, project.id) != null |
|
50 |
+} |
|
51 |
+ |
|
48 | 52 |
<div class="project-header-outer" style="background-image:url(@urlToProjectBG(project))"> |
49 | 53 |
<div class="project-header-inner"> |
50 | 54 |
<div class="project-header-wrap"> |
... | ... | @@ -56,6 +60,9 @@ |
56 | 60 |
<span class="project-author hide-in-mobile"><a href="@routes.UserApp.userInfo(project.owner)">@project.owner</a></span> |
57 | 61 |
<span class="project-separator hide-in-mobile">/</span> |
58 | 62 |
<span class="project-name"><a href="@routes.ProjectApp.project(project.owner, project.name)">@project.name</a></span> |
63 |
+ <span class="user-project-list" data-project-id="@project.id"> |
|
64 |
+ <i class="@if(isFavoriteProject){starred} star material-icons va-text-top">star</i> |
|
65 |
+ </span> |
|
59 | 66 |
@if(project.isPrivate){ |
60 | 67 |
<span class="project-private"> |
61 | 68 |
<i class="yobicon-lock"></i> |
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?