Commit 68b1e8b75d73d7be681cd641f023f9e50ddcc5ce
1 parent
e0df815c
Exists in
master
and in
1 other branch
Refactor rating stars in dashboard
Showing
2 changed files
with
10 additions
and
9 deletions
Show diff stats
public/style.css
... | ... | @@ -44,6 +44,8 @@ |
44 | 44 | |
45 | 45 | .gamification .badge { |
46 | 46 | text-align: center; |
47 | + margin-bottom: 4px; | |
48 | + min-height: 150px; | |
47 | 49 | } |
48 | 50 | |
49 | 51 | .gamification .badge.not-earned { |
... | ... | @@ -197,24 +199,23 @@ |
197 | 199 | |
198 | 200 | /* Star Rating */ |
199 | 201 | |
200 | -.rating { | |
202 | +.gamification-dashboard .rating { | |
201 | 203 | padding: 0px; |
204 | + line-height: 30px; | |
202 | 205 | } |
203 | 206 | |
204 | -.rating > span { | |
207 | +.gamification-dashboard .rating .star { | |
205 | 208 | display: inline-block; |
206 | - position: relative; | |
207 | 209 | font-size: 32px; |
208 | 210 | width: 1.1em; |
209 | - bottom: 0px; | |
210 | 211 | margin: 0 -7px; |
211 | - color: #C0C0C0; | |
212 | + color: #E9E9E9; | |
213 | + vertical-align: top; | |
212 | 214 | } |
213 | -.rating > span.earned:before { | |
214 | - content: "\2605"; | |
215 | - position: absolute; | |
215 | +.gamification-dashboard .rating .star.earned { | |
216 | 216 | color: #FFE13D; |
217 | 217 | font-size: 42px; |
218 | 218 | top: -7px; |
219 | 219 | left: 0px; |
220 | + margin: 0 -12px; | |
220 | 221 | } | ... | ... |
views/gamification/dashboard.html.erb
... | ... | @@ -44,7 +44,7 @@ |
44 | 44 | <div class="image <%= badge.name %>"></div> |
45 | 45 | <ul class="level rating"> |
46 | 46 | <% 1.upto(badge.level).map do |n|%> |
47 | - <span class="<%= (person_badge && person_badge.level >= n) ? 'earned' : 'not-earned' %>" > ☆ </span> | |
47 | + <span class="star <%= (person_badge && person_badge.level >= n) ? 'earned' : 'not-earned' %>" >★</span> | |
48 | 48 | <% end %> |
49 | 49 | </ul> |
50 | 50 | <div class="title"><%= badge.title %></div> | ... | ... |