Skip to content

Commit

Permalink
Merge pull request #142 from eugeniecln1/grid
Browse files Browse the repository at this point in the history
chart + reward
  • Loading branch information
Antoinelp authored Jun 13, 2019
2 parents c1fba35 + 0706d6d commit 768b4d1
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 28 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
55 changes: 28 additions & 27 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 @@ -46,35 +53,29 @@
</div>

<div class="container">

<div>
<div class="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 %>
</div>
<% if @undone_participations.empty? %>
<div class="d-flex justify-content-center align-items-center">
<%= link_to "Challenge me", challenges_home_path, class:"newchallenge" %>
<%= image_tag "emoji/026-grinning.png", size: 50 %>

<!-- <div class="scrollbar scrollbar-primary"> -->
<%else%>
<div class="force-overflow">
<div class="force-overflow dashboard-element">
<br>
<% if @undone_participations.empty? %>
<div class="d-flex justify-content-center align-items-center">
<%= link_to "Challenge me", challenges_home_path, id:"newchallenge" %>
<%= image_tag "emoji/026-grinning.png", size: 50 %>
</div>
<% else %>
<div class="force-overflow">
<div class="force-overflow dashboard-element">
<% @undone_participations.each do |participation| %>
<%= render 'non_done_card', participation: participation %>
<% end %>
</div>
<% else %>
<% @undone_participations.each do |participation| %>
<%= render 'non_done_card', participation: participation %>
<% end %>
<% end %>
<% end %>
<br>
</div>
<% end %>
</div>
</div>
</div>
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 768b4d1

Please sign in to comment.