Remove image by default on carousel. Remove duplicate code. Add background when user recomendations is actived

This commit is contained in:
taitus
2017-09-05 18:51:19 +02:00
parent 2519f232ab
commit b4a6f664bb
3 changed files with 25 additions and 48 deletions

View File

@@ -55,4 +55,8 @@ module WelcomeHelper
end end
end end
def highlight_background
(feature?("user.recommendations") && current_user) ? "highlight" : ""
end
end end

View File

@@ -9,7 +9,7 @@
key: "debates", key: "debates",
image_field: nil, image_field: nil,
image_version: nil, image_version: nil,
image_default: "https://dummyimage.com/600x400/000/fff", image_default: nil,
carousel_size: carousel_size, carousel_size: carousel_size,
btn_text_link: t("welcome.recommended.debates.btn_text_link"), btn_text_link: t("welcome.recommended.debates.btn_text_link"),
btn_path_link: debates_path(order: "recommendations") %> btn_path_link: debates_path(order: "recommendations") %>
@@ -21,7 +21,7 @@
key: "proposals", key: "proposals",
image_field: nil, image_field: nil,
image_version: nil, image_version: nil,
image_default: "https://dummyimage.com/600x400/000/fff", image_default: nil,
carousel_size: carousel_size, carousel_size: carousel_size,
btn_text_link: t("welcome.recommended.proposals.btn_text_link"), btn_text_link: t("welcome.recommended.proposals.btn_text_link"),
btn_path_link: proposals_path(order: "recommendations") %> btn_path_link: proposals_path(order: "recommendations") %>

View File

@@ -27,6 +27,7 @@
<% cache [locale_and_user_status, @featured_debates, @featured_proposals, 'featured'] do %> <% cache [locale_and_user_status, @featured_debates, @featured_proposals, 'featured'] do %>
<main> <main>
<div class="small-12 column text-center <%= highlight_background %>">
<div class="row margin padding"> <div class="row margin padding">
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<h2><%= t("welcome.debates.title") %></h2> <h2><%= t("welcome.debates.title") %></h2>
@@ -45,35 +46,7 @@
<p><%= t("welcome.do.description") %></p> <p><%= t("welcome.do.description") %></p>
</div> </div>
</div> </div>
<div class="row">
<div class="small-12 medium-6 column">
<p>
<span class="lead"><strong><%= t("welcome.debates.title") %></strong></span><br>
<%= t("welcome.debates.description") %>
</p>
</div>
<div class="small-12 medium-6 column">
<p>
<span class="lead"><strong><%= t("welcome.proposal.title") %></strong></span><br>
<%= t("welcome.proposal.description") %>
</p>
</div>
</div> </div>
<div class="row margin-top">
<div class="small-12 medium-6 column">
<p>
<span class="lead"><strong><%= t("welcome.decide.title") %></strong></span><br>
<%= t("welcome.decide.description") %>
</p>
</div>
<div class="small-12 medium-6 column">
<p>
<span class="lead"><strong><%= t("welcome.do.title") %></strong></span><br>
<%= t("welcome.do.description") %>
</p>
</div>
</div>
</main> </main>
<% end %> <% end %>