Adds search form to sidebar

This commit is contained in:
Alberto Garcia Cabeza
2015-08-24 12:54:26 +02:00
committed by Juanjo Bazán
parent 1b51738be6
commit 54eeff41b7
5 changed files with 65 additions and 3 deletions

View File

@@ -10,7 +10,7 @@
// 08. Forms // 08. Forms
// 09. Alerts // 09. Alerts
// 10. User account // 10. User account
// 11. Filters // 11. Filters & search
// 12. Official levels // 12. Official levels
// 13. Pagination // 13. Pagination
// 14. Tables // 14. Tables
@@ -133,9 +133,14 @@ h6 {
.button { .button {
font-size: rem-calc(13); font-size: rem-calc(13);
font-family: $font-family-sans-serif !important;
padding: rem-calc(15) rem-calc(32); padding: rem-calc(15) rem-calc(32);
} }
.postfix.button {
padding: 0;
}
.clear { .clear {
clear: both; clear: both;
} }
@@ -985,7 +990,7 @@ img.initialjs-avatar {
top: -9px; top: -9px;
} }
// 11. Filters // 11. Filters & search
// - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - -
.filters { .filters {
@@ -1018,6 +1023,23 @@ img.initialjs-avatar {
} }
} }
.search-results {
@extend .filters;
}
.search-form {
h3 {
border-top: 1px solid $votes-border;
display: inline-block;
font-family: $font-family-sans-serif;
font-size: rem-calc(16);
margin: -1px 0 rem-calc(12);
padding-top: rem-calc(6);
text-transform: uppercase;
}
}
// 12. Officials levels // 12. Officials levels
// - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@@ -37,6 +37,18 @@
</div> </div>
</div> </div>
<!-- Search results -->
<div class="filters row">
<div class="small-12 column">
<h2>
<%= t("debates.index.search_results",
number: "N",
search_term: "búsqueda").html_safe%>
</h2>
</div>
</div>
<!-- /. Search results -->
<div class="row"> <div class="row">
<div id="debates" class="debates-list small-12 medium-9 column js-order-<%= @order.dasherize %>"> <div id="debates" class="debates-list small-12 medium-9 column js-order-<%= @order.dasherize %>">
<%= render @debates %> <%= render @debates %>
@@ -45,6 +57,7 @@
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<aside class="sidebar" role="complementary"> <aside class="sidebar" role="complementary">
<%= link_to t("debates.index.start_debate"), new_debate_path, class: 'button radius expand' %> <%= link_to t("debates.index.start_debate"), new_debate_path, class: 'button radius expand' %>
<%= render "shared/search_form" %>
<%= render "shared/tag_cloud" %> <%= render "shared/tag_cloud" %>
</aside> </aside>
</div> </div>

View File

@@ -0,0 +1,17 @@
<div class="search-form">
<div class="sidebar-divider"></div>
<h3><%= t("shared.search_form.search_title") %></h3>
<br>
<div class="row">
<div class="small-12 columns">
<div class="row collapse">
<div class="small-9 medium-12 large-9 columns">
<input type="text" placeholder="<%= t("shared.search_form.search_placeholder") %>">
</div>
<div class="small-3 medium-12 large-3 columns">
<a href="#" class="button warning postfix"><%= t("shared.search_form.search_button") %></a>
</div>
</div>
</div>
</div>
</div>

View File

@@ -79,6 +79,7 @@ en:
filter_topic: filter_topic:
one: "You are seeing one debate with the topic '%{topic}'" one: "You are seeing one debate with the topic '%{topic}'"
other: "You are seeing %{count} debates with the topic '%{topic}'" other: "You are seeing %{count} debates with the topic '%{topic}'"
search_results: "Showing %{number} debates containing '%{search_term}'"
debate: debate:
debate: Debate debate: Debate
comments: comments:
@@ -193,6 +194,10 @@ en:
flag: Flag as inappropriate flag: Flag as inappropriate
unflag: Undo flag unflag: Undo flag
collective: Collective collective: Collective
search_form:
search_title: Search
search_button: Search
search_placeholder: "Search..."
mailer: mailer:
comment: comment:
subject: Someone has commented on your debate subject: Someone has commented on your debate

View File

@@ -79,6 +79,7 @@ es:
filter_topic: filter_topic:
one: "Estás viendo un debate con el tema ''%{topic}''" one: "Estás viendo un debate con el tema ''%{topic}''"
other: "Estás viendo %{count} debates con el tema '%{topic}'" other: "Estás viendo %{count} debates con el tema '%{topic}'"
search_results: "Mostrando %{number} debates que contienen '%{search_term}'"
debate: debate:
debate: Debate debate: Debate
comments: comments:
@@ -189,10 +190,14 @@ es:
debate: "el código secreto no coincide con la imagen" debate: "el código secreto no coincide con la imagen"
shared: shared:
tags_cloud: tags_cloud:
tags: Temas tags: Temas
flag: Denunciar como inapropiado flag: Denunciar como inapropiado
unflag: Deshacer denuncia unflag: Deshacer denuncia
collective: Colectivo collective: Colectivo
search_form:
search_title: Buscar
search_button: Buscar
search_placeholder: "Buscar..."
mailer: mailer:
comment: comment:
subject: Alguien ha comentado en tu debate subject: Alguien ha comentado en tu debate