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,6 +44,8 @@ | ||
44 | 44 | ||
45 | .gamification .badge { | 45 | .gamification .badge { |
46 | text-align: center; | 46 | text-align: center; |
47 | + margin-bottom: 4px; | ||
48 | + min-height: 150px; | ||
47 | } | 49 | } |
48 | 50 | ||
49 | .gamification .badge.not-earned { | 51 | .gamification .badge.not-earned { |
@@ -197,24 +199,23 @@ | @@ -197,24 +199,23 @@ | ||
197 | 199 | ||
198 | /* Star Rating */ | 200 | /* Star Rating */ |
199 | 201 | ||
200 | -.rating { | 202 | +.gamification-dashboard .rating { |
201 | padding: 0px; | 203 | padding: 0px; |
204 | + line-height: 30px; | ||
202 | } | 205 | } |
203 | 206 | ||
204 | -.rating > span { | 207 | +.gamification-dashboard .rating .star { |
205 | display: inline-block; | 208 | display: inline-block; |
206 | - position: relative; | ||
207 | font-size: 32px; | 209 | font-size: 32px; |
208 | width: 1.1em; | 210 | width: 1.1em; |
209 | - bottom: 0px; | ||
210 | margin: 0 -7px; | 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 | color: #FFE13D; | 216 | color: #FFE13D; |
217 | font-size: 42px; | 217 | font-size: 42px; |
218 | top: -7px; | 218 | top: -7px; |
219 | left: 0px; | 219 | left: 0px; |
220 | + margin: 0 -12px; | ||
220 | } | 221 | } |
views/gamification/dashboard.html.erb
@@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
44 | <div class="image <%= badge.name %>"></div> | 44 | <div class="image <%= badge.name %>"></div> |
45 | <ul class="level rating"> | 45 | <ul class="level rating"> |
46 | <% 1.upto(badge.level).map do |n|%> | 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 | <% end %> | 48 | <% end %> |
49 | </ul> | 49 | </ul> |
50 | <div class="title"><%= badge.title %></div> | 50 | <div class="title"><%= badge.title %></div> |