adds print page to management/spending_proposals

includes search and filtering by geozone
This commit is contained in:
Juanjo Bazán
2016-04-06 19:04:03 +02:00
parent fc5f5eec8b
commit 785170213b
8 changed files with 134 additions and 11 deletions

View File

@@ -47,5 +47,12 @@
<%= t("management.menu.print_proposals") %>
<% end %>
</li>
<li <%= "class=active" if controller_name == "spending_proposals" and action_name == "print" %>>
<%= link_to print_management_spending_proposals_path do %>
<span class="icon-print"></span>
<%= t("management.menu.print_spending_proposals") %>
<% end %>
</li>
</ul>
</div>

View File

@@ -20,8 +20,8 @@
<%= render @proposals %>
<div class="for-print-only">
<p><strong><%= t("management.print.info") %></strong><br>
<%= t("management.print.note") %></p>
<p><strong><%= t("management.print.proposals_info") %></strong><br>
<%= t("management.print.proposals_note") %></p>
</div>
</div>
</div>

View File

@@ -8,12 +8,12 @@
<div class="small-12 search-results">
<%= content_tag(:h2, t("spending_proposals.index.unfeasible")) if params[:unfeasible].present? %>
<%= content_tag(:h2, t("spending_proposals.index.by_geozone", geozone: @geozone_name)) if @geozone_name.present? %>
<%= content_tag(:h2, t("management.spending_proposals.filters.unfeasible")) if params[:unfeasible].present? %>
<%= content_tag(:h2, t("management.spending_proposals.filters.by_geozone", geozone: @geozone_name)) if @geozone_name.present? %>
<% if params[:search].present? %>
<h2>
<%= page_entries_info @spending_proposals %>
<%= t("spending_proposals.index.search_results", count: @spending_proposals.size, search_term: params[:search]) %>
<%= t("management.spending_proposals.search_results", count: @spending_proposals.size, search_term: params[:search]) %>
</h2>
<% end %>
</div>

View File

@@ -0,0 +1,34 @@
<main>
<div class="row">
<div id="investment-projects" class="investment-projects-list small-12 column">
<div class="not-print">
<%= form_tag print_management_spending_proposals_path, method: :get, enforce_utf8: false do %>
<div class="small-12 medium-4 column float-left">
<%= select_tag :geozone,
options_for_select(geozone_select_options.unshift([t("geozones.none"), "all"]), params[:geozone]),
{ label: false,
class: "js-submit-on-change" } %>
</div>
<% end %>
<a id="print_link" href="javascript:window.print();" class="button warning float-right">
<%= t('management.spending_proposals.print.print_button') %>
</a>
</div>
<div class="small-12 search-results">
<%= content_tag(:h2, t("management.spending_proposals.filters.unfeasible"), class: "inline-block") if params[:unfeasible].present? %>
<%= content_tag(:h2, t("management.spending_proposals.filters.by_geozone", geozone: @geozone_name), class: "inline-block") if @geozone_name.present? %>
<%= content_tag(:h2, t("management.spending_proposals.search_results", count: @spending_proposals.size, search_term: params[:search]), class: "inline-block") if params[:search].present? %>
</div>
<%= render @spending_proposals %>
<div class="for-print-only">
<p><strong><%= t("management.print.spending_proposals_info") %></strong><br>
<%= t("management.print.spending_proposals_note") %></p>
</div>
</div>
</div>
</main>