Skip to content

Commit

Permalink
Merge branch 'master' into title
Browse files Browse the repository at this point in the history
  • Loading branch information
svilder authored Jun 14, 2019
2 parents a83b7a0 + 10dae64 commit 1523240
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 43 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/components/_card_role_model.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
text-decoration: none;
}
p {
font-size: 15px;
font-size: 12px;
}
}

Expand Down
104 changes: 62 additions & 42 deletions app/views/pages/dashboard.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,74 @@
<canvas id="polarChart" data-daily="<%= @counter[:dailyactivities] %>" data-future="<%= @counter[:futureme] %>" data-interactions="<%= @counter[:interactions] %>" data-curiosity="<%= @counter[:curiosity] %>"></canvas>
</div>

<div class="container">
<h4><em>Rewards</em></h4>
<div class="rewards">
<% @counter.each do |key, value| %>
<% if value >= 3 %>
<div class="reward">
<div class="reward-content">
<% if key == :futureme %>
<%= image_tag('medailles/dragon_3_future_me.png', size: "100") %> <!-- dragon couleur cat -->
<!-- <i class=" <%= key %> fas fa-medal fa-lg"></i> -->
<% elsif key == :dailyactivities %>
<%= image_tag('medailles/dragon_3_daily_activities.png', size: "100") %> <!-- dragon couleur cat -->
<!-- <i class=" <%= key %> fas fa-medal fa-lg"></i> -->
<% elsif key == :interactions %>
<%= image_tag('medailles/dragon_3_interactions.png', size: "100") %> <!-- dragon couleur cat -->
<!-- <i class=" <%= key %> fas fa-medal fa-lg"></i> -->
<% elsif key == :curiosity %>
<%= image_tag('medailles/dragon_3_curiosity.png', size: "100") %> <!-- dragon couleur cat -->
<!-- <i class=" <%= key %> fas fa-medal fa-lg"></i> -->
<% end %>
</div>
</div>
<% end %>
<% end %>
<% if @counter[:dailyactivities] == @counter[:futureme] && @counter[:futureme] == @counter[:interactions] && @counter[:interactions] == @counter[:curiosity] %>
<% if @counter[:dailyactivities] >= 1 %>
<div class="reward">
<%= image_tag('medailles/dragon_1_all.png', size: "100") %> <!-- bébé dragon -->
<!-- <i class="bronze fas fa-trophy fa-lg"></i> -->
<div class="container">
<h4><em>Rewards</em></h4>
<div class="rewards">
<% if @counter[:dailyactivities] >= 3 && @counter[:futureme] >= 3 && @counter[:interactions] >= 3 && @counter[:curiosity] >= 3 %>
<div class="reward">
<%= image_tag('medailles/dragon_3_all.png', size: "100") %> <!-- bébé dragon -->

</div>
<% elsif @counter[:dailyactivities] >= 2 && @counter[:futureme] >= 2 && @counter[:interactions] >= 2 && @counter[:curiosity] >= 2 %>
<div class="reward">
<%= image_tag('medailles/dragon_2_all.png', size: "100") %> <!-- petit dragon -->

</div>
<% elsif @counter[:dailyactivities] >= 1 && @counter[:futureme] >= 1 && @counter[:interactions] >= 1 && @counter[:curiosity] >= 1 %>
<div class="reward">
<%= image_tag('medailles/dragon_1_all.png', size: "100") %> <!-- grand dragon -->
</div>
<% end %>
<% @counter.each do |key, value| %>
<% if value >= 3 %>
<div class="reward">
<div class="reward-content">
<% if key == :futureme %>
<%= image_tag('medailles/dragon_3_future_me.png', size: "100") %>
<% elsif key == :dailyactivities %>
<%= image_tag('medailles/dragon_3_daily_activities.png', size: "100") %>
<% elsif key == :interactions %>
<%= image_tag('medailles/dragon_3_interactions.png', size: "100") %>
<% elsif key == :curiosity %>
<%= image_tag('medailles/dragon_3_curiosity.png', size: "100") %>
<% end %>
</div>
<% end %>
<% if @counter[:dailyactivities] >= 2 %>
<div class="reward">
<%= image_tag('medailles/dragon_2_all.png', size: "100") %> <!-- petit dragon -->
<!-- <i class="silver fas fa-trophy fa-lg"></i> -->
</div>
<% elsif value >= 2 %>
<div class="reward">
<div class="reward-content">
<% if key == :futureme %>
<%= image_tag('medailles/dragon_2_future_me.png', size: "100") %>
<% elsif key == :dailyactivities %>
<%= image_tag('medailles/dragon_2_daily_activities.png', size: "100") %>
<% elsif key == :interactions %>
<%= image_tag('medailles/dragon_2_interactions.png', size: "100") %>
<% elsif key == :curiosity %>
<%= image_tag('medailles/dragon_2_curiosity.png', size: "100") %>
<% end %>
</div>
<% end %>
<% if @counter[:dailyactivities] >= 3 %>
<div class="reward">
<%= image_tag('medailles/dragon_3_all.png', size: "100") %> <!-- grand dragon -->
<!-- <i class="gold fas fa-trophy fa-lg"></i> -->
</div>
<% elsif value >= 1 %>
<div class="reward">
<div class="reward-content">
<% if key == :futureme %>
<%= image_tag('medailles/dragon_1_future_me.png', size: "100") %>
<% elsif key == :dailyactivities %>
<%= image_tag('medailles/dragon_1_daily_activities.png', size: "100") %>
<% elsif key == :interactions %>
<%= image_tag('medailles/dragon_1_interactions.png', size: "100") %>
<% elsif key == :curiosity %>
<%= image_tag('medailles/dragon_1_curiosity.png', size: "100") %>
<% end %>
</div>
<% end %>
</div>

<% end %>
</div>
</div>
</div>
</div>
</div>

<div class="container">
<div>
Expand Down Expand Up @@ -88,7 +108,7 @@
<!-- Modal -->
<% @participations.each do |participation| %>
<div class="modal fade" id="exampleModal<%= participation.id %>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" data-participation="<%= participation.id %>" >
<div class="modal-dialog" role="document">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Give your feedback</h5>
Expand All @@ -101,7 +121,7 @@
<%= f.input :feedback, as: :text, label: 'Description', error: 'Put a feedback !', placeholder: 'Really great challenge...' %>
<div class="d-flex justify-content-around">
<%= f.input :appreciation, collection: (1..5).to_a, label: content_tag(:i, "" , class: "fas fa-heart") + " LIKE", input_html: {class: "modal-rating"} %>
<%= f.input :difficulty, collection: (1..5).to_a, label: image_tag('dragon_logo.png', size: "20") + " DIFFICULTY", input_html: {class: "modal-rating"} %>
<%= f.input :difficulty, collection: (1..5).to_a, label: content_tag(:i, "" , class: "fas fa-dragon") + " DIFFICULTY", input_html: {class: "modal-rating"} %>
</div>

<div class="d-flex justify-content-left. align-items-center">
Expand Down

0 comments on commit 1523240

Please sign in to comment.