Skip to content

Commit

Permalink
Backport 'Fix HTML titles in admin panel (part 2)' to v0.27 (decidim#…
Browse files Browse the repository at this point in the history
…11336)

* Fix HTML titles in admin panel (part 2)

* Fix admin titles part 2

* HTML titles added to the components of modules

* Apply suggestions from code review

Checked and committed!

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>

* Updated i18n-tasks

* Changes to merge

* Update on i18n locales

* Added changes to the i18n translations

* Update to translations on admin logs index

* Update decidim-admin/app/views/decidim/admin/logs/index.html.erb

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>

* Update decidim-accountability/app/views/decidim/accountability/admin/import_results/new.html.erb

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>

* Update decidim-accountability/app/views/decidim/accountability/admin/projects_import/new.html.erb

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>

* Update decidim-accountability/app/views/decidim/accountability/admin/results/edit.html.erb

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>

* New changes made to html title parsing of H2

* Final clean up of i18n translations part 2

---------

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>

* Remove unused locales strings

---------

Co-authored-by: Tom <101816158+greenwoodt@users.noreply.github.com>
Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
  • Loading branch information
3 people authored Jul 25, 2023
1 parent 5eca9d5 commit 7178650
Show file tree
Hide file tree
Showing 59 changed files with 60 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= form_tag(import_results_path, multipart: true, class: "form new_import") do %>
<div class="card">
<div class="card-divider">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form edit_result" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form new_result" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form edit_status" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form new_status" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t("attachment_collections.edit.title", scope: "decidim.admin")) %>
<%= decidim_form_for(@form, url: url_for([@attachment_collection.collection_for, @attachment_collection]), html: { class: "form edit_attachment_collection" }) do |f| %>
<%= render partial: "decidim/admin/attachment_collections/form", object: f, locals: { title: t("attachment_collections.edit.title", scope: "decidim.admin") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t("attachment_collections.index.attachment_collections_title", scope: "decidim.admin")) %>
<div class="card" id="attachment_collections">
<div class="card-divider">
<h2 class='card-title'>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t("attachment_collections.new.title", scope: "decidim.admin")) %>
<%= decidim_form_for(@form, url: url_for([collection_for, @form]), html: { class: "form new_attachment_collection" }) do |f| %>
<%= render partial: "decidim/admin/attachment_collections/form", object: f, locals: { title: t("attachment_collections.new.title", scope: "decidim.admin") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, url: url_for([@attachment.attached_to, @attachment]), html: { class: "form edit_attachment" }) do |f| %>
<%= render partial: "decidim/admin/attachments/form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".attachments_title")) %>
<div class='card' id="attachments">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, url: url_for([attached_to, @form]), html: { class: "form new_attachment" }) do |f| %>
<%= render partial: "decidim/admin/attachments/form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, url: category_path(@category.participatory_space, @category), html: { class: "form edit_category" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t("categories.index.categories_title", scope: "decidim.admin")) %>
<div class="card" id="categories">
<div class="card-divider">
<h2 class='card-title'>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t("categories.new.title", scope: "decidim.admin")) %>
<%= decidim_form_for(@form, url: categories_path(current_participatory_space), html: { class: "form new_category" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t("categories.new.title", scope: "decidim.admin") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title", name: t("#{@component.manifest.name}.name", scope: "decidim.components"))) %>
<%= decidim_form_for([current_participatory_space, @form], url: component_path(current_participatory_space, @component), method: "put", html: { class: "form edit_component" }) do |form| %>
<%= render partial: "form", object: form, locals: { component: @component, title: t(".title", name: t("#{@component.manifest.name}.name", scope: "decidim.components")) } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t("components.title", scope: "decidim.admin")) %>
<div class="card">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

<% add_decidim_page_title(t(".title", name: t("#{manifest.name}.name", scope: "decidim.components"))) %>
<%= decidim_form_for([current_participatory_space, @form], url: components_path(type: params[:type]), method: "post", html: { class: "form new_component" }) do |form| %>
<%= render partial: "form", object: form, locals: { component: @component, title: t(".title", name: t("#{manifest.name}.name", scope: "decidim.components")) } %>

Expand Down
1 change: 1 addition & 0 deletions decidim-admin/app/views/decidim/admin/logs/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t("admin_log", scope: "decidim.admin.titles")) %>
<div class="content">
<div class="row">
<%= render partial: "decidim/admin/logs/logs_list", locals: { logs: logs } %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card with-overflow">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(content_block.public_name_key)) %>
<%= decidim_form_for(@form, html: { class: "form edit_content_block" }, url: resource_landing_page_content_block_path) do |form| %>
<div class="card">
<div class="card-divider">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form edit_post" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form new_post" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form edit_budget" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card with-overflow">
<div class="card-divider">
<h2 class="card-title flex--sbc">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form new_budget" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title("#{translated_attribute(budget.title)} - #{t(".title")}") %>
<%= decidim_form_for([budget, @form], html: { class: "form edit_project" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: "#{translated_attribute(budget.title)} &gt; #{t(".title")}" } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card with-overflow">
<div class="card-divider">
<h2 class="card-title flex--sbc">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title("#{translated_attribute(budget.title)} - #{t(".title")}") %>
<%= decidim_form_for([budget, @form], html: { class: "form new_project" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: "#{translated_attribute(budget.title)} &gt; #{t(".title")}" } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, url: budget_proposals_import_path(budget), html: { class: "form import_proposals" }) do |f| %>
<% if @form.origin_components.any? %>
<div class="card">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form edit_debate" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form new_debate" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form edit_election" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form new_election" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card" id="trustees">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, url: trustees_path, html: { class: "form new_trustee" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for([current_voting, @form], url: { action: "update" }, html: { class: "form edit_ballot_style" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="callout warning">
<%= icon "info" %>
<span class="callout-text"><%= t("explanation_callout", scope: "decidim.votings.admin.ballot_styles.index") %></span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for([current_participatory_space, @form], html: { class: "form new_ballot_style" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t("show.heading", scope: "decidim.votings.census.admin.census")) %>
<div class="card">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<% add_decidim_page_title(t("decidim.forms.admin.questionnaires.edit.title")) %>

<% if templates_defined? && choose_template? %>
<%= render partial: "decidim/templates/admin/questionnaire_templates/choose", locals: { target: questionnaire, form_title: t("decidim.forms.admin.questionnaires.edit.title") } %>
<% else %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, url: { action: "update" }, html: { class: "form meetings_form edit_meeting" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form meetings_form new_meeting" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, url: page_path, method: :post, html: { class: "form edit_page" }) do |form| %>
<%= render partial: "form", object: form, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form edit_proposal proposal_form_admin" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card with-overflow">
<div class="card-divider">
<h2 class="card-title flex--sbc">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<%= decidim_form_for(@form, html: { class: "form new_proposal proposal_form_admin" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t(".title") } %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(translated_attribute(proposal.title)) %>
<div class="card">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<h2 class="process-title-summary"><%= t ".title" %></h2>

<%= decidim_form_for(@form, html: { class: "form confirm_destroy_sortition" }, method: :delete) do |form| %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(translated_attribute(sortition.title)) %>
<h2 class="process-title-summary">
<%= decidim_html_escape(translated_attribute(sortition.title)) %>
</h2>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<div class="card">
<div class="card-divider">
<h2 class="card-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(t(".title")) %>
<h2 class="process-title-summary">
<%= t ".title" %>
</h2>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% add_decidim_page_title(translated_attribute(sortition.title)) %>
<div class="card" id="sortition">
<div class="card-divider">
<h2 class="card-title">
Expand Down

0 comments on commit 7178650

Please sign in to comment.