From e1367d4463ea578caba09012cde4fc5518b8dcc8 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 4 Jan 2017 13:52:04 +0100 Subject: [PATCH 1/6] improves table of admin budgets index --- app/views/admin/budgets/index.html.erb | 42 ++++++++++++++++++-------- config/locales/admin.en.yml | 11 +++++-- config/locales/admin.es.yml | 11 +++++-- 3 files changed, 47 insertions(+), 17 deletions(-) diff --git a/app/views/admin/budgets/index.html.erb b/app/views/admin/budgets/index.html.erb index d4de771db..7bf4b0659 100644 --- a/app/views/admin/budgets/index.html.erb +++ b/app/views/admin/budgets/index.html.erb @@ -6,23 +6,39 @@ <%= render 'shared/filter_subnav', i18n_namespace: "admin.budgets.index" %> -

<%= page_entries_info @budgets %>

- <% @budgets.each do |budget| %> - - - - + + + + + + + - <% end %> + + + <% @budgets.each do |budget| %> + + + + + + + + <% end %> +
- <%= link_to budget.name, admin_budget_budget_investments_path(budget_id: budget.id) %> - - <%= t("budget.phase.#{budget.phase}") %> - - <%= link_to t("admin.budgets.index.info_link"), admin_budget_path(budget) %> -
<%= t("admin.budgets.index.table_name") %><%= t("admin.budgets.index.table_phase") %><%= t("admin.budgets.index.table_investments") %><%= t("admin.budgets.index.table_edit_groups") %><%= t("admin.budgets.index.table_edit_budget") %>
+ <%= budget.name %> + + <%= t("budget.phase.#{budget.phase}") %> + + <%= link_to t("admin.budgets.index.budget_investments"), admin_budget_budget_investments_path(budget_id: budget.id) %> + + <%= link_to t("admin.budgets.index.edit_groups"), admin_budget_path(budget) %> + + <%= link_to t("admin.budgets.index.edit_budget"), edit_admin_budget_path(budget) %> +
<%= paginate @budgets %> \ No newline at end of file diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index 8f27677e7..e34c2183c 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -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: diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 5f7f66ab6..8109251f1 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -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: From 46d96e5a189151b427d56ae4538c1e580be61ef8 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 4 Jan 2017 17:02:27 +0100 Subject: [PATCH 2/6] improves styles for admin budgets show --- app/views/admin/budgets/_group.html.erb | 140 +++++++++++------------ app/views/admin/budgets/_groups.html.erb | 60 +++++----- app/views/admin/budgets/show.html.erb | 18 +-- 3 files changed, 104 insertions(+), 114 deletions(-) diff --git a/app/views/admin/budgets/_group.html.erb b/app/views/admin/budgets/_group.html.erb index 3660fa0c1..2890ada2c 100644 --- a/app/views/admin/budgets/_group.html.erb +++ b/app/views/admin/budgets/_group.html.erb @@ -1,76 +1,74 @@ -
- - - - - +
- <%= 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" } %> -
+ + + + - <% if headings.blank? %> - - - - - <% else %> - - - - - - - - <% end %> - - - - - - - - <% headings.each do |heading| %> + <% if headings.blank? %> + - - - + <% else %> + + + + + + + + <% end %> + + + + -
+ <%= 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" } %> +
-
- <%= t("admin.budgets.form.no_heading") %> -
-
<%= t("admin.budgets.form.table_heading") %><%= t("admin.budgets.form.table_amount") %><%= t("admin.budgets.form.table_geozone") %>
- <%= heading.name %> - - <%= heading.price %> - - <%= geozone_name_from_id heading.geozone_id %> + +
+ <%= t("admin.budgets.form.no_heading") %> +
<%= t("admin.budgets.form.table_heading") %><%= t("admin.budgets.form.table_amount") %><%= t("admin.budgets.form.table_geozone") %>
-
\ No newline at end of file + + + + + <% headings.each do |heading| %> + + + <%= heading.name %> + + + <%= heading.price %> + + + <%= geozone_name_from_id heading.geozone_id %> + + + <% end %> + + + diff --git a/app/views/admin/budgets/_groups.html.erb b/app/views/admin/budgets/_groups.html.erb index ba785ee0c..f5dde3aa1 100644 --- a/app/views/admin/budgets/_groups.html.erb +++ b/app/views/admin/budgets/_groups.html.erb @@ -1,34 +1,32 @@ -
-

<%= t('admin.budgets.show.groups') %>

- <% if groups.blank? %> -
- <%= t("admin.budgets.form.no_groups") %> - <%= link_to t("admin.budgets.form.add_group"), "#", - class: "js-toggle-link", - data: { "toggle-selector" => "#new-group-form" } %> -
- <% else %> - <%= link_to t("admin.budgets.form.add_group"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#new-group-form" } %> - <% end %> +

<%= t('admin.budgets.show.groups') %>

+<% if groups.blank? %> +
+ <%= t("admin.budgets.form.no_groups") %> + <%= link_to t("admin.budgets.form.add_group"), "#", + class: "js-toggle-link", + data: { "toggle-selector" => "#new-group-form" } %> +
+<% 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| %> -
- - - - <%= f.text_field :name, - label: false, - maxlength: 50, - placeholder: t("admin.budgets.form.group") %> -
- <%= f.submit t("admin.budgets.form.create_group"), class: "button success" %> -
+<%= form_for [:admin, @budget, Budget::Group.new], html: {id: "new-group-form", style: "display:none"}, remote: true do |f| %> +
+ + + + <%= f.text_field :name, + label: false, + maxlength: 50, + placeholder: t("admin.budgets.form.group") %> +
+ <%= f.submit t("admin.budgets.form.create_group"), class: "button success" %>
- <% end %> +
+<% end %> - <% groups.each do |group| %> -
- <%= render "admin/budgets/group", group: group, headings: group.headings %> -
- <% end %> -
\ No newline at end of file +<% groups.each do |group| %> +
+ <%= render "admin/budgets/group", group: group, headings: group.headings %> +
+<% end %> diff --git a/app/views/admin/budgets/show.html.erb b/app/views/admin/budgets/show.html.erb index 4468f7599..1f3292019 100644 --- a/app/views/admin/budgets/show.html.erb +++ b/app/views/admin/budgets/show.html.erb @@ -1,16 +1,10 @@ -
-
-

<%= @budget.name %> <%= link_to(t('shared.edit'), edit_admin_budget_path(@budget)) %>

+<%= link_to admin_budgets_path do %> + + <%= t('shared.back') %> +<% end %> - <%= @budget.description %> +

<%= @budget.name %>

-

- <%= t('admin.budgets.show.phase') %>: <%= t("budget.phase.#{@budget.phase}") %> | - <%= t('admin.budgets.show.currency') %>: <%= @budget.currency_symbol %> -

-
-
- -
+
<%= render "groups", groups: @budget.groups %>
From 02359c8e2aeffc22b8fa5a1c23985752d3497e97 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 4 Jan 2017 17:04:37 +0100 Subject: [PATCH 3/6] improves styles for admin budgets edit --- app/views/admin/budgets/_form.html.erb | 6 ++++-- app/views/admin/budgets/edit.html.erb | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/admin/budgets/_form.html.erb b/app/views/admin/budgets/_form.html.erb index 22a774b76..5d323b45c 100644 --- a/app/views/admin/budgets/_form.html.erb +++ b/app/views/admin/budgets/_form.html.erb @@ -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 } %> +
+ <%= f.cktext_area "description_#{phase}", maxlength: Budget.description_max_length, ckeditor: { language: I18n.locale } %> +
<% end %> -
+
<%= f.select :phase, budget_phases_select_options %>
diff --git a/app/views/admin/budgets/edit.html.erb b/app/views/admin/budgets/edit.html.erb index 6fd1e3e1f..34672bf7a 100644 --- a/app/views/admin/budgets/edit.html.erb +++ b/app/views/admin/budgets/edit.html.erb @@ -1,3 +1,8 @@ +<%= link_to admin_budgets_path do %> + + <%= t('shared.back') %> +<% end %> +

<%= t("admin.budgets.edit.title") %>

From 74a361690de4be83be585b961d1050557aa2f77b Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 4 Jan 2017 17:33:09 +0100 Subject: [PATCH 4/6] improves styles for valuation budgets --- .../budget_investments/index.html.erb | 50 ++++++++++++------- app/views/valuation/budgets/index.html.erb | 35 ++++++++++--- config/locales/valuation.en.yml | 13 ++++- config/locales/valuation.es.yml | 13 ++++- 4 files changed, 81 insertions(+), 30 deletions(-) diff --git a/app/views/valuation/budget_investments/index.html.erb b/app/views/valuation/budget_investments/index.html.erb index 9b82f7f5a..b44a129aa 100644 --- a/app/views/valuation/budget_investments/index.html.erb +++ b/app/views/valuation/budget_investments/index.html.erb @@ -1,4 +1,7 @@ -

<%= @budget.name %> - <%= t("valuation.budget_investments.index.title") %>

+

+ <%= @budget.name %> - <%= t("valuation.budget_investments.index.title") %> + (Asignadas a EVALUADOR) +

<% @heading_filters.each_slice(8) do |slice| %> @@ -18,25 +21,34 @@

<%= page_entries_info @investments %>

- <% @investments.each do |investment| %> - - - - - - + + + + + + - <% end %> + + + <% @investments.each do |investment| %> + + + + + + + <% end %> +
- <%= investment.id %> - - <%= link_to investment.title, valuation_budget_budget_investment_path(@budget, investment) %> - - <%= link_to t("valuation.budget_investments.index.edit"), edit_valuation_budget_budget_investment_path(@budget, investment) %> - - <%= assigned_valuators_info(investment.valuators) %> - - <%= investment.heading.name %> -
<%= t("valuation.budget_investments.index.table_id") %><%= t("valuation.budget_investments.index.table_title") %><%= t("valuation.budget_investments.index.table_heading_name") %><%= t("valuation.budget_investments.index.table_actions") %>
+ <%= investment.id %> + + <%= link_to investment.title, valuation_budget_budget_investment_path(@budget, investment) %> + + <%= investment.heading.name %> + + <%= link_to t("valuation.budget_investments.index.edit"), + edit_valuation_budget_budget_investment_path(@budget, investment), + class: "button hollow expanded" %> +
<%= paginate @investments %> diff --git a/app/views/valuation/budgets/index.html.erb b/app/views/valuation/budgets/index.html.erb index 014633373..0db30c335 100644 --- a/app/views/valuation/budgets/index.html.erb +++ b/app/views/valuation/budgets/index.html.erb @@ -5,13 +5,34 @@

<%= page_entries_info @budgets %>

- <% @budgets.each do |budget| %> - - + + + + + + - <% end %> + + + <% @budgets.each do |budget| %> + + + + + + + <% end %> +
- <%= link_to budget.name, valuation_budget_budget_investments_path(budget_id: budget.id) %> -
<%= t("valuation.budgets.index.table_name") %><%= t("valuation.budgets.index.table_phase") %><%= t("valuation.budgets.index.table_assigned_headings") %><%= t("valuation.budgets.index.table_actions") %>
+ <%= budget.name %> + + <%= t("budget.phase.#{budget.phase}") %> + + 3 partidas + + <%= link_to t("valuation.budgets.index.evaluate"), + valuation_budget_budget_investments_path(budget_id: budget.id), + class: "button hollow expanded" %> +
-<%= paginate @budgets %> \ No newline at end of file +<%= paginate @budgets %> diff --git a/config/locales/valuation.en.yml b/config/locales/valuation.en.yml index a5195deca..4aafe160b 100644 --- a/config/locales/valuation.en.yml +++ b/config/locales/valuation.en.yml @@ -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 diff --git a/config/locales/valuation.es.yml b/config/locales/valuation.es.yml index 67302437b..641f9c003 100644 --- a/config/locales/valuation.es.yml +++ b/config/locales/valuation.es.yml @@ -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 From fa7d6c18fd99906be7c50e9baa710207d493c127 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 4 Jan 2017 17:33:59 +0100 Subject: [PATCH 5/6] fixes back links on valuation budgets --- app/views/valuation/budget_investments/edit.html.erb | 6 +++++- app/views/valuation/budget_investments/show.html.erb | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/valuation/budget_investments/edit.html.erb b/app/views/valuation/budget_investments/edit.html.erb index e03d850a4..16dc3b59d 100644 --- a/app/views/valuation/budget_investments/edit.html.erb +++ b/app/views/valuation/budget_investments/edit.html.erb @@ -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 %> + + <%= "#{t('valuation.budget_investments.show.title')} #{@investment.id}"%> +<% end %> +

<%= t("valuation.budget_investments.edit.dossier") %>

<%= form_for(@investment, url: valuate_valuation_budget_budget_investment_path(@budget, @investment), html: {id: "valuation_budget_investment_edit_form"}) do |f| %> diff --git a/app/views/valuation/budget_investments/show.html.erb b/app/views/valuation/budget_investments/show.html.erb index 602c53dda..f0eaed2c8 100644 --- a/app/views/valuation/budget_investments/show.html.erb +++ b/app/views/valuation/budget_investments/show.html.erb @@ -1,4 +1,7 @@ -<%= render "shared/back_link" %> +<%= link_to valuation_budget_budget_investments_path do %> + + <%= t('shared.back') %> +<% end %>

<%= t("valuation.budget_investments.show.title") %> <%= @investment.id %>

<%= @investment.title %>

From 32c11c098146ff55668ada5497008fc0d7b8d080 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 4 Jan 2017 17:36:03 +0100 Subject: [PATCH 6/6] removes unused i18n keys --- config/locales/admin.en.yml | 2 -- config/locales/admin.es.yml | 2 -- config/locales/en.yml | 1 - config/locales/es.yml | 1 - 4 files changed, 6 deletions(-) diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index e34c2183c..e0decfc3a 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -82,8 +82,6 @@ en: new: title: New participatory budget show: - phase: Current phase - currency: Currency groups: Groups of budget headings form: group: Group name diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 8109251f1..28d9164aa 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -82,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 diff --git a/config/locales/en.yml b/config/locales/en.yml index 83988ab85..adfec0e84 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -441,7 +441,6 @@ en: collective: Collective flag: Flag as inappropriate hide: Hide - edit: Editar print: print_button: Print this info search: Search diff --git a/config/locales/es.yml b/config/locales/es.yml index 8fd9b2c37..06a68286b 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -445,7 +445,6 @@ es: print_button: Imprimir esta información search: Buscar show: Mostrar - edit: Editar suggest: debate: found: