Refactors search form
It only appears when the page asks for it. Also, the i18n namespace and the path used for the form are parameters now
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
<% content_for :header_addon do %>
|
||||
<%= render "shared/search_form_header",
|
||||
search_path: debates_path(page: 1),
|
||||
i18n_namespace: "debates.index.search_form" %>
|
||||
<% end %>
|
||||
|
||||
<section role="main">
|
||||
|
||||
<div class="wrap row">
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="small-12 medium-4 column right">
|
||||
<%= render "shared/search_form_header" %>
|
||||
<%= yield :header_addon %>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
<% # Params:
|
||||
#
|
||||
# search_path: for example debates_path
|
||||
# i18n_namespace: for example "debates.index.search_form"
|
||||
%>
|
||||
|
||||
<div class="search-form">
|
||||
<div class="sidebar-divider"></div>
|
||||
<h3><%= t("shared.search_form.search_title") %></h3>
|
||||
<h3><%= t("#{i18n_namespace}.title") %></h3>
|
||||
<br>
|
||||
<div class="row">
|
||||
<%= form_tag debates_path, method: :get do %>
|
||||
<%= form_tag search_path, method: :get do %>
|
||||
<div class="small-12 columns">
|
||||
<div class="row collapse">
|
||||
|
||||
<div class="small-9 medium-12 large-9 columns">
|
||||
<input type="text" name="search" placeholder="<%= t("shared.search_form.search_placeholder") %>" class="search-form">
|
||||
<input type="text" name="search" placeholder="<%= t("#{i18n_namespace}.placeholder") %>" class="search-form">
|
||||
</div>
|
||||
<div class="small-3 medium-12 large-3 columns">
|
||||
<input type="submit" class="button secondary postfix" value="<%= t('shared.search_form.search_button') %>">
|
||||
<input type="submit" class="button secondary postfix" value="<%= t("#{i18n_namespace}.button") %>">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
<% # Params:
|
||||
#
|
||||
# i18n_namespace: for example "debates.index.search_form"
|
||||
# search_path: for example debates_path
|
||||
%>
|
||||
|
||||
<div class="search-form">
|
||||
<div class="row">
|
||||
|
||||
<%= form_tag debates_path, method: :get do %>
|
||||
<%= form_tag search_path, method: :get do %>
|
||||
<div class="small-12 columns">
|
||||
<div class="row collapse">
|
||||
<div class="small-10 column">
|
||||
<input type="text" name="search" placeholder="<%= t("shared.search_form.search_placeholder") %>" class="search-form">
|
||||
<input type="text" name="search" placeholder="<%= t("#{i18n_namespace}.placeholder") %>" class="search-form">
|
||||
</div>
|
||||
<div class="small-2 column">
|
||||
<button type="submit" class="button postfix" title="<%= t('shared.search_form.search_button') %>">
|
||||
<button type="submit" class="button postfix" title="<%= t("#{i18n_namespace}.button") %>">
|
||||
<i class="icon-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -76,6 +76,10 @@ en:
|
||||
filter_topic:
|
||||
one: " with the topic '%{topic}'"
|
||||
other: " with the topic '%{topic}'"
|
||||
search_form:
|
||||
title: Search
|
||||
button: Search
|
||||
placeholder: "Search debates..."
|
||||
search_results:
|
||||
one: " containing '%{search_term}'"
|
||||
other: " containing '%{search_term}'"
|
||||
@@ -283,10 +287,6 @@ en:
|
||||
flag: Flag as inappropriate
|
||||
unflag: Undo flag
|
||||
collective: Collective
|
||||
search_form:
|
||||
search_title: Search
|
||||
search_button: Search
|
||||
search_placeholder: "Search on debates..."
|
||||
mailer:
|
||||
comment:
|
||||
subject: Someone has commented on your debate
|
||||
|
||||
@@ -76,6 +76,10 @@ es:
|
||||
filter_topic:
|
||||
one: " con el tema '%{topic}'"
|
||||
other: " con el tema '%{topic}'"
|
||||
search_form:
|
||||
title: Buscar
|
||||
button: Buscar
|
||||
placeholder: "Buscar debates..."
|
||||
search_results:
|
||||
one: " que contiene '%{search_term}'"
|
||||
other: " que contienen '%{search_term}'"
|
||||
@@ -283,10 +287,6 @@ es:
|
||||
flag: Denunciar como inapropiado
|
||||
unflag: Deshacer denuncia
|
||||
collective: Colectivo
|
||||
search_form:
|
||||
search_title: Buscar
|
||||
search_button: Buscar
|
||||
search_placeholder: "Buscar en debates..."
|
||||
mailer:
|
||||
comment:
|
||||
subject: Alguien ha comentado en tu propuesta
|
||||
|
||||
Reference in New Issue
Block a user