diff --git a/app/assets/images/logo_email.png b/app/assets/images/logo_email.png index 09bc18d63..e8ca37d37 100644 Binary files a/app/assets/images/logo_email.png and b/app/assets/images/logo_email.png differ diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index f7928ff7e..f002cedd6 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,5 +1,6 @@ class ApplicationMailer < ActionMailer::Base helper :settings + helper :application default from: "#{Setting["mailer_from_name"]} <#{Setting["mailer_from_address"]}>" layout "mailer" end diff --git a/app/models/site_customization/image.rb b/app/models/site_customization/image.rb index 12a61dad8..c800e21b1 100644 --- a/app/models/site_customization/image.rb +++ b/app/models/site_customization/image.rb @@ -5,7 +5,8 @@ class SiteCustomization::Image < ApplicationRecord "social_media_icon_twitter" => [246, 246], "apple-touch-icon-200" => [200, 200], "budget_execution_no_image" => [800, 600], - "map" => [420, 500] + "map" => [420, 500], + "logo_email" => [400, 80] } has_attached_file :image diff --git a/app/views/admin/budget_investments/_select_investment.html.erb b/app/views/admin/budget_investments/_select_investment.html.erb index 040d128e1..788d9824b 100644 --- a/app/views/admin/budget_investments/_select_investment.html.erb +++ b/app/views/admin/budget_investments/_select_investment.html.erb @@ -47,7 +47,7 @@ id: "budget_investment_visible_to_valuators" %> <% end %> -
+ <%= t("admin.newsletters.new.header_footer_help_text_html", + link: link_to(t("admin.newsletters.new.image_link"), + admin_site_customization_images_path)) %> +
<%= render "form" %> diff --git a/app/views/admin/poll/officers/_search.html.erb b/app/views/admin/poll/officers/_search.html.erb index 92e8a2de5..4e5574d07 100644 --- a/app/views/admin/poll/officers/_search.html.erb +++ b/app/views/admin/poll/officers/_search.html.erb @@ -1,3 +1,5 @@ +<%= t("admin.poll_officers.search.help") %>
+ <%= form_tag search_admin_officers_path, method: :get, remote: true do %><%= t("admin.site_customization.pages.new.slug_help_html") %> <%= f.text_field :slug, label: false, size: 80, maxlength: 80 %>
app/views/layouts/mailer_header and app/views/layouts/mailer_footer.https://consulproject.org/page-slug"
page:
created_at: Created at
status: Status
diff --git a/config/locales/en/community.yml b/config/locales/en/community.yml
index bcda80b6c..3e46a0685 100644
--- a/config/locales/en/community.yml
+++ b/config/locales/en/community.yml
@@ -26,7 +26,7 @@ en:
new_topic: Create topic
topic:
edit: Edit topic
- destroy: Destroy topic
+ destroy: Delete topic
comments:
one: 1 comment
other: "%{count} comments"
diff --git a/config/locales/en/documents.yml b/config/locales/en/documents.yml
index 8aa127a9f..d2a6f75b3 100644
--- a/config/locales/en/documents.yml
+++ b/config/locales/en/documents.yml
@@ -14,11 +14,11 @@ en:
actions:
destroy:
notice: Document was deleted successfully.
- alert: Cannot destroy document.
+ alert: Cannot delete document.
confirm: Are you sure you want to delete the document? This action cannot be undone!
buttons:
download_document: Download file
- destroy_document: Destroy document
+ destroy_document: Delete document
errors:
messages:
in_between: must be in between %{min} and %{max}
diff --git a/config/locales/en/images.yml b/config/locales/en/images.yml
index 14ca43c2d..a059f185b 100644
--- a/config/locales/en/images.yml
+++ b/config/locales/en/images.yml
@@ -14,7 +14,7 @@ en:
actions:
destroy:
notice: Image was deleted successfully.
- alert: Cannot destroy image.
+ alert: Cannot delete image.
errors:
messages:
in_between: must be in between %{min} and %{max}
diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml
index b7d2b99bf..ffbc3a295 100644
--- a/config/locales/es/admin.yml
+++ b/config/locales/es/admin.yml
@@ -780,6 +780,8 @@ es:
new:
title: Nueva newsletter
from: Dirección de correo electrónico que aparecerá como remitente de la newsletter
+ header_footer_help_text_html: "El encabezado y pie son los mismos en todos los emails, puedes modificarlos en app/views/layouts/mailer_header y app/views/layouts/mailer_footer.https://consulproject.org/slug-de-pagina"
page:
created_at: Creada
status: Estado
diff --git a/spec/features/admin/budget_groups_spec.rb b/spec/features/admin/budget_groups_spec.rb
index f719dc6a8..14f76c319 100644
--- a/spec/features/admin/budget_groups_spec.rb
+++ b/spec/features/admin/budget_groups_spec.rb
@@ -91,7 +91,7 @@ feature "Admin budget groups" do
visit admin_budget_groups_path(budget)
within("#budget_group_#{group.id}") { click_link "Delete" }
- expect(page).to have_content "You cannot destroy a Group that has associated headings"
+ expect(page).to have_content "You cannot delete a Group that has associated headings"
expect(page).to have_selector "#budget_group_#{group.id}"
end
diff --git a/spec/features/admin/budget_headings_spec.rb b/spec/features/admin/budget_headings_spec.rb
index 2429b1ad4..dac63ba04 100644
--- a/spec/features/admin/budget_headings_spec.rb
+++ b/spec/features/admin/budget_headings_spec.rb
@@ -94,7 +94,7 @@ feature "Admin budget headings" do
visit admin_budget_group_headings_path(budget, group)
within("#budget_heading_#{heading.id}") { click_link "Delete" }
- expect(page).to have_content "You cannot destroy a Heading that has associated investments"
+ expect(page).to have_content "You cannot delete a Heading that has associated investments"
expect(page).to have_selector "#budget_heading_#{heading.id}"
end
diff --git a/spec/features/admin/budget_investments_spec.rb b/spec/features/admin/budget_investments_spec.rb
index bfc8e7881..79bdd3483 100644
--- a/spec/features/admin/budget_investments_spec.rb
+++ b/spec/features/admin/budget_investments_spec.rb
@@ -1407,6 +1407,32 @@ feature "Admin budget investments" do
end
end
+ scenario "Show only selected text when budget is finished" do
+ budget.update(phase: "finished")
+
+ visit admin_budget_budget_investments_path(budget)
+
+ within("#budget_investment_#{unfeasible_bi.id} #selection") do
+ expect(page).not_to have_content("Select")
+ expect(page).not_to have_content("Selected")
+ end
+
+ within("#budget_investment_#{feasible_bi.id} #selection") do
+ expect(page).not_to have_content("Select")
+ expect(page).not_to have_content("Selected")
+ end
+
+ within("#budget_investment_#{feasible_vf_bi.id} #selection") do
+ expect(page).not_to have_content("Select")
+ expect(page).not_to have_content("Selected")
+ end
+
+ within("#budget_investment_#{selected_bi.id} #selection") do
+ expect(page).not_to contain_exactly("Select")
+ expect(page).to have_content("Selected")
+ end
+ end
+
scenario "Selecting an investment", :js do
visit admin_budget_budget_investments_path(budget)
diff --git a/spec/features/admin/budgets_spec.rb b/spec/features/admin/budgets_spec.rb
index a4c1620a6..3bc827caf 100644
--- a/spec/features/admin/budgets_spec.rb
+++ b/spec/features/admin/budgets_spec.rb
@@ -148,7 +148,7 @@ feature "Admin budgets" do
click_link "Edit budget"
click_link "Delete budget"
- expect(page).to have_content("You cannot destroy a budget that has associated investments")
+ expect(page).to have_content("You cannot delete a budget that has associated investments")
expect(page).to have_content("There is 1 budget")
end
@@ -158,7 +158,7 @@ feature "Admin budgets" do
visit edit_admin_budget_path(budget)
click_link "Delete budget"
- expect(page).to have_content("You cannot destroy a budget that has an associated poll")
+ expect(page).to have_content("You cannot delete a budget that has an associated poll")
expect(page).to have_content("There is 1 budget")
end
end
diff --git a/spec/features/admin/poll/shifts_spec.rb b/spec/features/admin/poll/shifts_spec.rb
index 35efc2927..a4b1cbed9 100644
--- a/spec/features/admin/poll/shifts_spec.rb
+++ b/spec/features/admin/poll/shifts_spec.rb
@@ -22,12 +22,14 @@ feature "Admin shifts" do
expect(page).to have_css(".shift", count: 1)
expect(page).to have_content I18n.l(Date.current, format: :long)
expect(page).to have_content officer.name
+ expect(page).to have_content officer.email
visit new_admin_booth_shift_path(booth2)
expect(page).to have_css(".shift", count: 1)
expect(page).to have_content I18n.l(Time.zone.tomorrow, format: :long)
expect(page).to have_content officer.name
+ expect(page).to have_content officer.email
end
scenario "Create Vote Collection Shift and Recount & Scrutiny Shift on same date", :js do
@@ -229,6 +231,7 @@ feature "Admin shifts" do
expect(page).to have_css(".shift", count: 1)
expect(page).to have_content(officer.name)
+ expect(page).to have_content(officer.email)
end
scenario "Empty" do
diff --git a/spec/features/admin/site_customization/images_spec.rb b/spec/features/admin/site_customization/images_spec.rb
index a8dd454a5..8a5a00c28 100644
--- a/spec/features/admin/site_customization/images_spec.rb
+++ b/spec/features/admin/site_customization/images_spec.rb
@@ -72,6 +72,23 @@ feature "Admin custom images" do
end
end
+ scenario "Image is replaced on admin newsletters" do
+ newsletter = create(:newsletter, segment_recipient: "all_users")
+
+ visit admin_site_customization_images_path
+
+ within("tr#image_logo_email") do
+ attach_file "site_customization_image_image", "spec/fixtures/files/logo_email_custom.png"
+ click_button "Update"
+ end
+
+ visit admin_newsletter_path(newsletter)
+
+ within(".newsletter-body-content") do
+ expect(page).to have_css("img[src*='logo_email_custom.png']")
+ end
+ end
+
scenario "Upload invalid image" do
visit admin_root_path
diff --git a/spec/features/admin/tags_spec.rb b/spec/features/admin/tags_spec.rb
index 5580ad7b7..3102df400 100644
--- a/spec/features/admin/tags_spec.rb
+++ b/spec/features/admin/tags_spec.rb
@@ -40,7 +40,7 @@ feature "Admin tags" do
expect(page).to have_content tag2.name
within("#tag_#{tag2.id}") do
- click_link "Destroy topic"
+ click_link "Delete topic"
end
visit admin_tags_path
@@ -59,7 +59,7 @@ feature "Admin tags" do
expect(page).to have_content tag2.name
within("#tag_#{tag2.id}") do
- click_link "Destroy topic"
+ click_link "Delete topic"
end
visit admin_tags_path
diff --git a/spec/features/topics_specs.rb b/spec/features/topics_specs.rb
index 0169af157..6af83bb2e 100644
--- a/spec/features/topics_specs.rb
+++ b/spec/features/topics_specs.rb
@@ -137,7 +137,7 @@ feature "Topics" do
login_as(user)
visit community_topic_path(community, topic)
- click_link "Destroy topic"
+ click_link "Delete topic"
expect(page).to have_content "Topic deleted successfully."
expect(page).not_to have_content topic.title
@@ -153,7 +153,7 @@ feature "Topics" do
visit community_path(community)
- expect(page).not_to have_link "Destroy"
+ expect(page).not_to have_link "Delete"
end
end
diff --git a/spec/fixtures/files/logo_email_custom.png b/spec/fixtures/files/logo_email_custom.png
new file mode 100644
index 000000000..af31d4d97
Binary files /dev/null and b/spec/fixtures/files/logo_email_custom.png differ
diff --git a/spec/shared/features/documentable.rb b/spec/shared/features/documentable.rb
index e3be2c869..64387420d 100644
--- a/spec/shared/features/documentable.rb
+++ b/spec/shared/features/documentable.rb
@@ -42,28 +42,28 @@ shared_examples "documentable" do |documentable_factory_name,
scenario "Should not be able when no user logged in" do
visit send(documentable_path, arguments)
- expect(page).not_to have_link("Destroy document")
+ expect(page).not_to have_link("Delete document")
end
scenario "Should be able when documentable author is logged in" do
login_as documentable.author
visit send(documentable_path, arguments)
- expect(page).to have_link("Destroy document")
+ expect(page).to have_link("Delete document")
end
scenario "Administrators cannot destroy documentables they have not authored" do
login_as(administrator)
visit send(documentable_path, arguments)
- expect(page).not_to have_link("Destroy document")
+ expect(page).not_to have_link("Delete document")
end
scenario "Users cannot destroy documentables they have not authored" do
login_as(create(:user))
visit send(documentable_path, arguments)
- expect(page).not_to have_link("Destroy document")
+ expect(page).not_to have_link("Delete document")
end
end
@@ -122,7 +122,7 @@ shared_examples "documentable" do |documentable_factory_name,
visit send(documentable_path, arguments)
within "#document_#{document.id}" do
- click_on "Destroy document"
+ click_on "Delete document"
end
expect(page).to have_content "Document was deleted successfully."
@@ -134,7 +134,7 @@ shared_examples "documentable" do |documentable_factory_name,
visit send(documentable_path, arguments)
within "#document_#{document.id}" do
- click_on "Destroy document"
+ click_on "Delete document"
end
expect(page).not_to have_content "Documents (0)"
@@ -146,7 +146,7 @@ shared_examples "documentable" do |documentable_factory_name,
visit send(documentable_path, arguments)
within "#document_#{document.id}" do
- click_on "Destroy document"
+ click_on "Delete document"
end
within "##{dom_id(documentable)}" do