Merge branch 'budgets-admin-views' into budgets-gaspar

This commit is contained in:
kikito
2017-01-04 17:57:46 +01:00
16 changed files with 239 additions and 159 deletions

View File

@@ -3,10 +3,12 @@
<%= f.text_field :name, maxlength: Budget.title_max_length %>
<% Budget::PHASES.each do |phase| %>
<%= f.cktext_area "description_#{phase}", maxlength: Budget.description_max_length, ckeditor: { language: I18n.locale } %>
<div class="margin-top">
<%= f.cktext_area "description_#{phase}", maxlength: Budget.description_max_length, ckeditor: { language: I18n.locale } %>
</div>
<% end %>
<div class="row">
<div class="row margin-top">
<div class="small-12 medium-9 column">
<%= f.select :phase, budget_phases_select_options %>
</div>

View File

@@ -1,68 +1,67 @@
<div class="small-12 column">
<table>
<thead>
<tr>
<th colspan="3" class="with-button">
<%= group.name %>
<%= link_to t("admin.budgets.form.add_heading"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#group-#{group.id}-new-heading-form" } %>
</th>
</tr>
<table>
<thead>
<tr>
<th colspan="3" class="with-button">
<%= group.name %>
<%= link_to t("admin.budgets.form.add_heading"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#group-#{group.id}-new-heading-form" } %>
</th>
</tr>
<% if headings.blank? %>
<tbody>
<tr>
<td colspan="3">
<div class="callout primary">
<%= t("admin.budgets.form.no_heading") %>
</div>
</td>
</tr>
<% else %>
<tr>
<th><%= t("admin.budgets.form.table_heading") %></th>
<th><%= t("admin.budgets.form.table_amount") %></th>
</tr>
</thead>
<tbody>
<% end %>
<!-- new heading form -->
<tr id="group-<%= group.id %>-new-heading-form" style="display:none">
<td colspan="3">
<%= form_for [:admin, @budget, group, Budget::Heading.new], remote: true do |f| %>
<label><%= t("admin.budgets.form.heading") %></label>
<%= f.text_field :name,
label: false,
maxlength: 50,
placeholder: t("admin.budgets.form.heading") %>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("admin.budgets.form.amount") %></label>
<%= f.text_field :price,
label: false,
maxlength: 8,
placeholder: t("admin.budgets.form.amount") %>
</div>
</div>
<%= f.submit t("admin.budgets.form.save_heading"), class: "button success" %>
<% end %>
</td>
</tr>
<!-- /. new heading form -->
<!-- headings list -->
<% headings.each do |heading| %>
<% if headings.blank? %>
<tbody>
<tr>
<td>
<%= heading.name %>
</td>
<td>
<%= heading.price %>
<td colspan="3">
<div class="callout primary">
<%= t("admin.budgets.form.no_heading") %>
</div>
</td>
</tr>
<% else %>
<tr>
<th><%= t("admin.budgets.form.table_heading") %></th>
<th><%= t("admin.budgets.form.table_amount") %></th>
</tr>
</thead>
<tbody>
<% end %>
<!-- new heading form -->
<tr id="group-<%= group.id %>-new-heading-form" style="display:none">
<td colspan="3">
<%= form_for [:admin, @budget, group, Budget::Heading.new], remote: true do |f| %>
<label><%= t("admin.budgets.form.heading") %></label>
<%= f.text_field :name,
label: false,
maxlength: 50,
placeholder: t("admin.budgets.form.heading") %>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("admin.budgets.form.amount") %></label>
<%= f.text_field :price,
label: false,
maxlength: 8,
placeholder: t("admin.budgets.form.amount") %>
</div>
</div>
<%= f.submit t("admin.budgets.form.save_heading"), class: "button success" %>
<% end %>
<!-- /. headings list -->
</td>
</tr>
<!-- /. new heading form -->
<!-- headings list -->
<% headings.each do |heading| %>
<tr>
<td>
<%= heading.name %>
</td>
<td>
<%= heading.price %>
</td>
</tr>
<% end %>
<!-- /. headings list -->
</tbody>
</table>
</div>

View File

@@ -1,34 +1,32 @@
<div class="small-12 column">
<h3 class="inline-block"><%= t('admin.budgets.show.groups') %></h3>
<% if groups.blank? %>
<div class="callout primary">
<%= t("admin.budgets.form.no_groups") %>
<strong><%= link_to t("admin.budgets.form.add_group"), "#",
class: "js-toggle-link",
data: { "toggle-selector" => "#new-group-form" } %></strong>
</div>
<% else %>
<%= link_to t("admin.budgets.form.add_group"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#new-group-form" } %>
<% end %>
<h3 class="inline-block"><%= t('admin.budgets.show.groups') %></h3>
<% if groups.blank? %>
<div class="callout primary">
<%= t("admin.budgets.form.no_groups") %>
<strong><%= link_to t("admin.budgets.form.add_group"), "#",
class: "js-toggle-link",
data: { "toggle-selector" => "#new-group-form" } %></strong>
</div>
<% else %>
<%= link_to t("admin.budgets.form.add_group"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#new-group-form" } %>
<% end %>
<%= form_for [:admin, @budget, Budget::Group.new], html: {id: "new-group-form", style: "display:none"}, remote: true do |f| %>
<div class="input-group">
<span class="input-group-label">
<label><%= f.label :name,t("admin.budgets.form.group") %></label>
</span>
<%= f.text_field :name,
label: false,
maxlength: 50,
placeholder: t("admin.budgets.form.group") %>
<div class="input-group-button">
<%= f.submit t("admin.budgets.form.create_group"), class: "button success" %>
</div>
<%= form_for [:admin, @budget, Budget::Group.new], html: {id: "new-group-form", style: "display:none"}, remote: true do |f| %>
<div class="input-group">
<span class="input-group-label">
<label><%= f.label :name,t("admin.budgets.form.group") %></label>
</span>
<%= f.text_field :name,
label: false,
maxlength: 50,
placeholder: t("admin.budgets.form.group") %>
<div class="input-group-button">
<%= f.submit t("admin.budgets.form.create_group"), class: "button success" %>
</div>
<% end %>
</div>
<% end %>
<% groups.each do |group| %>
<div class="row" id="<%= dom_id(group) %>">
<%= render "admin/budgets/group", group: group, headings: group.headings %>
</div>
<% end %>
</div>
<% groups.each do |group| %>
<div id="<%= dom_id(group) %>">
<%= render "admin/budgets/group", group: group, headings: group.headings %>
</div>
<% end %>

View File

@@ -1,3 +1,8 @@
<%= link_to admin_budgets_path do %>
<span class="icon-angle-left"></span>
<%= t('shared.back') %>
<% end %>
<div class="row">
<div class="small-12 medium-9 column">
<h2><%= t("admin.budgets.edit.title") %></h2>

View File

@@ -6,23 +6,39 @@
<%= render 'shared/filter_subnav', i18n_namespace: "admin.budgets.index" %>
<h3><%= page_entries_info @budgets %></h3>
<table>
<% @budgets.each do |budget| %>
<tr id="<%= dom_id(budget) %>" class="budget">
<td>
<%= link_to budget.name, admin_budget_budget_investments_path(budget_id: budget.id) %>
</td>
<td class="small">
<%= t("budget.phase.#{budget.phase}") %>
</td>
<td class="small">
<%= link_to t("admin.budgets.index.info_link"), admin_budget_path(budget) %>
</td>
<thead>
<tr>
<th><%= t("admin.budgets.index.table_name") %></th>
<th><%= t("admin.budgets.index.table_phase") %></th>
<th><%= t("admin.budgets.index.table_investments") %></th>
<th><%= t("admin.budgets.index.table_edit_groups") %></th>
<th><%= t("admin.budgets.index.table_edit_budget") %></th>
</tr>
<% end %>
</thead>
<tbody>
<% @budgets.each do |budget| %>
<tr id="<%= dom_id(budget) %>" class="budget">
<td>
<%= budget.name %>
</td>
<td class="small">
<%= t("budget.phase.#{budget.phase}") %>
</td>
<td class="small">
<%= link_to t("admin.budgets.index.budget_investments"), admin_budget_budget_investments_path(budget_id: budget.id) %>
</td>
<td class="small">
<%= link_to t("admin.budgets.index.edit_groups"), admin_budget_path(budget) %>
</td>
<td class="small">
<%= link_to t("admin.budgets.index.edit_budget"), edit_admin_budget_path(budget) %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @budgets %>

View File

@@ -1,16 +1,10 @@
<div class="row">
<div class="small-12 medium-9 column">
<h2><%= @budget.name %> <small><%= link_to(t('shared.edit'), edit_admin_budget_path(@budget)) %></small></h2>
<%= link_to admin_budgets_path do %>
<span class="icon-angle-left"></span>
<%= t('shared.back') %>
<% end %>
<%= @budget.description %>
<h2><%= @budget.name %></h2>
<p>
<strong><%= t('admin.budgets.show.phase') %>:</strong> <%= t("budget.phase.#{@budget.phase}") %> |
<strong><%= t('admin.budgets.show.currency') %>:</strong> <%= @budget.currency_symbol %>
</p>
</div>
</div>
<div id="<%= dom_id @budget %>_groups" class="row">
<div id="<%= dom_id @budget %>_groups">
<%= render "groups", groups: @budget.groups %>
</div>

View File

@@ -1,4 +1,8 @@
<%= link_to "#{t('valuation.budget_investments.show.title')} #{@investment.id}", valuation_budget_budget_investment_path(@budget, @investment), class: 'back' %>
<%= link_to valuation_budget_budget_investment_path(@budget, @investment), class: 'back' do %>
<span class="icon-angle-left"></span>
<%= "#{t('valuation.budget_investments.show.title')} #{@investment.id}"%>
<% end %>
<h2><%= t("valuation.budget_investments.edit.dossier") %></h2>
<%= form_for(@investment, url: valuate_valuation_budget_budget_investment_path(@budget, @investment), html: {id: "valuation_budget_investment_edit_form"}) do |f| %>

View File

@@ -1,4 +1,7 @@
<h2><%= @budget.name %> - <%= t("valuation.budget_investments.index.title") %></h2>
<h2>
<%= @budget.name %> - <%= t("valuation.budget_investments.index.title") %>
<small>(Asignadas a EVALUADOR)</small>
</h2>
<div class="row collapse">
<% @heading_filters.each_slice(8) do |slice| %>
@@ -18,25 +21,34 @@
<h3><%= page_entries_info @investments %></h3>
<table>
<% @investments.each do |investment| %>
<tr id="<%= dom_id(investment) %>">
<td>
<strong><%= investment.id %></strong>
</td>
<td>
<%= link_to investment.title, valuation_budget_budget_investment_path(@budget, investment) %>
</td>
<td class="small">
<%= link_to t("valuation.budget_investments.index.edit"), edit_valuation_budget_budget_investment_path(@budget, investment) %>
</td>
<td class="small">
<%= assigned_valuators_info(investment.valuators) %>
</td>
<td class="small">
<%= investment.heading.name %>
</td>
<thead>
<tr>
<th><%= t("valuation.budget_investments.index.table_id") %></th>
<th><%= t("valuation.budget_investments.index.table_title") %></th>
<th><%= t("valuation.budget_investments.index.table_heading_name") %></th>
<th><%= t("valuation.budget_investments.index.table_actions") %></th>
</tr>
<% end %>
</thead>
<tbody>
<% @investments.each do |investment| %>
<tr id="<%= dom_id(investment) %>">
<td>
<strong><%= investment.id %></strong>
</td>
<td>
<%= link_to investment.title, valuation_budget_budget_investment_path(@budget, investment) %>
</td>
<td class="small">
<%= investment.heading.name %>
</td>
<td class="small">
<%= link_to t("valuation.budget_investments.index.edit"),
edit_valuation_budget_budget_investment_path(@budget, investment),
class: "button hollow expanded" %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @investments %>

View File

@@ -1,4 +1,7 @@
<%= render "shared/back_link" %>
<%= link_to valuation_budget_budget_investments_path do %>
<span class="icon-angle-left"></span>
<%= t('shared.back') %>
<% end %>
<h2><%= t("valuation.budget_investments.show.title") %> <%= @investment.id %> </h2>
<h1><%= @investment.title %></h1>

View File

@@ -3,13 +3,34 @@
<h3><%= page_entries_info @budgets %></h3>
<table>
<% @budgets.each do |budget| %>
<tr id="<%= dom_id(budget) %>" class="budget">
<td>
<%= link_to budget.name, valuation_budget_budget_investments_path(budget_id: budget.id) %>
</td>
<thead>
<tr>
<th><%= t("valuation.budgets.index.table_name") %></th>
<th><%= t("valuation.budgets.index.table_phase") %></th>
<th><%= t("valuation.budgets.index.table_assigned_headings") %></th>
<th><%= t("valuation.budgets.index.table_actions") %></th>
</tr>
<% end %>
</thead>
<tbody>
<% @budgets.each do |budget| %>
<tr id="<%= dom_id(budget) %>" class="budget">
<td>
<%= budget.name %>
</td>
<td>
<%= t("budget.phase.#{budget.phase}") %>
</td>
<td>
3 partidas
</td>
<td>
<%= link_to t("valuation.budgets.index.evaluate"),
valuation_budget_budget_investments_path(budget_id: budget.id),
class: "button hollow expanded" %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @budgets %>

View File

@@ -62,10 +62,17 @@ en:
index:
title: Participatory budgets
new_link: Create new budget
info_link: Info
filters:
open: Open
current: Open
finished: Finished
budget_investments: See budget investments
table_name: Name
table_phase: Phase
table_investments: Investments
table_edit_groups: Headings groups
table_edit_budget: Edit
edit_groups: Edit headings groups
edit_budget: Edit budget
create:
notice: New participatory budget created successfully!
update:
@@ -75,8 +82,6 @@ en:
new:
title: New participatory budget
show:
phase: Current phase
currency: Currency
groups: Groups of budget headings
form:
group: Group name

View File

@@ -62,10 +62,17 @@ es:
index:
title: Presupuestos participativos
new_link: Crear nuevo presupuesto
info_link: Info
filters:
open: Abiertos
current: Abiertos
finished: Terminados
budget_investments: Ver propuestas de inversión
table_name: Nombre
table_phase: Fase
table_investments: Propuestas de inversión
table_edit_groups: Grupos de partidas
table_edit_budget: Editar
edit_groups: Editar grupos de partidas
edit_budget: Editar presupuesto
create:
notice: ¡Nueva campaña de presupuestos participativos creada con éxito!
update:
@@ -75,8 +82,6 @@ es:
new:
title: Nuevo presupuesto ciudadano
show:
phase: Fase actual
currency: Divisa
groups: Grupos de partidas presupuestarias
form:
group: Nombre del grupo

View File

@@ -441,7 +441,6 @@ en:
collective: Collective
flag: Flag as inappropriate
hide: Hide
edit: Editar
print:
print_button: Print this info
search: Search

View File

@@ -445,7 +445,6 @@ es:
print_button: Imprimir esta información
search: Buscar
show: Mostrar
edit: Editar
suggest:
debate:
found:

View File

@@ -9,8 +9,13 @@ en:
index:
title: Participatory budgets
filters:
open: Open
current: Open
finished: Finished
table_name: Name
table_phase: Phase
table_assigned_headings: Assigned headings
table_actions: Actions
evaluate: Evaluate
budget_investments:
index:
headings_filter_all: All headings
@@ -19,11 +24,15 @@ en:
valuating: Under valuation
valuation_finished: Valuation finished
title: Investment projects
edit: Edit
edit: Edit dossier
valuators_assigned:
one: Assigned valuator
other: "%{count} valuators assigned"
no_valuators_assigned: No valuators assigned
table_id: ID
table_title: Title
table_heading_name: Heading name
table_actions: Actions
show:
back: Back
title: Investment project

View File

@@ -9,8 +9,13 @@ es:
index:
title: Presupuestos participativos
filters:
open: Abiertos
current: Abiertos
finished: Terminados
table_name: Nombre
table_phase: Fase
table_assigned_headings: Partidas asignadas
table_actions: Acciones
evaluate: Evaluar
budget_investments:
index:
headings_filter_all: Todas las partidas
@@ -19,11 +24,15 @@ es:
valuating: En evaluación
valuation_finished: Evaluación finalizada
title: Propuestas de inversión
edit: Editar
edit: Editar informe
valuators_assigned:
one: Evaluador asignado
other: "%{count} evaluadores asignados"
no_valuators_assigned: Sin evaluador
table_id: ID
table_title: Título
table_heading_name: Nombre de la partida
table_actions: Acciones
show:
back: Volver
title: Propuesta de inversión