Add 'current applied filters' message to investments partial

This commit is contained in:
Angel Perez
2018-01-19 12:18:43 -04:00
parent 1027896617
commit 3f6a9187ec
4 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
<% if params[:filter].present? && params[:second_filter].present? %>
<p class="inline-block"><%= t("#{i18n_namespace}.filters.two_filters_html",
filter: t("#{i18n_namespace}.filters.#{params[:filter]}"),
second_filter: t("#{i18n_namespace}.filters.#{params[:second_filter]}")) %></p>
<% elsif params[:filter].present? %>
<p class="inline-block"><%= t("#{i18n_namespace}.filters.one_filter_html",
filter: t("#{i18n_namespace}.filters.#{params[:filter]}")) %></p>
<% elsif params[:second_filter].present? %>
<p class="inline-block"><%= t("#{i18n_namespace}.filters.one_filter_html",
filter: t("#{i18n_namespace}.filters.#{params[:second_filter]}")) %></p>
<% end %>

View File

@@ -3,7 +3,10 @@
class: "float-right small" %> class: "float-right small" %>
<% if @investments.any? %> <% if @investments.any? %>
<h3 class="inline-block"><%= page_entries_info @investments %></h3> <h3 class="inline-block"><%= page_entries_info @investments %></h3><br>
<%= render "filters_description", i18n_namespace: "admin.budget_investments.index" %>
<table class="table-for-mobile"> <table class="table-for-mobile">
<thead> <thead>
<tr> <tr>

View File

@@ -150,6 +150,8 @@ en:
max_per_heading: Max. supports per heading max_per_heading: Max. supports per heading
winners: Winners winners: Winners
button: Filter button: Filter
one_filter_html: "Current applied filter: <b><em>%{filter}</em></b>"
two_filters_html: "Current applied filters: <b><em>%{filter}, %{second_filter}</em></b>"
download_current_selection: "Download current selection" download_current_selection: "Download current selection"
no_budget_investments: "There are no investment projects." no_budget_investments: "There are no investment projects."
title: Investment projects title: Investment projects

View File

@@ -150,6 +150,8 @@ es:
max_per_heading: Corte por partida max_per_heading: Corte por partida
winners: Ganadores winners: Ganadores
button: Filtrar button: Filtrar
one_filter_html: "Filtro en uso: <b><em>%{filter}</em></b>"
two_filters_html: "Filtros en uso: <b><em>%{filter}, %{second_filter}</em></b>"
download_current_selection: "Descargar selección actual" download_current_selection: "Descargar selección actual"
no_budget_investments: "No hay proyectos de gasto." no_budget_investments: "No hay proyectos de gasto."
title: Proyectos de gasto title: Proyectos de gasto