From beeb5412d714dbdd0e102aab576b7985f9ba0792 Mon Sep 17 00:00:00 2001
From: taitus <%= t("admin.milestones.edit.title") %>
+
+<%= render '/admin/budget_investment_milestones/form' %>
diff --git a/app/views/admin/budget_investment_milestones/new.html.erb b/app/views/admin/budget_investment_milestones/new.html.erb
new file mode 100644
index 000000000..7e065a605
--- /dev/null
+++ b/app/views/admin/budget_investment_milestones/new.html.erb
@@ -0,0 +1,10 @@
+<%= t("admin.milestones.new.creating") %>
+
+ <%= render "form" %>
+
+
+
+<% end %>
diff --git a/app/views/admin/budget_investments/show.html.erb b/app/views/admin/budget_investments/show.html.erb
index a58110c94..f220c0955 100644
--- a/app/views/admin/budget_investments/show.html.erb
+++ b/app/views/admin/budget_investments/show.html.erb
@@ -47,3 +47,12 @@
<%= link_to t("admin.budget_investments.show.edit_dossier"), edit_valuation_budget_budget_investment_path(@budget, @investment) %>
+
+
+
+ <% @investment.milestones.each do |milestone| %>
+ <%= t("admin.milestones.index.table_id") %>
+ <%= t("admin.milestones.index.table_title") %>
+ <%= t("admin.milestones.index.table_description") %>
+ <%= t("admin.milestones.index.table_actions") %>
+
+
+ <% end %>
+
+
+ <%= milestone.id %>
+
+
+ <%= link_to milestone.title, edit_admin_budget_budget_investment_budget_investment_milestone_path(@investment.budget, @investment, milestone) %>
+
+
+ <%= milestone.description %>
+
+
+ <%= link_to t("admin.milestones.index.delete"), admin_budget_budget_investment_budget_investment_milestone_path(@investment.budget, @investment, milestone),
+ method: :delete,
+ class: 'button hollow alert expanded' %>
+
+
+ <%= link_to t("admin.budget_investments.show.new_milestone"), new_admin_budget_budget_investment_budget_investment_milestone_path(@budget, @investment) %> +
diff --git a/config/locales/activerecord.en.yml b/config/locales/activerecord.en.yml index 0af387a50..d45c569d4 100644 --- a/config/locales/activerecord.en.yml +++ b/config/locales/activerecord.en.yml @@ -10,6 +10,9 @@ en: budget/investment: one: "Investment" other: "Investments" + budget/investment/milestone: + one: "milestone" + other: "milestones" comment: one: "Comment" other: "Comments" @@ -98,6 +101,9 @@ en: title: "Title" location: "Location" organization_name: "If you are proposing in the name of a collective/organization, write its name" + budget/investment/milestone: + title: "Title" + description: "Description" comment: body: "Comment" user: "User" diff --git a/config/locales/activerecord.es.yml b/config/locales/activerecord.es.yml index b2b5fc20e..86bb76c87 100644 --- a/config/locales/activerecord.es.yml +++ b/config/locales/activerecord.es.yml @@ -10,6 +10,9 @@ es: budget/investment: one: "Proyecto de inversión" other: "Proyectos de inversión" + budget/investment/milestone: + one: "seguimiento" + other: "seguimientos" comment: one: "Comentario" other: "Comentarios" @@ -96,6 +99,9 @@ es: comment: body: "Comentario" user: "Usuario" + budget/investment/milestone: + title: "Título" + description: "Descripción" debate: author: "Autor" description: "Opinión" diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index bbd8dd1bd..96dc32a8b 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -151,6 +151,8 @@ en: edit_dossier: Edit dossier tags: Tags undefined: Undefined + milestone: Milestone + new_milestone: Create new milestone edit: classification: Clasification assigned_valuators: Valuators @@ -160,6 +162,23 @@ en: tags_placeholder: "Write the tags you want separated by commas (,)" undefined: Undefined search_unfeasible: Search unfeasible + milestones: + index: + table_id: "ID" + table_title: "Title" + table_description: "Description" + table_actions: "Actions" + delete: "Delete milestone" + new: + creating: Create milestone + edit: + title: Edit milestone + create: + notice: New milestone created successfully! + update: + notice: Milestone updated successfully + delete: + notice: Milestone successfully deleted comments: index: filter: Filter diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index a3c6a99b9..405f70152 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -151,6 +151,8 @@ es: edit_dossier: Editar informe tags: Etiquetas undefined: Sin definir + milestone: Seguimiento + new_milestone: Crear nuevo seguimiento edit: classification: Clasificación assigned_valuators: Evaluadores @@ -160,6 +162,23 @@ es: tags_placeholder: "Escribe las etiquetas que desees separadas por comas (,)" undefined: Sin definir search_unfeasible: Buscar inviables + milestones: + index: + table_id: "ID" + table_title: "Título" + table_description: "Descripción" + table_actions: "Acciones" + delete: "Eliminar seguimiento" + new: + creating: Crear seguimiento + edit: + title: Editar seguimiento + create: + notice: Nuevo seguimiento creado con éxito! + update: + notice: Seguimiento actualizado + delete: + notice: Seguimiento borrado correctamente comments: index: filter: Filtro diff --git a/config/routes.rb b/config/routes.rb index 5c5284a91..e436244a1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -199,10 +199,12 @@ Rails.application.routes.draw do end resources :budget_investments, only: [:index, :show, :edit, :update] do + resources :budget_investment_milestones member { patch :toggle_selection } end end + resources :signature_sheets, only: [:index, :new, :create, :show] resources :banners, only: [:index, :new, :create, :edit, :update, :destroy] do diff --git a/db/migrate/20170620132731_create_budget_investment_checkpoints.rb b/db/migrate/20170620132731_create_budget_investment_milestones.rb similarity index 57% rename from db/migrate/20170620132731_create_budget_investment_checkpoints.rb rename to db/migrate/20170620132731_create_budget_investment_milestones.rb index 22081f319..199d8e70e 100644 --- a/db/migrate/20170620132731_create_budget_investment_checkpoints.rb +++ b/db/migrate/20170620132731_create_budget_investment_milestones.rb @@ -1,6 +1,6 @@ -class CreateBudgetInvestmentCheckpoints < ActiveRecord::Migration +class CreateBudgetInvestmentMilestones < ActiveRecord::Migration def change - create_table :budget_investment_checkpoints do |t| + create_table :budget_investment_milestones do |t| t.integer :investment_id t.string "title", limit: 80 t.text "description" diff --git a/db/schema.rb b/db/schema.rb index a5d7ecbb5..4cfa7229f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -114,7 +114,7 @@ ActiveRecord::Schema.define(version: 20170620132731) do add_index "budget_headings", ["group_id"], name: "index_budget_headings_on_group_id", using: :btree - create_table "budget_investment_checkpoints", force: :cascade do |t| + create_table "budget_investment_milestones", force: :cascade do |t| t.integer "investment_id" t.string "title", limit: 80 t.text "description" @@ -932,7 +932,7 @@ ActiveRecord::Schema.define(version: 20170620132731) do t.boolean "email_digest", default: true t.boolean "email_on_direct_message", default: true t.boolean "official_position_badge", default: false - t.datetime "password_changed_at", default: '2017-06-20 13:30:34', null: false + t.datetime "password_changed_at", default: '2017-06-22 11:21:30', null: false t.boolean "created_from_signature", default: false t.integer "failed_email_digests_count", default: 0 t.text "former_users_data_log", default: "" diff --git a/spec/factories.rb b/spec/factories.rb index 6401616e7..1d842e299 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -322,10 +322,10 @@ FactoryGirl.define do reason "unfeasible" end - factory :budget_investment_checkpoint, class: 'Budget::Investment::Checkpoint' do + factory :budget_investment_milestone, class: 'Budget::Investment::Milestone' do association :investment, factory: :budget_investment - sequence(:title) { |n| "Budget Investment Checkpoint #{n} title" } - description 'Checkpoint description' + sequence(:title) { |n| "Budget Investment Milestone #{n} title" } + description 'Milestone description' end factory :vote do diff --git a/spec/features/admin/budget_investment_milestones_spec.rb b/spec/features/admin/budget_investment_milestones_spec.rb new file mode 100644 index 000000000..1550f05e6 --- /dev/null +++ b/spec/features/admin/budget_investment_milestones_spec.rb @@ -0,0 +1,70 @@ +require 'rails_helper' + +feature 'Admin budget investment milestones' do + + background do + admin = create(:administrator) + login_as(admin.user) + + @investment = create(:budget_investment) + end + + context "Index" do + scenario 'Displaying milestones' do + milestone = create(:budget_investment_milestone, investment: @investment) + + visit admin_budget_budget_investment_path(@investment.budget, @investment) + + expect(page).to have_content("Milestone") + expect(page).to have_content(milestone.title) + expect(page).to have_content(milestone.id) + end + end + + context "New" do + scenario "Add milestone" do + visit admin_budget_budget_investment_path(@investment.budget, @investment) + + click_link 'Create new milestone' + + fill_in 'budget_investment_milestone_title', with: 'New title milestone' + fill_in 'budget_investment_milestone_description', with: 'New description milestone' + + click_button 'Create milestone' + + expect(page).to have_content 'New title milestone' + expect(page).to have_content 'New description milestone' + end + end + + context "Edit" do + scenario "Change title and description" do + milestone = create(:budget_investment_milestone, investment: @investment) + + visit admin_budget_budget_investment_path(@investment.budget, @investment) + + click_link milestone.title + + fill_in 'budget_investment_milestone_title', with: 'Changed title' + fill_in 'budget_investment_milestone_description', with: 'Changed description' + + click_button 'Update milestone' + + expect(page).to have_content 'Changed title' + expect(page).to have_content 'Changed description' + end + end + + context "Delete" do + scenario "Remove milestone" do + milestone = create(:budget_investment_milestone, investment: @investment, title: "Title will it remove") + + visit admin_budget_budget_investment_path(@investment.budget, @investment) + + click_link "Delete milestone" + + expect(page).to_not have_content 'Title will it remove' + end + end + +end diff --git a/spec/features/admin/budget_investments_spec.rb b/spec/features/admin/budget_investments_spec.rb index 52c008c18..c50a05f32 100644 --- a/spec/features/admin/budget_investments_spec.rb +++ b/spec/features/admin/budget_investments_spec.rb @@ -27,7 +27,7 @@ feature 'Admin budget investments' do context "Index" do - scenario 'Displaying investmentss' do + scenario 'Displaying investments' do budget_investment = create(:budget_investment, budget: @budget, cached_votes_up: 77) visit admin_budget_budget_investments_path(budget_id: @budget.id) expect(page).to have_content(budget_investment.title) diff --git a/spec/models/budget/investment/checkpoint_spec.rb b/spec/models/budget/investment/checkpoint_spec.rb deleted file mode 100644 index fe40a58bb..000000000 --- a/spec/models/budget/investment/checkpoint_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -require 'rails_helper' - -describe "Budget::Investment::Checkpoint" do - - describe "Validations" do - let(:checkpoint) { build(:budget_investment_checkpoint) } - - it "should be valid" do - expect(checkpoint).to be_valid - end - - it "should not be valid without a title" do - checkpoint.title = nil - expect(checkpoint).to_not be_valid - end - - it "should not be valid without an investment" do - checkpoint.investment_id = nil - expect(checkpoint).to_not be_valid - end - end - -end diff --git a/spec/models/budget/investment/milestone_spec.rb b/spec/models/budget/investment/milestone_spec.rb new file mode 100644 index 000000000..5fc749d36 --- /dev/null +++ b/spec/models/budget/investment/milestone_spec.rb @@ -0,0 +1,23 @@ +require 'rails_helper' + +describe "Budget::Investment::Milestone" do + + describe "Validations" do + let(:milestone) { build(:budget_investment_milestone) } + + it "should be valid" do + expect(milestone).to be_valid + end + + it "should not be valid without a title" do + milestone.title = nil + expect(milestone).to_not be_valid + end + + it "should not be valid without an investment" do + milestone.investment_id = nil + expect(milestone).to_not be_valid + end + end + +end From 87eeb45584104afce06e58d06ffd2761f3c3dab3 Mon Sep 17 00:00:00 2001 From: taitus<%= milestone.description %>
+ <% end %> +<%= milestone.description %>
- <% end %> +<%= milestone.description %>
++ <%= t('admin.milestones.index.no_milestones') %> +
<% end %> diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index 96dc32a8b..baca6b270 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -169,6 +169,7 @@ en: table_description: "Description" table_actions: "Actions" delete: "Delete milestone" + no_milestones: "Don't have defined milestones" new: creating: Create milestone edit: diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 2b0b68a1c..f47bd19a8 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -169,6 +169,7 @@ es: table_description: "Descripción" table_actions: "Acciones" delete: "Eliminar hito" + no_milestones: "No hay hitos definidos" new: creating: Crear hito edit: diff --git a/spec/features/admin/budget_investment_milestones_spec.rb b/spec/features/admin/budget_investment_milestones_spec.rb index 208cc61a0..9bcb78479 100644 --- a/spec/features/admin/budget_investment_milestones_spec.rb +++ b/spec/features/admin/budget_investment_milestones_spec.rb @@ -19,6 +19,13 @@ feature 'Admin budget investment milestones' do expect(page).to have_content(milestone.title) expect(page).to have_content(milestone.id) end + + scenario 'Displaying no_milestones text' do + visit admin_budget_budget_investment_path(@investment.budget, @investment) + + expect(page).to have_content("Milestone") + expect(page).to have_content("Don't have defined milestones") + end end context "New" do From 0222d61e1eb5165d8e4e10addef16fdb53378e93 Mon Sep 17 00:00:00 2001 From: taitus<%= milestone.description %>
<%= milestone.description %>
<%= t("shared.suggest.#{resource_name}.found",
count: @resources.count,
From ce7a67418b4ebf62adc292102793c39b34fa9a08 Mon Sep 17 00:00:00 2001
From: Bertocq
<%= t("admin.questions.new.valid_answers_note") %>
- <%= f.text_field :valid_answers, label: false %> +<%= t("admin.questions.new.valid_answers_note") %>
+ <%= f.text_field :valid_answers, label: false, aria: {describedby: "valid-answers-help-text"} %><%= t("admin.signature_sheets.new.document_numbers_note") %>
- <%= f.text_area :document_numbers, rows: "6", label: false %> +<%= t("admin.signature_sheets.new.document_numbers_note") %>
+ <%= f.text_area :document_numbers, rows: "6", label: false, aria: {describedby: "document-numbers-help-text"} %> <%= f.submit(class: "button", value: t("admin.signature_sheets.new.submit")) %> <% end %> \ No newline at end of file diff --git a/app/views/budgets/investments/_form.html.erb b/app/views/budgets/investments/_form.html.erb index 28b47d726..94f6283e9 100644 --- a/app/views/budgets/investments/_form.html.erb +++ b/app/views/budgets/investments/_form.html.erb @@ -31,7 +31,7 @@<%= t("budgets.investments.form.tags_instructions") %>
+<%= t("budgets.investments.form.tags_instructions") %>
diff --git a/app/views/debates/_form.html.erb b/app/views/debates/_form.html.erb index c88045f26..96a5337ca 100644 --- a/app/views/debates/_form.html.erb +++ b/app/views/debates/_form.html.erb @@ -17,11 +17,12 @@<%= t("debates.form.tags_instructions") %>
+<%= t("debates.form.tags_instructions") %>
<%= f.text_field :tag_list, value: @debate.tag_list.to_s, label: false, - placeholder: t("debates.form.tags_placeholder") %> + placeholder: t("debates.form.tags_placeholder"), + aria: {describedby: "tag-list-help-text"} %><%= t('management.user_invites.new.info') %>
- <%= text_area_tag "emails", nil, rows: 5, placeholder: t('management.user_invites.new.info') %> +<%= t('management.user_invites.new.info') %>
+ <%= text_area_tag "emails", nil, rows: 5, + placeholder: t('management.user_invites.new.info'), + aria: {describedby: "emails-help-text"} %><%= t("devise_views.organizations.registrations.new.responsible_name_note") %>
- <%= fo.text_field :responsible_name, placeholder: t("devise_views.organizations.registrations.new.responsible_name_label"), maxlength: Organization.responsible_name_max_length, label: false %> +<%= t("devise_views.organizations.registrations.new.responsible_name_note") %>
+ <%= fo.text_field :responsible_name, placeholder: t("devise_views.organizations.registrations.new.responsible_name_label"), + maxlength: Organization.responsible_name_max_length, label: false, + aria: {describedby: "responsible-name-help-text"} %> <% end %> <%= f.email_field :email, placeholder: t("devise_views.organizations.registrations.new.email_label") %> diff --git a/app/views/proposals/_form.html.erb b/app/views/proposals/_form.html.erb index 3eda38cd1..232f65ac1 100644 --- a/app/views/proposals/_form.html.erb +++ b/app/views/proposals/_form.html.erb @@ -12,17 +12,21 @@<%= t("proposals.form.proposal_question_example_html") %> -
- <%= f.text_field :question, maxlength: Proposal.question_max_length, placeholder: t("proposals.form.proposal_question"), label: false %> + + <%= f.text_field :question, maxlength: Proposal.question_max_length, + placeholder: t("proposals.form.proposal_question"), + label: false, + aria: {describedby: "question-help-text"} %><%= t("proposals.form.proposal_summary_note") %>
+<%= t("proposals.form.proposal_summary_note") %>
<%= f.text_area :summary, rows: 4, maxlength: 200, label: false, - placeholder: t('proposals.form.proposal_summary') %> + placeholder: t('proposals.form.proposal_summary'), + aria: {describedby: "summary-help-text"} %><%= t("proposals.form.proposal_video_url_note") %>
- <%= f.text_field :video_url, placeholder: t("proposals.form.proposal_video_url"), label: false %> +<%= t("proposals.form.proposal_video_url_note") %>
+ <%= f.text_field :video_url, placeholder: t("proposals.form.proposal_video_url"), label: false, + aria: {describedby: "video-url-help-text"} %><%= t("proposals.form.tags_instructions") %>
+<%= t("proposals.form.tags_instructions") %>
<% if current_user.unverified? %><%= t("proposals.form.proposal_responsible_name_note") %>
- <%= f.text_field :responsible_name, placeholder: t("proposals.form.proposal_responsible_name"), label: false %> +<%= t("proposals.form.proposal_responsible_name_note") %>
+ <%= f.text_field :responsible_name, placeholder: t("proposals.form.proposal_responsible_name"), label: false, + aria: {describedby: "responsible-name-help-text"} %>- <%= t("shared.suggest.#{resource_name}.found", - count: @resources.count, - query: @search_terms)%> +
+ + <%= t("shared.suggest.#{resource_name}.found", + count: @resources.count, + query: @search_terms)%> +
- <%= t("shared.suggest.#{resource_name}.message", - count: @resources.count, - query: @search_terms, - limit: @limit) %> +
+ + <%= t("shared.suggest.#{resource_name}.message", + count: @resources.count, + query: @search_terms, + limit: @limit) %> + <%= link_to t("shared.suggest.#{resource_name}.see_all"), polymorphic_url(resource_model, search: @search_terms)%>
@@ -26,4 +30,4 @@<%= t("devise_views.users.registrations.edit.leave_blank") %>
- <%= f.password_field :password, autocomplete: "off", label: false, placeholder: t("devise_views.users.registrations.edit.password_label") %> +<%= t("devise_views.users.registrations.edit.leave_blank") %>
+ <%= f.password_field :password, autocomplete: "off", label: false, + placeholder: t("devise_views.users.registrations.edit.password_label"), + aria: {describedby: "password-help-text"} %><%= t("devise_views.users.registrations.edit.need_current") %>
- <%= f.password_field :current_password, label: false, autocomplete: "off", placeholder: t("devise_views.users.registrations.edit.current_password_label") %> +<%= t("devise_views.users.registrations.edit.need_current") %>
+ <%= f.password_field :current_password, label: false, autocomplete: "off", + placeholder: t("devise_views.users.registrations.edit.current_password_label"), + aria: {describedby: "current-password-help-text"} %><%= t("devise_views.users.registrations.new.username_note") %>
- <%= f.text_field :username, autofocus: true, maxlength: User.username_max_length, placeholder: t("devise_views.users.registrations.new.username_label"), label: false %> +<%= t("devise_views.users.registrations.new.username_note") %>
+ <%= f.text_field :username, autofocus: true, maxlength: User.username_max_length, + placeholder: t("devise_views.users.registrations.new.username_label"), + label: false, + aria: {describedby: "username-help-text"} %> <%= f.invisible_captcha :family_name %> diff --git a/app/views/verification/residence/new.html.erb b/app/views/verification/residence/new.html.erb index 703e4b98f..2159d1a01 100644 --- a/app/views/verification/residence/new.html.erb +++ b/app/views/verification/residence/new.html.erb @@ -76,9 +76,9 @@<%= t("verification.residence.new.postal_code_note") %>
+<%= t("verification.residence.new.postal_code_note") %>
<%= t("verification.sms.new.phone_note") %>
- <%= f.text_field :phone, label: false, placeholder: t("verification.sms.new.phone_placeholder") %> +<%= t("verification.sms.new.phone_note") %>
+ <%= f.text_field :phone, label: false, + placeholder: t("verification.sms.new.phone_placeholder"), + aria: {describedby: "phone-help-text"} %>
+
+
+