Skip to content

Commit

Permalink
chart + reward
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoinelp committed Jun 13, 2019
1 parent 84da6ad commit 11bd973
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
Binary file added app/assets/images/medal-test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions app/assets/stylesheets/pages/_dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
padding: 20px;
}

.rewards {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 15px;
}


.follow {
margin-bottom: 8px;
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const initPolar = () => {
position: 'left',
labels: {
fontFamily: 'Comfortaa',
fontSize: 16,
fontColor: 'black',
}
}
}
Expand Down
27 changes: 19 additions & 8 deletions app/views/pages/dashboard.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@
<div class="reward">
<div class="reward-content">
<% if key == :futureme %>
<i class=" <%= key %> fas fa-medal fa-lg"></i>
<%= image_tag('medal-test', size: "100") %>
<!-- <i class=" <%= key %> fas fa-medal fa-lg"></i> -->
<% elsif key == :dailyactivities %>
<i class=" <%= key %> fas fa-medal fa-lg"></i>
<%= image_tag('medal-test', size: "100") %>
<!-- <i class=" <%= key %> fas fa-medal fa-lg"></i> -->
<% elsif key == :interactions %>
<i class=" <%= key %> fas fa-medal fa-lg"></i>
<%= image_tag('medal-test', size: "100") %>
<!-- <i class=" <%= key %> fas fa-medal fa-lg"></i> -->
<% elsif key == :curiosity %>
<i class=" <%= key %> fas fa-medal fa-lg"></i>
<%= image_tag('medal-test', size: "100") %>
<!-- <i class=" <%= key %> fas fa-medal fa-lg"></i> -->
<% end %>
</div>
</div>
Expand All @@ -27,17 +31,20 @@
<% if @counter[:dailyactivities] == @counter[:futureme] && @counter[:futureme] == @counter[:interactions] && @counter[:interactions] == @counter[:curiosity] %>
<% if @counter[:dailyactivities] >= 1 %>
<div class="reward">
<i class="bronze fas fa-trophy fa-lg"></i>
<%= image_tag('medal-test', size: "100") %>
<!-- <i class="bronze fas fa-trophy fa-lg"></i> -->
</div>
<% end %>
<% if @counter[:dailyactivities] >= 2 %>
<div class="reward">
<i class="silver fas fa-trophy fa-lg"></i>
<%= image_tag('medal-test', size: "100") %>
<!-- <i class="silver fas fa-trophy fa-lg"></i> -->
</div>
<% end %>
<% if @counter[:dailyactivities] >= 3 %>
<div class="reward">
<i class="gold fas fa-trophy fa-lg"></i>
<%= image_tag('medal-test', size: "100") %>
<!-- <i class="gold fas fa-trophy fa-lg"></i> -->
</div>
<% end %>
<% end %>
Expand All @@ -58,7 +65,11 @@
<div class="force-overflow">
<div class="force-overflow dashboard-element">
<div class="titles">
<h5><em>Ongoing challenges</em> (<%= @undone_participations.length %>)</h5>
<% if @undone_participations.length >= 2 %>
<h5><em>Ongoing challenges</em> (<%= @undone_participations.length %>)</h5>
<% else %>
<h5><em>Ongoing challenge</em> (<%= @undone_participations.length %>)</h5>
<% end %>
<h5 id="right"><em>Inspired by</em></h5>
</div>
<br>
Expand Down
1 change: 0 additions & 1 deletion app/views/participations/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<div class="col-sm-9 journal">
<center>
<p><strong class='journal-title'>Challenges completed</strong></p>
<p></p>
</center>

<!-- card_participations = Challenge.title + Feedback + Ratings -->
Expand Down

0 comments on commit 11bd973

Please sign in to comment.