Skip to content

Commit

Permalink
Merge branch 'master' into grid
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoinelp authored Jun 13, 2019
2 parents 11bd973 + c1fba35 commit 0706d6d
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 42 deletions.
Binary file added app/assets/images/heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 28 additions & 7 deletions app/assets/stylesheets/components/_button.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@

#validatechallenge {
.validatechallenge {
color: white;
background-color: $navbar;
margin: 10px 10px;
padding: 20px;
border-radius: 5px;
text-align: center;
font-size: 18px;
// animation-play-state: paused;
font-size: 50px;
width: 80px;
height: 80px;
display: flex;
align-items: center;
position: relative;
padding: 10px 16px;
// border: 2px solid $navbar;
border-radius: 5px;
// animation-play-state: paused;
}

#validatechallenge:hover {
transform: scale(1.2);
.dailyactivities {
background-color: $daily-activities;
}

.futureme {
background-color: $future-me;
}
.interactions {
background-color: $interactions;
}
.curiosity {
background-color: $curiosity;
}

.validatechallenge:hover {
transform: scale(1.1);
color:white;
}

.newchallenge {
Expand Down
17 changes: 12 additions & 5 deletions app/assets/stylesheets/pages/_dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
.follow {
margin-bottom: 8px;
display: flex;
align-items: center;
}

.inspiration {
Expand All @@ -43,19 +44,25 @@
margin-bottom: 0px;
background: white;
padding: 8px 16px;
border: 2px solid rgb(235,235,235);
// border: 2px solid rgb(235,235,235);
border-radius: 5px;
font-size: 24px;
flex-grow: 1;
margin-right: 8px;
margin-right: 15px;
}

.notification .notification-content {
flex-grow: 1;
padding: 0 24px;
display: flex;
padding: 0;
display: block;
justify-content: space-between;
margin: 18px;
margin-left: 0px;
#sub-description {
font-size: 15px;
color: grey;
max-width: 100ch;
}
}

.notification p {
Expand All @@ -74,7 +81,7 @@
align-items: center;
background: white;
width: 150px;
padding: 8px 16px;
padding: 10px 16px;
border: 2px solid rgb(235,235,235);
border-radius: 5px;
font-size: 18px;
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/meta_tags_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def meta_description

def meta_image
meta_image = (content_for?(:meta_image) ? content_for(:meta_image) : DEFAULT_META["meta_image"])
# little twist to make it work equally with an asset or a url
# little twist to make it work equally with an asset or a url
meta_image.starts_with?("http") ? meta_image : image_url(meta_image)
end
end
21 changes: 10 additions & 11 deletions app/views/pages/_non_done_card.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@
<div class="notification">
<div class="notification-content align-items-center">
<p><strong><%= participation.challenge.title %></strong></p>
<div class="notification-actions">
<a href="#" id="validatechallenge" data-toggle="modal" data-target="#exampleModal<%= participation.id %>">Validate me</a>
</div>
<p id="sub-description"><%= participation.challenge.description %></p>
</div>

<div class="progress">
<div id="bar" class="progress-bar progress-bar-striped <%= participation.challenge.category.gsub(/\s+/, "").downcase %>" role="progressbar" style="width: 20%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>

<div class="profile">
<div class="notification-content">
<div class="inspiration">
<%= link_to '', role_model_path(participation.challenge.role_model), class: "stretched-link" %>
<%= image_tag(participation.challenge.role_model.picture, class:"avatar-small", alt:"avatar-small" ) %>
<p><%= "#{participation.challenge.role_model.first_name} #{participation.challenge.role_model.last_name}" %></p>
<a href="#" class="validatechallenge <%= participation.challenge.category.gsub(/\s+/, "").downcase %>" data-toggle="modal" data-target="#exampleModal<%= participation.id %>">
<!-- <div class="profile"> -->
<div class="notification-content">
<div class="notification-actions">
<i class="fas fa-check"></i>
</div>
</div>
</div>
</div>
<!-- </div> -->
</a>
</div>


36 changes: 18 additions & 18 deletions app/views/pages/dashboard.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,32 +53,30 @@
</div>

<div class="container">

<div>
<div class="dashboard-element">
<br>
<div class="titles">
<% 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>
<% else %>
<div class="force-overflow">
<div class="force-overflow dashboard-element">
<div class="titles">
<% 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>
<% @undone_participations.each do |participation| %>
<%= render 'non_done_card', participation: participation %>
<% end %>
<% end %>
<br>
</div>
</div>
</div>
<% end %>
</div>
</div>
</div>

Expand All @@ -95,14 +93,16 @@
</div>
<div class="modal-body">
<%= simple_form_for participation, remote: false do |f| %>
<%= f.input :feedback, as: :text, label: 'Go on and describe your experience !', error: 'Be able to look back and analyse your experience is a huge part of building self confidence. Put a feedback !', placeholder: 'I was not sure I could it, I waited a lot, then I pulled myself out there and I felt great afterward, because I could push myself.' %>
<%= f.input :appreciation, collection: (1..5).to_a, label: 'How much did you appreciate this challenge ?', input_html: {class: "modal-rating"} %>
<%= f.input :difficulty, collection: (1..5).to_a, label: 'How much did you find it difficult ?', input_html: {class: "modal-rating"} %>
<%= 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"} %>
</div>

<div class="d-flex justify-content-left. align-items-center">
<%= f.submit "Validate", id:"btn-confetti#{participation.id}", class: "newchallenge"%>
<%= image_tag "emoji/102-love.png", size: 50 %>
</div>

<% end %>
</div>
</div>
Expand Down

0 comments on commit 0706d6d

Please sign in to comment.