started working on budget manatement

This commit is contained in:
kikito
2016-09-09 16:57:16 +02:00
parent a69475bf99
commit 2bc9e7be78
15 changed files with 439 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
<%= form_for(Budget::Investment.new, url: url, as: :budget_investment, method: :get) do |f| %>
<div class="row">
<div class="small-12 medium-6 column">
<%= text_field_tag :search, "", placeholder: t("admin.shared.budget_investment_search.placeholder") %>
</div>
<div class="form-inline small-12 medium-3 column end">
<%= f.submit t("admin.shared.budget_investment_search.button"), class: "button" %>
</div>
</div>
<% end %>

View File

@@ -44,6 +44,20 @@
<% end %>
</li>
<li <%= "class=active" if controller_name == "budget_investments" and action_name == "new" %>>
<%= link_to new_management_budget_investment_path do %>
<span class="icon-budget"></span>
<%= t("management.menu.create_budget_investment") %>
<% end %>
</li>
<li <%= "class=active" if controller_name == "budget_investments" and action_name == "index" %>>
<%= link_to management_budget_investments_path do %>
<span class="icon-like"></span>
<%= t("management.menu.support_budget_investments") %>
<% end %>
</li>
<li <%= "class=active" if controller_name == "proposals" and action_name == "print" %>>
<%= link_to print_management_proposals_path do %>
<span class="icon-print"></span>
@@ -58,6 +72,14 @@
<% end %>
</li>
<li <%= "class=active" if controller_name == "budget_investments" and action_name == "print" %>>
<%= link_to print_management_budget_investments_path do %>
<span class="icon-print"></span>
<%= t("management.menu.print_budget_investments") %>
<% end %>
</li>
<li>
<%= link_to new_management_user_invite_path do %>
<span class="icon-letter"></span>

View File

@@ -0,0 +1 @@
<%= render partial: 'budgets/investments/investment', locals: {investment: budget_investment} %>

View File

@@ -0,0 +1,2 @@
<%= render 'budgets/investments/votes',
{ investment: budget_investment, vote_url: vote_management_budget_investment_path(budget_investment.budget, budget_investment, value: 'yes') } %>

View File

@@ -0,0 +1,25 @@
<main>
<span class="not-print">
<%= render 'admin/shared/budget_investment_search', url: management_budget_investments_path %>
</span>
<div class="wrap row">
<div id="investment-projects" class="investment-projects-list small-12 medium-9 column">
<div class="small-12 search-results">
<%= content_tag(:h2, t("management.budget_investments.filters.unfeasible")) if params[:unfeasible].present? %>
<%= content_tag(:h2, t("management.budget_investments.filters.by_geozone", geozone: @geozone_name)) if @geozone_name.present? %>
<% if params[:search].present? %>
<h2>
<%= page_entries_info @budget_investments %>
<%= t("management.budget_investments.search_results", count: @budget_investments.size, search_term: params[:search]) %>
</h2>
<% end %>
</div>
<%= render @budget_investments %>
<%= paginate @budget_investments %>
</div>
</div>
</main>

View File

@@ -0,0 +1,12 @@
<div class="budget-investment-new">
<div class="clear float-right">
<%= render '/shared/print' %>
</div>
<div class="small-12 medium-9 column end">
<h1 class=""><%= t("management.budget_investments.create") %></h1>
<%= render "budgets/investments/form", form_url: management_budget_investments_url %>
</div>
</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_budget_investments_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.budget_investments.print.print_button') %>
</a>
</div>
<div class="small-12 search-results">
<%= content_tag(:h2, t("management.budget_investments.filters.unfeasible"), class: "inline-block") if params[:unfeasible].present? %>
<%= content_tag(:h2, t("management.budget_investments.filters.by_geozone", geozone: @geozone_name), class: "inline-block") if @geozone_name.present? %>
<%= content_tag(:h2, t("management.budget_investments.search_results", count: @budget_investments.size, search_term: params[:search]), class: "inline-block") if params[:search].present? %>
</div>
<%= render @budget_investments %>
<div class="for-print-only">
<p><strong><%= t("management.print.budget_investments_info") %></strong><br>
<%= t("management.print.budget_investments_note") %></p>
</div>
</div>
</div>
</main>

View File

@@ -0,0 +1,3 @@
<%= render '/shared/print' %>
<%= render template: 'budgets/investments/show' %>

View File

@@ -0,0 +1 @@
<%= render template: 'budgets/investments/vote' %>