Merge pull request #823 from consul/featured_and_filters

Featured and filters
This commit is contained in:
Raimond Garcia
2016-01-13 20:20:53 +01:00
13 changed files with 135 additions and 362 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

View File

@@ -70,10 +70,6 @@ body.admin {
.admin-content { .admin-content {
margin-top: rem-calc(24); margin-top: rem-calc(24);
.filters h2 {
margin-top: 0;
}
.proposal-new, .proposal-edit { .proposal-new, .proposal-edit {
padding-top: 0; padding-top: 0;
} }

View File

@@ -8,7 +8,7 @@
// 06. Forms // 06. Forms
// 07. Alerts // 07. Alerts
// 08. User account // 08. User account
// 09. Filters & search // 09. Search
// 10. Official levels // 10. Official levels
// 11. Pagination // 11. Pagination
// 12. Tables // 12. Tables
@@ -1028,60 +1028,9 @@ img.avatar, img.admin-avatar, img.moderator-avatar, img.initialjs-avatar {
} }
} }
// 09. Filters & search // 09. Search
// - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - -
.filters, .search-results {
h2 {
display: inline-block;
font-size: rem-calc(24);
margin: $line-height/2 0;
@media (min-width: $small-breakpoint) {
margin: $line-height 0;
}
}
select {
background-color: #DEE0E2;
height: auto;
margin-bottom: $line-height;
min-width: $line-height*7.5;
outline: 0;
padding: $line-height/2;
width: auto;
@media (min-width: $small-breakpoint) {
margin: 0 0 $line-height $line-height/2;
}
optgroup {
font-size: $small-font-size;
}
option {
&:after {
content: "a";
font-family: "icons";
}
}
}
.debates-order {
text-align: left;
@media (min-width: $small-breakpoint) {
text-align: right;
}
select {
margin-left: 0;
}
}
}
.search-form { .search-form {
h3 { h3 {

View File

@@ -789,8 +789,12 @@
// 05. Featured // 05. Featured
// - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - -
.featured-debates-container { .featured-debates, .featured-proposals {
background: $votes-bg; padding: $line-height/2 0;
@media (min-width: $small-breakpoint) {
margin-top: $line-height !important;
}
@media (min-width: $medium-breakpoint) { @media (min-width: $medium-breakpoint) {
margin-left: 0 !important; margin-left: 0 !important;
@@ -798,134 +802,40 @@
} }
h2 { h2 {
color: white; font-size: $small-font-size;
} line-height: $line-height;
.debates-list {
margin-bottom: 0;
}
}
.featured-proposals-container {
background: #FED900;
@media (min-width: $medium-breakpoint) {
margin-left: 0 !important;
margin-right: rem-calc(-15) !important;
}
h2 {
color: $text;
@media (min-width: $medium-breakpoint) {
margin-bottom: rem-calc(27);
}
}
}
.featured-debates-container, .featured-proposals-container {
margin: $line-height 0 !important;
h2 {
font-size: rem-calc(24);
margin: rem-calc(12) 0 0;
position: relative;
text-transform: uppercase; text-transform: uppercase;
}
.icon-proposals { h3 {
font-size: rem-calc(20); margin-bottom: 0;
position: absolute;
right: -26px; a {
top: -5px; color: $text;
font-size: $h3-font-size;
} }
} }
.debates-list { a, .info {
color: lighten($text, 15%);
@media (min-width: $medium-breakpoint) { font-size: $small-font-size;
border-left: 1px solid $votes-border;
}
&:after {
@media (min-width: $medium-breakpoint) {
content: none;
}
}
} }
.proposals-list {
@media (min-width: $medium-breakpoint) {
border-left: 1px solid #D2B400;
}
&:after {
border-color: #C9AF00 transparent transparent transparent;
@media (min-width: $medium-breakpoint) {
content: " ";
}
}
}
.debates-list, .proposals-list {
margin: rem-calc(6) 0;
&:after {
content: none;
position: absolute;
display: block;
border-style: solid;
bottom: rem-calc(-20);
border-left-width: 0;
border-right-color: transparent;
right: rem-calc(1);
border-width: rem-calc(14) rem-calc(14) 0 0;
}
}
} }
.debate-featured, .proposal-featured { .featured-debates {
margin-bottom: 0; background: $highlight;
margin-top: 0; }
padding-left: 0;
.panel { .featured-proposals {
background: none; background: $featured;
border: 0;
margin-bottom: 0;
padding: 0 rem-calc(12);
h3 {
font-weight: bold;
margin: rem-calc(8) 0 0 0;
min-height: auto;
a {
clear: both;
display: block;
font-size: rem-calc(14);
line-height: $line-height;
}
}
}
.progress {
display: none !important;
}
.content {
overflow: hidden;
}
.supports { .supports {
@include supports; @include supports;
background: none; background: none;
border: 0; border: 0;
padding: 0; padding-bottom: 0;
padding-left: rem-calc(13); padding-top: 0;
margin-right: rem-calc(-26);
&:after { &:after {
content: none; content: none;
@@ -935,8 +845,12 @@
display: none; display: none;
} }
.button-support {
margin-top: 0;
}
.not-logged, .organizations-votes { .not-logged, .organizations-votes {
background: #FED900; background: $featured;
color: $warning-color; color: $warning-color;
font-size: $small-font-size; font-size: $small-font-size;
line-height: rem-calc(24); line-height: rem-calc(24);
@@ -949,14 +863,12 @@
} }
.anonymous-votes { .anonymous-votes {
background: #FED900; background: $featured;
padding: 0;
padding-top: rem-calc(6);
p { p {
font-size: rem-calc(12); color: $text;
line-height: rem-calc(20); font-size: $small-font-size;
margin: 0; line-height: $line-height;
} }
} }
@@ -967,10 +879,6 @@
text-align: center; text-align: center;
} }
.button-support {
margin-top: rem-calc(4);
}
.supported { .supported {
margin-top: 0; margin-top: 0;
} }
@@ -981,53 +889,12 @@
.social-share-button-facebook, .social-share-button-facebook,
.social-share-button-google_plus { .social-share-button-google_plus {
height: rem-calc(33); height: rem-calc(33);
}
.social-share-button-twitter:before, &:before {
.social-share-button-facebook:before, font-size: rem-calc(18);
.social-share-button-google_plus:before { line-height: rem-calc(33);
font-size: rem-calc(18); }
line-height: rem-calc(33);
} }
} }
} }
} }
.debate-featured {
background: $votes-bg;
margin-bottom: rem-calc(12) !important;
.panel h3 a {
color: #0D3F54;
font-size: $h3-font-size;
margin: 0;
}
.info, .info a {
color: white !important;
font-family: $font-sans;
font-size: $small-font-size;
}
.content {
height: auto;
}
}
.proposal-featured {
background: #FED900;
.panel h3 a {
color: $text;
font-size: $base-font-size;
}
.info {
color: #806C00 !important;
font-size: $small-font-size;
}
.content {
height: rem-calc(60);
}
}

View File

@@ -74,6 +74,7 @@ $proposals: #FFA42D;
$proposals-border: #CC8425; $proposals-border: #CC8425;
$highlight: #E7F2FC; $highlight: #E7F2FC;
$featured: #FED900;
$footer-bg: #DEE0E2; $footer-bg: #DEE0E2;
$footer-color: #171819; $footer-color: #171819;

View File

@@ -1,41 +1,17 @@
<div id="featured-debates" class="row featured-debates-container"> <div id="featured-debates" class="row featured-debates">
<div class="small-12 medium-3 column">
<h2> <div class="small-12 column">
<%= t("debates.index.featured_debates_html") %> <h2><%= t("debates.index.featured_debates") %></h2>
</h2>
<span class="show-for-medium-up">
<%= image_tag("featured_debates.jpg", size: "210x135") %>
</span>
</div> </div>
<div class="small-12 medium-9 column debates-list">
<div class="debate-featured small-12 column">
<div class="panel">
<div class="content small-12 left">
<h3>
<%= link_to "#Túpreguntas: Manuela Carmena, Alcaldesa de Madrid.", "https://decide.madrid.es/debates/4320" %></h3>
<div class="info">
<span class="author">
<%= link_to "Manuela Carmena ", "https://decide.madrid.es/users/21452"%>
</span>
</div>
</div>
</div>
</div>
<div class="debate-featured small-12 column">
<div class="panel">
<div class="content small-12 left">
<h3>
<%= link_to "¿Y si cualquiera pudiera entrevistar a Manuela Carmena o a los otros concejales?", "https://decide.madrid.es/debates/4299" %></h3>
<div class="info">
<span class="author">
<%= link_to "ParticipaciónYTransparenciaAytoMadrid", "https://decide.madrid.es/users/52055"%>
</span>
</div>
</div>
</div>
</div>
<div class="small-12 medium-6 column">
<h3><%= link_to "#Túpreguntas: Manuela Carmena, Alcaldesa de Madrid.", "https://decide.madrid.es/debates/4320" %></h3>
<%= link_to "Manuela Carmena ", "https://decide.madrid.es/users/21452"%>
</div> </div>
<div class="small-12 medium-6 column">
<h3><%= link_to "¿Y si pudieras entrevistar a Manuela Carmena o a los otros concejales?", "https://decide.madrid.es/debates/4299" %></h3>
<%= link_to "ParticipaciónYTransparenciaAytoMadrid", "https://decide.madrid.es/users/52055"%>
</div>
</div> </div>

View File

@@ -9,34 +9,32 @@
<div class="wrap row"> <div class="wrap row">
<div id="debates" class="debates-list small-12 medium-9 column"> <div id="debates" class="debates-list small-12 medium-9 column">
<div class="filters"> <div class="small-12 medium-7 left">
<div class="small-12 medium-7 left"> <% if @search_terms %>
<% if @search_terms %> <h2 class="margin-top">
<h2 class="margin-top"> <%= page_entries_info @debates %>
<%= page_entries_info @debates %> <%= t("debates.index.search_results", count: @debates.size, search_term: @search_terms) %>
<%= t("debates.index.search_results", count: @debates.size, search_term: @search_terms) %> </h2>
</h2> <% elsif @tag_filter %>
<% elsif @tag_filter %> <h2 class="margin-top">
<h2 class="margin-top"> <%= page_entries_info @debates %>
<%= page_entries_info @debates %> <%= t("debates.index.filter_topic", count: @debates.size, topic: @tag_filter) %>
<%= t("debates.index.filter_topic", count: @debates.size, topic: @tag_filter) %> </h2>
</h2>
<% end %>
</div>
<% unless @tag_filter || @search_terms %>
<%= render "featured_debates_static" %>
<% end %> <% end %>
<%= render 'shared/order_links', i18n_namespace: "debates.index" %>
<div class="show-for-small-only">
<%= link_to t("debates.index.start_debate"), new_debate_path, class: 'button radius expand' %>
</div>
<%= render @debates %>
<%= paginate @debates %>
</div> </div>
<% unless @tag_filter || @search_terms %>
<%= render "featured_debates_static" %>
<% end %>
<%= render 'shared/order_links', i18n_namespace: "debates.index" %>
<div class="show-for-small-only">
<%= link_to t("debates.index.start_debate"), new_debate_path, class: 'button radius expand' %>
</div>
<%= render @debates %>
<%= paginate @debates %>
</div> </div>
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">

View File

@@ -1,22 +1,18 @@
<div id="<%= dom_id(proposal) %>" class="proposal-featured small-12 column"> <div id="<%= dom_id(proposal) %>" class="proposal-featured clear">
<div class="panel"> <div class="small-12 medium-9 column">
<div class="content small-12 medium-9 left"> <h3><%= link_to proposal.title, proposal %></h3>
<h3><%= link_to proposal.title, proposal %></h3> <div class="info">
<div class="info"> <% if proposal.author.hidden? || proposal.author.erased? %>
<span class="author"> <%= t("proposals.show.author_deleted") %>
<% if proposal.author.hidden? || proposal.author.erased? %> <% else %>
<%= t("proposals.show.author_deleted") %> <%= proposal.author.name %>
<% else %> <% end %>
<%= proposal.author.name %> &nbsp;&bull;&nbsp;
<% end %> <strong><%= t("proposals.proposal.supports", count: proposal.total_votes) %></strong>
</span>
<span>&nbsp;&bull;&nbsp;</span>
<%= t("proposals.proposal.supports", count: proposal.total_votes) %>
</div>
</div>
<div id="<%= dom_id(proposal) %>_votes" class="small-12 medium-3 left">
<%= render 'featured_votes', proposal: proposal %>
</div> </div>
</div> </div>
<div id="<%= dom_id(proposal) %>_votes" class="small-12 medium-3 column">
<%= render 'featured_votes', proposal: proposal %>
</div>
</div> </div>

View File

@@ -9,48 +9,41 @@
<div class="wrap row"> <div class="wrap row">
<div id="proposals" class="proposals-list small-12 medium-9 column"> <div id="proposals" class="proposals-list small-12 medium-9 column">
<div class="filters"> <div class="small-12 medium-7 left">
<div class="small-12 medium-7 left"> <% if @search_terms %>
<% if @search_terms %> <h2 class="margin-top">
<h2 class="margin-top"> <%= page_entries_info @proposals %>
<%= page_entries_info @proposals %> <%= t("proposals.index.search_results", count: @proposals.size, search_term: @search_terms) %>
<%= t("proposals.index.search_results", count: @proposals.size, search_term: @search_terms) %> </h2>
</h2> <% elsif @tag_filter %>
<% elsif @tag_filter %> <h2 class="margin-top">
<h2 class="margin-top"> <%= page_entries_info @proposals %>
<%= page_entries_info @proposals %> <%= t("proposals.index.filter_topic", count: @proposals.size, topic: @tag_filter) %>
<%= t("proposals.index.filter_topic", count: @proposals.size, topic: @tag_filter) %> </h2>
<% end %>
</div>
<% if @featured_proposals.present? %>
<div id="featured-proposals" class="row featured-proposals">
<div class="small-12 column">
<h2>
<%= t("proposals.index.featured_proposals") %>
</h2> </h2>
</div>
<% @featured_proposals.each do |featured_proposal| %>
<%= render "featured_proposal", proposal: featured_proposal %>
<% end %> <% end %>
</div> </div>
<% end %>
<% if @featured_proposals.present? %> <%= render 'shared/order_links', i18n_namespace: "proposals.index" %>
<div id="featured-proposals" class="row featured-proposals-container">
<div class="small-12 medium-3 column">
<h2>
<%= t("proposals.index.featured_proposals_html") %>
</h2>
<span class="show-for-medium-up">
<%= image_tag("featured_proposals.jpg", size: "210x135") %>
</span>
</div>
<div class="small-12 medium-9 column proposals-list">
<% @featured_proposals.each do |featured_proposal| %>
<%= render "featured_proposal", proposal: featured_proposal %>
<% end %>
</div>
</div>
<% end %>
<%= render 'shared/order_links', i18n_namespace: "proposals.index" %> <div class="show-for-small-only">
<%= link_to t("proposals.index.start_proposal"), new_proposal_path, class: 'button radius expand' %>
<div class="show-for-small-only">
<%= link_to t("proposals.index.start_proposal"), new_proposal_path, class: 'button radius expand' %>
</div>
<%= render partial: 'proposals/proposal', collection: @proposals %>
<%= paginate @proposals %>
</div> </div>
<%= render partial: 'proposals/proposal', collection: @proposals %>
<%= paginate @proposals %>
</div> </div>
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">

View File

@@ -4,19 +4,16 @@
<div class="wrap row"> <div class="wrap row">
<div id="activities" class="debates-list small-12 medium-9 column"> <div id="activities" class="debates-list small-12 medium-9 column">
<div class="filters"> <div class="small-12 medium-7 left">
<h1 class="inline-block"><%= t('welcome.highlights') %></h1>
<div class="small-12 medium-7 left"> &nbsp;&nbsp;
<h1 class="inline-block"><%= t('welcome.highlights') %></h1> <h2 class="margin-top">
&nbsp;&nbsp; <%= t('welcome.signed_in_home_title') %>
<h2 class="margin-top"> </h2>
<%= t('welcome.signed_in_home_title') %>
</h2>
</div>
<%= render @list %>
<%= paginate @paginator %>
</div> </div>
<%= render @list %>
<%= paginate @paginator %>
</div> </div>
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">

View File

@@ -85,7 +85,7 @@ en:
debates: debates:
index: index:
title: "Debates" title: "Debates"
featured_debates_html: "Featured<br>debates" featured_debates: "Featured"
start_debate: "Start a debate" start_debate: "Start a debate"
select_order: "Order by" select_order: "Order by"
orders: orders:
@@ -160,7 +160,7 @@ en:
proposals: proposals:
index: index:
title: "Proposals" title: "Proposals"
featured_proposals_html: "Featured<br>proposals" featured_proposals: "Featured"
start_proposal: "Create a proposal" start_proposal: "Create a proposal"
select_order_long: "You are viewing proposals according to:" select_order_long: "You are viewing proposals according to:"
select_order: "Order by" select_order: "Order by"

View File

@@ -85,7 +85,7 @@ es:
debates: debates:
index: index:
title: "Debates" title: "Debates"
featured_debates_html: "Debates<br>destacados" featured_debates: "Destacados"
start_debate: "Empieza un debate" start_debate: "Empieza un debate"
select_order: "Ordenar por" select_order: "Ordenar por"
orders: orders:
@@ -160,7 +160,7 @@ es:
proposals: proposals:
index: index:
title: "Propuestas ciudadanas" title: "Propuestas ciudadanas"
featured_proposals_html: "Propuestas<br>destacadas" featured_proposals: "Destacadas"
start_proposal: "Crea una propuesta" start_proposal: "Crea una propuesta"
select_order_long: "Estas viendo las propuestas" select_order_long: "Estas viendo las propuestas"
select_order: "Ordenar por" select_order: "Ordenar por"