Merge pull request #1607 from consul/index-design

Index design
This commit is contained in:
Juanjo Bazán
2017-06-08 13:58:04 +02:00
committed by GitHub
21 changed files with 106 additions and 181 deletions

View File

@@ -1106,10 +1106,6 @@ img.avatar, img.admin-avatar, img.moderator-avatar, img.initialjs-avatar {
// 09. Search
// ----------
.search-results h2 {
margin-bottom: 0;
}
.advanced-search {
float: left;
margin: $line-height 0;
@@ -1118,7 +1114,7 @@ img.avatar, img.admin-avatar, img.moderator-avatar, img.initialjs-avatar {
@include breakpoint(medium) {
float: right;
margin-bottom: 0;
margin-top: rem-calc(28);
margin-top: $line-height/4;
position: absolute;
right: 0;
z-index: 2;
@@ -1126,7 +1122,6 @@ img.avatar, img.admin-avatar, img.moderator-avatar, img.initialjs-avatar {
}
.advanced-search-form {
margin-top: $line-height;
select {
height: $line-height*2;

View File

@@ -16,14 +16,13 @@
@mixin votes {
border-top: 1px solid $border;
margin-top: $line-height;
padding: $line-height 0;
padding: $line-height/2 0;
position: relative;
@include breakpoint(medium) {
border-left: 1px solid $border;
border-top: 0;
margin-top: 0;
padding-top: $line-height*2;
}
.icon-like, .icon-unlike {
@@ -514,45 +513,17 @@
padding-bottom: rem-calc(12);
}
.label-debate, .label-proposal, .label-investment-project, .label-budget-investment {
background: none;
clear: both;
display: block;
font-size: rem-calc(12);
font-weight: bold;
line-height: $line-height;
padding-bottom: 0;
padding-left: 0;
padding-top: 0;
text-transform: uppercase;
}
.label-debate {
color: $debates;
}
.label-proposal {
color: $proposals-dark;
}
.label-investment-project {
color: $budget;
}
.label-budget-investment {
color: $budget;
}
h3 {
font-weight: bold;
margin: 0;
margin-top: $line-height/2;
a {
color: $text;
}
}
.debate-content, .proposal-content, .investment-project-content, .budget-investment-content {
.debate-content, .proposal-content,
.investment-project-content, .budget-investment-content {
margin: 0;
min-height: rem-calc(180);
position: relative;

View File

@@ -42,8 +42,6 @@ input[type="submit"] { display: none !important; }
.filters h2 { margin: 0 !important; font-size: 20px !important; line-height: 20px !important; width: auto !important; }
.search-results h2 { margin: 0 !important; font-size: 20px !important; line-height: 20px !important; }
.admin h2 { font-size: 20px !important; line-height: 20px !important; }
.select-order {

View File

@@ -19,7 +19,6 @@ class DebatesController < ApplicationController
def index_customization
@featured_debates = @debates.featured
@proposal_successfull_exists = Proposal.successful.exists?
end
def show

View File

@@ -119,5 +119,4 @@ class ProposalsController < ApplicationController
def load_successful_proposals
@proposal_successful_exists = Proposal.successful.exists?
end
end

View File

@@ -6,8 +6,6 @@
<div class="budget-investment-content">
<% cache [locale_and_user_status(investment), 'index', investment, investment.author] do %>
<span class="label-budget-investment float-left"><%= t("budgets.investments.investment.title") %></span>
<span class="icon-budget"></span>
<h3><%= link_to investment.title, namespaced_budget_investment_path(investment) %></h3>
<p class="investment-project-info">

View File

@@ -18,28 +18,36 @@
<%= render '/budgets/investments/header' %>
<% end %>
<div class="wrap row">
<% if params[:search].present? %>
<div class="highlight no-margin-top padding margin-bottom">
<div class="row">
<div class="small-12 column">
<h2><%= t("shared.search_results") %></h2>
<p>
<%= page_entries_info @investments %>
<%= t("budgets.investments.index.search_results_html", count: @investments.size, search_term: params[:search]) %>
</p>
</div>
</div>
</div>
<% end %>
<div class="row">
<div id="budget-investments" class="budget-investments-list small-12 medium-9 column">
<div class="small-12 search-results margin-bottom">
<% if @current_filter == "unfeasible" %>
<% if @current_filter == "unfeasible" %>
<div class="small-12 margin-bottom">
<h2><%= t("budgets.investments.index.unfeasible") %>: <%= @heading.name %></h2>
<div class="callout primary margin">
<%= t("budgets.investments.index.unfeasible_text",
definitions: link_to(t("budgets.investments.index.unfeasible_text_definitions"), "https://decide.madrid.es/participatory_budget_info#20")).html_safe %>
</div>
<% else %>
<%= content_tag(:h2, t("budgets.investments.index.by_heading", heading: @heading.name)) if @heading.present? %>
<% end %>
<% if params[:search].present? %>
<h2>
<%= page_entries_info @investments %>
<%= t("budgets.investments.index.search_results", count: @investments.size, search_term: params[:search]) %>
</h2>
<% end %>
</div>
</div>
<% elsif @heading.present? %>
<div class="small-12 margin-bottom">
<h2><%= t("budgets.investments.index.by_heading", heading: @heading.name) %></h2>
</div>
<% end %>
<%= render('shared/order_links', i18n_namespace: "budgets.investments.index") unless @current_filter == "unfeasible" %>

View File

@@ -5,8 +5,6 @@
<div class="small-12 medium-9 column">
<div class="debate-content">
<span class="label-debate float-left"><%= t("debates.debate.debate") %></span>
<span class="icon-debates"></span>
<h3><%= link_to debate.title, debate %></h3>
<p class="debate-info">
<span class="icon-comments"></span>&nbsp;

View File

@@ -11,34 +11,38 @@
<main>
<h1 class="sr-only"><%= t("shared.outline.debates") %></h1>
<% if @search_terms || @advanced_search_terms || @tag_filter %>
<div class="highlight no-margin-top padding margin-bottom">
<div class="row">
<div class="small-12 column">
<% if @search_terms || @advanced_search_terms %>
<h2><%= t("shared.search_results") %></h2>
<p>
<%= page_entries_info @debates %>
<% if !@advanced_search_terms %>
<%= t("debates.index.search_results_html", count: @debates.size, search_term: @search_terms) %>
<% end %>
</p>
<% elsif @tag_filter %>
<h2><%= t("shared.search_results") %></h2>
<p>
<%= page_entries_info @debates %>
<%= t("debates.index.filter_topic", count: @debates.size, topic: @tag_filter) %>
</p>
<% end %>
</div>
</div>
</div>
<% end %>
<div class="row">
<div id="debates" class="debates-list small-12 medium-9 column">
<div class="small-12 search-results">
<% if @search_terms || @advanced_search_terms %>
<h2>
<%= page_entries_info @debates %>
<% if !@advanced_search_terms %>
<%= t("debates.index.search_results", count: @debates.size, search_term: @search_terms) %>
<% end %>
</h2>
<% elsif @tag_filter %>
<h2>
<%= page_entries_info @debates %>
<%= t("debates.index.filter_topic", count: @debates.size, topic: @tag_filter) %>
</h2>
<% end %>
</div>
<% if has_banners? %>
<%= render "shared/banner" %>
<% end %>
<% if @proposal_successful_exists %>
<%= render "proposals/successful_banner" %>
<% end %>
<% unless @tag_filter || @search_terms || !has_featured? || @proposal_successful_exists %>
<% unless @tag_filter || @search_terms || !has_featured? %>
<%= render "featured_debates" %>
<% end %>

View File

@@ -9,7 +9,7 @@
<% if @search_terms %>
<h2>
<%= page_entries_info @proposals %>
<%= t("proposals.index.search_results", count: @proposals.size, search_term: @search_terms) %>
<%= t("proposals.index.search_results_html", count: @proposals.size, search_term: @search_terms) %>
</h2>
<% end %>
</div>

View File

@@ -8,8 +8,6 @@
<div class="small-12 medium-9 column">
<div class="proposal-content">
<% cache [locale_and_user_status(proposal), 'index', proposal, proposal.author] do %>
<span class="label-proposal float-left"><%= t("proposals.proposal.proposal") %></span>
<span class="icon-proposals"></span>
<h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
<p class="proposal-info">
<span class="icon-comments"></span>&nbsp;
@@ -47,8 +45,8 @@
<p><%= proposal.summary %></p>
<div class="truncate"></div>
</div>
<%= render "shared/tags", taggable: proposal, limit: 5 %>
<% end %>
<%= render "shared/tags", taggable: proposal, limit: 5 %>
</div>
</div>

View File

@@ -1,9 +0,0 @@
<div id="next-voting" class="row sucessfull-proposals-banner">
<%= link_to polls_path do %>
<div class="small-12 column padding">
<div class="icon-successful"></div>
<h2><%= t("poll_questions.banner.featured_title") %></h2>
<p><%= t("poll_questions.banner.info") %></p>
</div>
<% end %>
</div>

View File

@@ -11,34 +11,40 @@
<main>
<h1 class="sr-only"><%= t("shared.outline.proposals") %></h1>
<div class="row">
<div id="proposals" class="proposals-list small-12 medium-9 column">
<div class="small-12 search-results">
<% if @search_terms || @advanced_search_terms %>
<h2>
<% if @search_terms || @advanced_search_terms || @tag_filter || params[:retired].present? %>
<div class="highlight no-margin-top padding margin-bottom">
<div class="row">
<div class="small-12 column">
<% if @search_terms || @advanced_search_terms %>
<h2><%= t("shared.search_results") %></h2>
<p>
<%= page_entries_info @proposals %>
<% if !@advanced_search_terms %>
<%= t("proposals.index.search_results", count: @proposals.size, search_term: @search_terms) %>
<%= t("proposals.index.search_results_html", count: @proposals.size, search_term: @search_terms) %>
<% end %>
</h2>
<% elsif @tag_filter %>
<h2>
<%= page_entries_info @proposals %>
<%= t("proposals.index.filter_topic", count: @proposals.size, topic: @tag_filter) %>
</h2>
<% elsif params[:retired].present? %>
<h2><%= t("proposals.index.retired_proposals") %>
<% end %>
<p>
<% elsif @tag_filter %>
<h2><%= t("shared.search_results") %></h2>
<p>
<%= page_entries_info @proposals %>
<%= t("proposals.index.filter_topic", count: @proposals.size, topic: @tag_filter) %>
</p>
<% elsif params[:retired].present? %>
<h2><%= t("proposals.index.retired_proposals") %></h2>
<% end %>
</div>
</div>
</div>
<% end %>
<div class="row">
<div id="proposals" class="proposals-list small-12 medium-9 column">
<% if has_banners? %>
<%= render "shared/banner" %>
<% end %>
<% if @proposal_successful_exists %>
<%= render "successful_banner" %>
<% elsif @featured_proposals.present? %>
<% if @featured_proposals.present? %>
<div id="featured-proposals" class="row featured-proposals">
<div class="small-12 column">
<h2>

View File

@@ -54,9 +54,9 @@ en:
button: Search
placeholder: Search investment projects...
title: Search
search_results:
one: " containing the term '%{search_term}'"
other: " containing the term '%{search_term}'"
search_results_html:
one: " containing the term <strong>'%{search_term}'</strong>"
other: " containing the term <strong>'%{search_term}'</strong>"
sidebar:
my_ballot: My ballot
voted_html:
@@ -95,7 +95,6 @@ en:
price: Price
wrong_price_format: Only integer numbers
investment:
title: Investment project
add: Vote
already_added: You have already added this investment project
already_supported: You have already supported this. Share it!

View File

@@ -54,9 +54,9 @@ es:
button: Buscar
placeholder: Buscar propuestas de inversión...
title: Buscar
search_results:
one: " que contiene '%{search_term}'"
other: " que contienen '%{search_term}'"
search_results_html:
one: " que contiene <strong>'%{search_term}'</strong>"
other: " que contienen <strong>'%{search_term}'</strong>"
sidebar:
my_ballot: Mis votos
voted_html:
@@ -95,7 +95,6 @@ es:
price: Coste
wrong_price_format: Solo puede incluir caracteres numéricos
investment:
title: Propuesta de inversión
add: Votar
already_added: "Ya has añadido esta propuesta de inversión"
already_supported: Ya has apoyado esta propuesta. ¡Compártelo!

View File

@@ -77,7 +77,6 @@ en:
one: 1 comment
other: "%{count} comments"
zero: No comments
debate: Debate
votes:
one: 1 vote
other: "%{count} votes"
@@ -108,9 +107,9 @@ en:
button: Search
placeholder: Search debates...
title: Search
search_results:
one: " containing the term '%{search_term}'"
other: " containing the term '%{search_term}'"
search_results_html:
one: " containing the term <strong>'%{search_term}'</strong>"
other: " containing the term <strong>'%{search_term}'</strong>"
select_order: Order by
start_debate: Start a debate
title: Debates
@@ -337,9 +336,9 @@ en:
button: Search
placeholder: Search proposals...
title: Search
search_results:
one: " containing the term '%{search_term}'"
other: " containing the term '%{search_term}'"
search_results_html:
one: " containing the term <strong>'%{search_term}'</strong>"
other: " containing the term <strong>'%{search_term}'</strong>"
select_order: Order by
select_order_long: 'You are viewing proposals according to:'
start_proposal: Create a proposal
@@ -369,7 +368,6 @@ en:
one: 1 comment
other: "%{count} comments"
zero: No comments
proposal: Proposal
reason_for_supports_necessary: 1% of Census
support: Support
support_title: Support this proposal
@@ -455,9 +453,6 @@ en:
vote_answer: "Vote %{answer}"
voted: "You have voted %{answer}"
poll: "Poll"
banner:
featured_title: "#NextVoting"
info: "New proposals that have reached the voting phase."
proposal_notifications:
new:
title: "Send message"
@@ -477,6 +472,7 @@ en:
login_to_comment: 'You must %{signin} or %{signup} to leave a comment.'
"yes": "Yes"
"no": "No"
search_results: "Search results"
advanced_search:
author_type: 'By author category'
author_type_blank: 'Select a category'

View File

@@ -77,7 +77,6 @@ es:
one: 1 Comentario
other: "%{count} Comentarios"
zero: Sin comentarios
debate: Debate
votes:
one: 1 voto
other: "%{count} votos"
@@ -108,9 +107,9 @@ es:
button: Buscar
placeholder: Buscar debates...
title: Buscar
search_results:
one: " que contiene '%{search_term}'"
other: " que contienen '%{search_term}'"
search_results_html:
one: " que contiene <strong>'%{search_term}'</strong>"
other: " que contienen <strong>'%{search_term}'</strong>"
select_order: Ordenar por
start_debate: Empieza un debate
title: Debates
@@ -337,9 +336,9 @@ es:
button: Buscar
placeholder: Buscar propuestas...
title: Buscar
search_results:
one: " que contiene '%{search_term}'"
other: " que contienen '%{search_term}'"
search_results_html:
one: " que contiene <strong>'%{search_term}'</strong>"
other: " que contienen <strong>'%{search_term}'</strong>"
select_order: Ordenar por
select_order_long: Estas viendo las propuestas
start_proposal: Crea una propuesta
@@ -369,7 +368,6 @@ es:
one: 1 Comentario
other: "%{count} Comentarios"
zero: Sin comentarios
proposal: Propuesta
reason_for_supports_necessary: 1% del Censo
support: Apoyar
support_title: Apoyar esta propuesta
@@ -455,9 +453,6 @@ es:
vote_answer: "Votar %{answer}"
voted: "Has votado %{answer}"
poll: "Votación"
banner:
featured_title: "#PróximaVotación"
info: "Nuevas propuestas ciudadanas han llegado a la fase de votación."
proposal_notifications:
new:
title: "Enviar mensaje"
@@ -477,6 +472,7 @@ es:
login_to_comment: 'Necesitas %{signin} o %{signup} para comentar.'
"yes": "Sí"
"no": "No"
search_results: "Resultados de búsqueda"
advanced_search:
author_type: 'Por categoría de autor'
author_type_blank: 'Elige una categoría'

View File

@@ -7,11 +7,11 @@ en:
other: Entries
zero: Entries
more_pages:
display_entries: Displaying <b>%{first}&nbsp;-&nbsp;%{last}</b> of <b>%{total}</b> %{entry_name}
display_entries: Displaying <strong>%{first}&nbsp;-&nbsp;%{last}</strong> of <strong>%{total} %{entry_name}</strong>
one_page:
display_entries:
one: There is <b>1</b> %{entry_name}
other: There are <b> %{count}</b> %{entry_name}
one: There is <strong>1 %{entry_name}</strong>
other: There are <strong>%{count} %{entry_name}</strong>
zero: "%{entry_name} cannot be found"
views:
pagination:

View File

@@ -7,11 +7,11 @@ es:
other: entradas
zero: entradas
more_pages:
display_entries: Mostrando <b>%{first}&nbsp;-&nbsp;%{last}</b> de un total de <b>%{total}</b> %{entry_name}
display_entries: Mostrando <strong>%{first}&nbsp;-&nbsp;%{last}</strong> de un total de <strong>%{total} %{entry_name}</strong>
one_page:
display_entries:
one: Hay <b>1</b> %{entry_name}
other: Hay <b> %{count}</b> %{entry_name}
one: Hay <strong>1 %{entry_name}</strong>
other: Hay <strong>%{count} %{entry_name}</strong>
zero: No se han encontrado %{entry_name}
views:
pagination:

View File

@@ -3,21 +3,6 @@ require 'rails_helper'
feature 'Proposal ballots' do
scenario 'Banner shows in proposal index' do
create_featured_proposals
visit proposals_path
expect(page).to_not have_css("#next-voting")
expect(page).to have_css("#featured-proposals")
create_successful_proposals
visit proposals_path
expect(page).to have_css("#next-voting")
expect(page).to_not have_css("#featured-proposals")
end
scenario 'Successful proposals do not show support buttons in index' do
successful_proposals = create_successful_proposals

View File

@@ -1432,21 +1432,6 @@ end
feature 'Successful proposals' do
scenario 'Banner shows in proposal index' do
create_featured_proposals
visit proposals_path
expect(page).to_not have_css("#next-voting")
expect(page).to have_css("#featured-proposals")
create_successful_proposals
visit proposals_path
expect(page).to have_css("#next-voting")
expect(page).to_not have_css("#featured-proposals")
end
scenario 'Successful proposals do not show support buttons in index' do
successful_proposals = create_successful_proposals