From 758d9896ecebb827ff712a467935b62212daf0ca Mon Sep 17 00:00:00 2001 From: Hugoren Martinako Date: Thu, 27 Jul 2023 08:48:10 +0200 Subject: [PATCH 01/14] Place the announcemente inside the layout (#11381) --- decidim-blogs/app/views/decidim/blogs/posts/index.html.erb | 4 +++- decidim-blogs/app/views/decidim/blogs/posts/show.html.erb | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/decidim-blogs/app/views/decidim/blogs/posts/index.html.erb b/decidim-blogs/app/views/decidim/blogs/posts/index.html.erb index da610393e98ca..64357abb7cf55 100644 --- a/decidim-blogs/app/views/decidim/blogs/posts/index.html.erb +++ b/decidim-blogs/app/views/decidim/blogs/posts/index.html.erb @@ -1,4 +1,4 @@ -<%= render partial: "decidim/shared/component_announcement" %> +<%= append_javascript_pack_tag "decidim_blogs" %> <%= append_stylesheet_pack_tag "decidim_blogs" %> <% content_for :aside do %> @@ -7,6 +7,8 @@ <%= render layout: "layouts/decidim/shared/layout_two_col" do %> + <%= render partial: "decidim/shared/component_announcement" %> +
<% paginate_posts.each do |post| %> <%= card_for post, size: :l %> diff --git a/decidim-blogs/app/views/decidim/blogs/posts/show.html.erb b/decidim-blogs/app/views/decidim/blogs/posts/show.html.erb index 97b3390d0891a..d59a11b2afcc2 100644 --- a/decidim-blogs/app/views/decidim/blogs/posts/show.html.erb +++ b/decidim-blogs/app/views/decidim/blogs/posts/show.html.erb @@ -15,6 +15,7 @@ ) %> +<%= append_javascript_pack_tag "decidim_blogs" %> <%= append_stylesheet_pack_tag "decidim_blogs" %> <%= render layout: "layouts/decidim/shared/layout_center", locals: { columns: 8 } do %> From 2cccaa3947c0ed9d9057c5903910601a546b6e6a Mon Sep 17 00:00:00 2001 From: Hugoren Martinako Date: Thu, 27 Jul 2023 10:03:09 +0200 Subject: [PATCH 02/14] Redesign: remove data-picker presence from public site (#11318) * remove data-picker presence from public site * remove any reference to data_picker form the filters_component * fix linter * include snippet to disable dropdown based on breakpoint * disable dropdown for desktop * Remove param from doc method signature Co-authored-by: Alexandru Emil Lupu --------- Co-authored-by: Fernando Blat Co-authored-by: Alexandru Emil Lupu --- .../app/packs/src/decidim/redesigned_a11y.js | 11 +++++++++- .../src/decidim/redesigned_form_filter.js | 21 +------------------ .../app/packs/src/decidim/redesigned_index.js | 4 ---- .../app/views/decidim/searches/index.js.erb | 6 ------ .../views/decidim/shared/_filters.html.erb | 2 +- .../shared/_layout_user_profile.html.erb | 2 +- 6 files changed, 13 insertions(+), 33 deletions(-) diff --git a/decidim-core/app/packs/src/decidim/redesigned_a11y.js b/decidim-core/app/packs/src/decidim/redesigned_a11y.js index c3e5879299b91..627a19e43dedd 100644 --- a/decidim-core/app/packs/src/decidim/redesigned_a11y.js +++ b/decidim-core/app/packs/src/decidim/redesigned_a11y.js @@ -8,7 +8,7 @@ const createAccordion = (component) => { accordionOptions.isMultiSelectable = component.dataset.multiselectable !== "false"; accordionOptions.isCollapsible = component.dataset.collapsible !== "false"; - // This snippet allows to change a data-attribute based on the current viewport + // This snippet allows to change the OPEN data-attribute based on the current viewport // Just include the breakpoint where the different value will be applied from. // Ex: // data-open="false" data-open-md="true" @@ -29,6 +29,15 @@ const createDropdown = (component) => { dropdownOptions.isOpen = component.dataset.open === "true"; dropdownOptions.autoClose = component.dataset.autoClose === "true"; + // This snippet allows to disable the dropdown based on the current viewport + // Just include the breakpoint where the different value will be applied from. + // Ex: + // data-disabled-md="true" + const isDisabled = Object.keys(screens).some((key) => (window.matchMedia(`(min-width: ${screens[key]})`).matches) && Boolean(component.dataset[`disabled-${key}`.replace(/-([a-z])/g, (str) => str[1].toUpperCase())])); + if (isDisabled) { + return + } + if (!component.id) { // when component has no id, we enforce to have it one component.id = `dropdown-${Math.random().toString(36).substring(7)}` diff --git a/decidim-core/app/packs/src/decidim/redesigned_form_filter.js b/decidim-core/app/packs/src/decidim/redesigned_form_filter.js index d1ce21c947f06..9de532f4f1a17 100644 --- a/decidim-core/app/packs/src/decidim/redesigned_form_filter.js +++ b/decidim-core/app/packs/src/decidim/redesigned_form_filter.js @@ -10,7 +10,6 @@ import delayed from "./delayed" import CheckBoxesTree from "./redesigned_check_boxes_tree" import { registerCallback, unregisterCallback, pushState, replaceState, state } from "./history" -import DataPicker from "./data_picker" export default class FormFilterComponent { constructor($form) { @@ -19,7 +18,6 @@ export default class FormFilterComponent { this.mounted = false; this.changeEvents = true; this.theCheckBoxesTree = new CheckBoxesTree(); - this.theDataPicker = window.theDataPicker || new DataPicker($(".data-picker")); this._updateInitialState(); this._onFormChange = delayed(this, this._onFormChange.bind(this)); @@ -190,9 +188,6 @@ export default class FormFilterComponent { element.checked = element.indeterminate = false; }); this.$form.find("input[type=radio]").attr("checked", false); - this.$form.find(".data-picker").each((_index, picker) => { - this.theDataPicker.clear(picker); - }); // This ensure the form is reset in a valid state where a fieldset of // radio buttons has the first selected. @@ -205,10 +200,9 @@ export default class FormFilterComponent { /** * Handles the logic when going back to a previous state in the filter form. * @private - * @param {Object} currentState - state stored along with location URL * @returns {Void} - Returns nothing. */ - _onPopState(currentState) { + _onPopState() { this.changeEvents = false; this._clearForm(); @@ -244,14 +238,6 @@ export default class FormFilterComponent { }); } - // Retrieves picker information for selected values (value, text and link) from the state object - $(".data-picker", this.$form).each((_index, picker) => { - let pickerState = currentState[picker.id]; - if (pickerState) { - this.theDataPicker.load(picker, pickerState); - } - }) - // Only one instance should submit the form on browser history navigation if (this.popStateSubmiter) { Rails.fire(this.$form[0], "submit"); @@ -300,11 +286,6 @@ export default class FormFilterComponent { path = `${formAction}&${params}`; } - // Stores picker information for selected values (value, text and link) in the currentState object - $(".data-picker", this.$form).each((_index, picker) => { - currentState[picker.id] = this.theDataPicker.save(picker); - }) - return [path, currentState]; } diff --git a/decidim-core/app/packs/src/decidim/redesigned_index.js b/decidim-core/app/packs/src/decidim/redesigned_index.js index e8e982a9c3780..39896d00932c6 100644 --- a/decidim-core/app/packs/src/decidim/redesigned_index.js +++ b/decidim-core/app/packs/src/decidim/redesigned_index.js @@ -69,7 +69,6 @@ import updateExternalDomainLinks from "./external_domain_warning" import scrollToLastChild from "./scroll_to_last_child" import InputCharacterCounter, { createCharacterCounter } from "./redesigned_input_character_counter" import FormValidator from "./form_validator" -import DataPicker from "./data_picker" import FormFilterComponent from "./redesigned_form_filter" import addInputEmoji, { EmojiButton } from "./input_emoji" import dialogMode from "./dialog_mode" @@ -94,7 +93,6 @@ window.Decidim = window.Decidim || { ExternalLink, InputCharacterCounter, FormValidator, - DataPicker, addInputEmoji, EmojiButton, Dialogs @@ -112,8 +110,6 @@ Rails.start() * @returns {void} */ const initializer = (element = document) => { - window.theDataPicker = new DataPicker($(".data-picker")); - let focusContainer = element; if (element === document) { focusContainer = document.querySelector("body"); diff --git a/decidim-core/app/views/decidim/searches/index.js.erb b/decidim-core/app/views/decidim/searches/index.js.erb index d7e1f3e61e9e5..00627bdc3778d 100644 --- a/decidim-core/app/views/decidim/searches/index.js.erb +++ b/decidim-core/app/views/decidim/searches/index.js.erb @@ -5,9 +5,3 @@ var $count = $('#search-count'); $results.html('<%= j(cell("decidim/search_results", @sections, params:).show).strip.html_safe %>'); $filters.html('<%= j(render partial: "filters").strip.html_safe %>'); $count.html('<%= j(render partial: "count").strip.html_safe %>'); - -if (window.Decidim.DataPicker) { - window.theDataPicker = new window.Decidim.DataPicker($(".data-picker")); -} - -$(document).foundation(); diff --git a/decidim-core/app/views/decidim/shared/_filters.html.erb b/decidim-core/app/views/decidim/shared/_filters.html.erb index 731706a13d85b..c7bde35f991f2 100644 --- a/decidim-core/app/views/decidim/shared/_filters.html.erb +++ b/decidim-core/app/views/decidim/shared/_filters.html.erb @@ -4,7 +4,7 @@ <% if filter_sections.present? || local_assigns.has_key?(:search_variable) %> <%= redesigned_filter_form_for filter, url_for, class: "new_filter self-stretch", data: { filters: "", component: "accordion" } do |form| %> - +
+
+
+
+ + diff --git a/decidim-admin/app/views/layouts/decidim/admin/_admin_timeout_modal.html.erb b/decidim-admin/app/views/layouts/decidim/admin/_admin_timeout_modal.html.erb new file mode 100644 index 0000000000000..250c60f503dcb --- /dev/null +++ b/decidim-admin/app/views/layouts/decidim/admin/_admin_timeout_modal.html.erb @@ -0,0 +1,24 @@ +<% if current_user && !current_user.remember_created_at %> + <% timeout_time_seconds = Decidim.config.expire_session_after.to_i %> + <% prevent_timeout_for = try(:prevent_timeout_seconds) || 0 %> +
+

<%= t("title", scope: "layouts.decidim.timeout_modal") %>

+

<%= t("body", scope: "layouts.decidim.timeout_modal", minutes: (timeout_time_seconds / 60) - 2) %>

+ +
+ <%= link_to t("sign_out", scope: "layouts.decidim.timeout_modal"), decidim.destroy_user_session_path, method: :delete, class: "button warning" %> + <%= link_to "", decidim.destroy_user_session_path(translation_suffix: :timed_out), method: :delete, id: "reveal-hidden-sign-out", class: "hide" %> + <%= button_to t("continue_session", scope: "layouts.decidim.timeout_modal"), + decidim.heartbeat_path, + id: "continueSession", + class: "button primary", + remote: true, + method: :post %> +
+
+<% end %> diff --git a/decidim-admin/app/views/layouts/decidim/admin/_application.html.erb b/decidim-admin/app/views/layouts/decidim/admin/_application.html.erb index 026ede429911b..bf8ea44e9ebcf 100644 --- a/decidim-admin/app/views/layouts/decidim/admin/_application.html.erb +++ b/decidim-admin/app/views/layouts/decidim/admin/_application.html.erb @@ -13,7 +13,7 @@ <%= render partial: "layouts/decidim/admin/header" %> - <%= render partial: "layouts/decidim/timeout_modal" %> + <%= render partial: "layouts/decidim/admin/admin_timeout_modal" %> <%= render partial: "layouts/decidim/admin/template_top" %>
<%= main_menu.render %> @@ -26,7 +26,7 @@
<%= render partial: "layouts/decidim/admin/template_bottom" %> - <%= render partial: "decidim/shared/confirm_modal" %> + <%= render partial: "decidim/admin/shared/admin_confirm_modal" %> <%= render partial: "layouts/decidim/admin/js_configuration" %> <%= render partial: "layouts/decidim/cors" if Decidim.cors_enabled %> diff --git a/decidim-admin/spec/system/admin_manages_static_page_content_blocks_spec.rb b/decidim-admin/spec/system/admin_manages_static_page_content_blocks_spec.rb index c046975cf9076..7082695e1fa2b 100644 --- a/decidim-admin/spec/system/admin_manages_static_page_content_blocks_spec.rb +++ b/decidim-admin/spec/system/admin_manages_static_page_content_blocks_spec.rb @@ -69,7 +69,7 @@ within ".edit_content_blocks" do within first("ul.js-list-actives li") do - find(".icon--x").click + find("a[data-method='delete']").click end end diff --git a/decidim-assemblies/app/controllers/decidim/assemblies/application_controller.rb b/decidim-assemblies/app/controllers/decidim/assemblies/application_controller.rb index 37eb8ef1c111b..8211dad87d763 100644 --- a/decidim-assemblies/app/controllers/decidim/assemblies/application_controller.rb +++ b/decidim-assemblies/app/controllers/decidim/assemblies/application_controller.rb @@ -8,9 +8,6 @@ class ApplicationController < Decidim::ApplicationController helper Decidim::Assemblies::AssembliesHelper include NeedsPermission - include RedesignLayout - redesign active: true - register_permissions(Decidim::Assemblies::ApplicationController, ::Decidim::Assemblies::Permissions, ::Decidim::Admin::Permissions, diff --git a/decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb b/decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb index 75af76c8a80b8..37db708bce37d 100644 --- a/decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb +++ b/decidim-assemblies/app/controllers/decidim/assemblies/assemblies_controller.rb @@ -7,7 +7,7 @@ class AssembliesController < Decidim::Assemblies::ApplicationController include ParticipatorySpaceContext include AssemblyBreadcrumb - redesign_participatory_space_layout only: :show + participatory_space_layout only: :show include FilterResource include Paginable diff --git a/decidim-assemblies/app/controllers/decidim/assemblies/assembly_members_controller.rb b/decidim-assemblies/app/controllers/decidim/assemblies/assembly_members_controller.rb index 8c8c728d50822..7b66cccc87c5e 100644 --- a/decidim-assemblies/app/controllers/decidim/assemblies/assembly_members_controller.rb +++ b/decidim-assemblies/app/controllers/decidim/assemblies/assembly_members_controller.rb @@ -6,7 +6,7 @@ class AssemblyMembersController < Decidim::Assemblies::ApplicationController include ParticipatorySpaceContext include AssemblyBreadcrumb - redesign_participatory_space_layout only: :index + participatory_space_layout only: :index helper_method :collection diff --git a/decidim-assemblies/app/views/layouts/decidim/assembly.html.erb b/decidim-assemblies/app/views/layouts/decidim/assembly.html.erb index 37783db6b23ae..0be9bf01187f3 100644 --- a/decidim-assemblies/app/views/layouts/decidim/assembly.html.erb +++ b/decidim-assemblies/app/views/layouts/decidim/assembly.html.erb @@ -5,21 +5,13 @@ description: translated_attribute(current_participatory_space.short_description) ) %> +<%= append_javascript_pack_tag "decidim_assemblies" %> +<%= append_stylesheet_pack_tag "decidim_assemblies", media: "all" %> + <%= render "layouts/decidim/application" do %> - <%= render partial: "layouts/decidim/assembly_header" %> - <%= cell "decidim/translation_bar", current_organization %> -
+
<%= yield %> -
- <% if content_for? :expanded %> -
-
-
- <%= yield :expanded %> -
-
-
- <% end %> + <% end %> <% provide :meta_image_url, current_participatory_space.attached_uploader(:banner_image).path %> diff --git a/decidim-assemblies/app/views/layouts/decidim/redesigned_assembly.html.erb b/decidim-assemblies/app/views/layouts/decidim/redesigned_assembly.html.erb deleted file mode 100644 index 0425dc2772619..0000000000000 --- a/decidim-assemblies/app/views/layouts/decidim/redesigned_assembly.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<% add_decidim_page_title(translated_attribute(current_component.name)) if try(:current_component) %> -<% add_decidim_page_title(translated_attribute(current_participatory_space.title)) %> -<% add_decidim_meta_tags( - image_url: current_participatory_space.attached_uploader(:banner_image).path, - description: translated_attribute(current_participatory_space.short_description) -) %> - -<%= append_javascript_pack_tag "decidim_assemblies" %> -<%= append_stylesheet_pack_tag "decidim_assemblies", media: "all" %> - -<%= render "layouts/decidim/redesigned_application" do %> - <%= cell "decidim/translation_bar", current_organization %> - -
- <%= yield %> -
-<% end %> - -<% provide :meta_image_url, current_participatory_space.attached_uploader(:banner_image).path %> diff --git a/decidim-blogs/app/controllers/decidim/blogs/application_controller.rb b/decidim-blogs/app/controllers/decidim/blogs/application_controller.rb index cc4ea1f1b7fa1..b163c6b521d3f 100644 --- a/decidim-blogs/app/controllers/decidim/blogs/application_controller.rb +++ b/decidim-blogs/app/controllers/decidim/blogs/application_controller.rb @@ -9,8 +9,6 @@ module Blogs # override its layout and provide all kinds of useful methods. class ApplicationController < Decidim::Components::BaseController helper Decidim::Blogs::ApplicationHelper - - redesign_participatory_space_layout end end end diff --git a/decidim-blogs/app/controllers/decidim/blogs/posts_controller.rb b/decidim-blogs/app/controllers/decidim/blogs/posts_controller.rb index 0620230918f15..4cbf96e7d485b 100644 --- a/decidim-blogs/app/controllers/decidim/blogs/posts_controller.rb +++ b/decidim-blogs/app/controllers/decidim/blogs/posts_controller.rb @@ -8,8 +8,6 @@ class PostsController < Decidim::Blogs::ApplicationController include Paginable include Decidim::IconHelper - redesign active: true - helper_method :posts, :post, :post_presenter, :paginate_posts, :posts_most_commented, :tabs, :panels def index; end diff --git a/decidim-budgets/app/controllers/decidim/budgets/application_controller.rb b/decidim-budgets/app/controllers/decidim/budgets/application_controller.rb index 49c138643682c..2b98bd9101101 100644 --- a/decidim-budgets/app/controllers/decidim/budgets/application_controller.rb +++ b/decidim-budgets/app/controllers/decidim/budgets/application_controller.rb @@ -8,7 +8,6 @@ module Budgets # Note that it inherits from `Decidim::Components::BaseController`, which # override its layout and provide all kinds of useful methods. class ApplicationController < Decidim::Components::BaseController - redesign_participatory_space_layout helper_method :current_workflow, :voting_finished?, :voting_open? def current_workflow diff --git a/decidim-budgets/app/views/decidim/budgets/projects/_redesigned_exit_modal.html.erb b/decidim-budgets/app/views/decidim/budgets/projects/_redesigned_exit_modal.html.erb deleted file mode 100644 index 1de26908cbf98..0000000000000 --- a/decidim-budgets/app/views/decidim/budgets/projects/_redesigned_exit_modal.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<% if current_user && current_component.current_settings.votes == "enabled" && !current_workflow.voted?(budget) %> - <%= decidim_modal id: "exit-notification" do %> -
- <%= icon "information-line" %> -

- <%= t("title", scope: "decidim.budgets.projects.exit_modal") %> -

-

- <%= t("message", scope: "decidim.budgets.projects.exit_modal") %> -

-
-
- - <%= link_to t("exit", scope: "decidim.budgets.projects.exit_modal"), budget_projects_path, id: "exit-notification-link", class: "button button__sm md:button__lg button__secondary" %> -
- <% end %> -<% end %> diff --git a/decidim-budgets/app/views/decidim/budgets/projects/show.html.erb b/decidim-budgets/app/views/decidim/budgets/projects/show.html.erb index 540ef520514e2..3493ee837813e 100644 --- a/decidim-budgets/app/views/decidim/budgets/projects/show.html.erb +++ b/decidim-budgets/app/views/decidim/budgets/projects/show.html.erb @@ -15,11 +15,7 @@ edit_link( <%= append_javascript_pack_tag "decidim_budgets" %> <%= append_stylesheet_pack_tag "decidim_budgets" %> -<% if redesign_enabled? %> - <%= render partial: "redesigned_exit_modal" %> -<% else %> - <%= render partial: "exit_modal" %> -<% end %> +<%= render partial: "exit_modal" %>
<%= render partial: "budget_summary", locals: { include_heading: true, project_item: true, responsive: true } %> diff --git a/decidim-budgets/spec/helpers/decidim/budgets/projects_helper_spec.rb b/decidim-budgets/spec/helpers/decidim/budgets/projects_helper_spec.rb index d189ddd0cd2e0..bf4700f32cc4c 100644 --- a/decidim-budgets/spec/helpers/decidim/budgets/projects_helper_spec.rb +++ b/decidim-budgets/spec/helpers/decidim/budgets/projects_helper_spec.rb @@ -19,14 +19,6 @@ module Budgets let(:longitude) { 2.1234 } let(:redesign_enabled) { false } - before do - # rubocop:disable RSpec/AnyInstance - allow_any_instance_of(ActionView::Base).to receive(:redesign_enabled?).and_return(redesign_enabled) - allow_any_instance_of(ActionView::Base).to receive(:redesigned_layout).and_return("decidim/budgets/project_metadata") - allow_any_instance_of(Decidim::Budgets::ProjectMetadataCell).to receive(:redesign_enabled?).and_return(redesign_enabled) - # rubocop:enable RSpec/AnyInstance - end - describe "#has_position?" do subject { helper.has_position?(project) } diff --git a/decidim-conferences/app/cells/decidim/conferences/registration_type/join_conference.erb b/decidim-conferences/app/cells/decidim/conferences/registration_type/join_conference.erb index 84b12476fbdba..ba9b41aff406d 100644 --- a/decidim-conferences/app/cells/decidim/conferences/registration_type/join_conference.erb +++ b/decidim-conferences/app/cells/decidim/conferences/registration_type/join_conference.erb @@ -15,7 +15,7 @@ type: "button", class: "#{button_classes} conference__registration-button", disabled: !conference.has_available_slots? || conference.has_registration_for?(current_user), - data: { modal_open_key => current_user.present? ? "conference-registration-confirm-#{model.id}" : "loginModal" } + data: { dialog_open: current_user.present? ? "conference-registration-confirm-#{model.id}" : "loginModal" } ) do %> <%= i18n_join_text %> <%= icon "ticket-line", class: "w-3.5 h-3.5 fill-current flex-none" %> diff --git a/decidim-conferences/app/cells/decidim/conferences/registration_type_cell.rb b/decidim-conferences/app/cells/decidim/conferences/registration_type_cell.rb index d393fff482d14..9e01327ae28ca 100644 --- a/decidim-conferences/app/cells/decidim/conferences/registration_type_cell.rb +++ b/decidim-conferences/app/cells/decidim/conferences/registration_type_cell.rb @@ -8,7 +8,6 @@ class RegistrationTypeCell < Decidim::ViewModel include Decidim::SanitizeHelper include Decidim::Conferences::Engine.routes.url_helpers include Decidim::LayoutHelper - include Decidim::RedesignHelper def show render diff --git a/decidim-conferences/app/controllers/decidim/conferences/application_controller.rb b/decidim-conferences/app/controllers/decidim/conferences/application_controller.rb index 2bc7e99d990c7..8c18308df75c8 100644 --- a/decidim-conferences/app/controllers/decidim/conferences/application_controller.rb +++ b/decidim-conferences/app/controllers/decidim/conferences/application_controller.rb @@ -9,8 +9,6 @@ class ApplicationController < Decidim::ApplicationController helper Decidim::Conferences::ConferenceHelper include NeedsPermission - include RedesignLayout - redesign active: true layout "layouts/decidim/conferences/application" diff --git a/decidim-conferences/app/controllers/decidim/conferences/conference_program_controller.rb b/decidim-conferences/app/controllers/decidim/conferences/conference_program_controller.rb index 57b2a8393e752..8b4ebc46914c5 100644 --- a/decidim-conferences/app/controllers/decidim/conferences/conference_program_controller.rb +++ b/decidim-conferences/app/controllers/decidim/conferences/conference_program_controller.rb @@ -6,7 +6,7 @@ class ConferenceProgramController < Decidim::Conferences::ApplicationController include ParticipatorySpaceContext helper Decidim::SanitizeHelper helper Decidim::Conferences::ConferenceProgramHelper - redesign_participatory_space_layout only: :show + participatory_space_layout only: :show helper_method :collection, :conference, :meeting_days, :meeting_component diff --git a/decidim-conferences/app/controllers/decidim/conferences/conference_speakers_controller.rb b/decidim-conferences/app/controllers/decidim/conferences/conference_speakers_controller.rb index 9efa852aaaeb8..aec51c1e365d4 100644 --- a/decidim-conferences/app/controllers/decidim/conferences/conference_speakers_controller.rb +++ b/decidim-conferences/app/controllers/decidim/conferences/conference_speakers_controller.rb @@ -5,7 +5,7 @@ module Conferences class ConferenceSpeakersController < Decidim::Conferences::ApplicationController include ParticipatorySpaceContext - redesign_participatory_space_layout only: :index + participatory_space_layout only: :index helper_method :collection, :conference diff --git a/decidim-conferences/app/controllers/decidim/conferences/conferences_controller.rb b/decidim-conferences/app/controllers/decidim/conferences/conferences_controller.rb index de32d2ac13032..8b2d0111327aa 100644 --- a/decidim-conferences/app/controllers/decidim/conferences/conferences_controller.rb +++ b/decidim-conferences/app/controllers/decidim/conferences/conferences_controller.rb @@ -8,7 +8,7 @@ class ConferencesController < Decidim::Conferences::ApplicationController include ParticipatorySpaceContext include Paginable - redesign_participatory_space_layout only: :show + participatory_space_layout only: :show helper Decidim::AttachmentsHelper helper Decidim::IconHelper diff --git a/decidim-conferences/app/controllers/decidim/conferences/media_controller.rb b/decidim-conferences/app/controllers/decidim/conferences/media_controller.rb index f65ad054b343b..349708e5850f5 100644 --- a/decidim-conferences/app/controllers/decidim/conferences/media_controller.rb +++ b/decidim-conferences/app/controllers/decidim/conferences/media_controller.rb @@ -7,7 +7,7 @@ class MediaController < Decidim::Conferences::ApplicationController helper Decidim::Conferences::MediaAttachmentsHelper helper Decidim::SanitizeHelper - redesign_participatory_space_layout only: :index + participatory_space_layout only: :index helper_method :collection, :conference diff --git a/decidim-conferences/app/controllers/decidim/conferences/registration_types_controller.rb b/decidim-conferences/app/controllers/decidim/conferences/registration_types_controller.rb index 86eded1e311df..529472dac36b9 100644 --- a/decidim-conferences/app/controllers/decidim/conferences/registration_types_controller.rb +++ b/decidim-conferences/app/controllers/decidim/conferences/registration_types_controller.rb @@ -5,7 +5,7 @@ module Conferences class RegistrationTypesController < Decidim::Conferences::ApplicationController include ParticipatorySpaceContext - redesign_participatory_space_layout only: :index + participatory_space_layout only: :index helper_method :collection, :conference diff --git a/decidim-conferences/app/views/layouts/decidim/conference.html.erb b/decidim-conferences/app/views/layouts/decidim/conference.html.erb index 4c4a68d2f22a0..d121bbe7c33c3 100644 --- a/decidim-conferences/app/views/layouts/decidim/conference.html.erb +++ b/decidim-conferences/app/views/layouts/decidim/conference.html.erb @@ -5,23 +5,11 @@ description: translated_attribute(current_participatory_space.short_description) ) %> -<%= render "layouts/decidim/application" do %> - <%= render partial: "decidim/conferences/conferences/conference_hero" %> - <%= render partial: "layouts/decidim/conferences_nav" %> - <%= cell "decidim/translation_bar", current_organization %> -
- <%= yield %> -
+<%= append_javascript_pack_tag "decidim_conferences" %> +<%= append_stylesheet_pack_tag "decidim_conferences" %> - <% if content_for? :expanded %> -
-
-
- <%= yield :expanded %> -
-
-
- <% end %> +<%= render "layouts/decidim/application" do %> + <%= yield %> <% end %> <% provide :meta_image_url, current_participatory_space.attached_uploader(:banner_image).path %> diff --git a/decidim-conferences/app/views/layouts/decidim/conferences/application.html.erb b/decidim-conferences/app/views/layouts/decidim/conferences/application.html.erb index 4b71e3fd76eb1..dbb7327703041 100644 --- a/decidim-conferences/app/views/layouts/decidim/conferences/application.html.erb +++ b/decidim-conferences/app/views/layouts/decidim/conferences/application.html.erb @@ -1,3 +1,6 @@ +<%= append_javascript_pack_tag "decidim_conferences" %> +<%= append_stylesheet_pack_tag "decidim_conferences" %> + <%= render "layouts/decidim/application" do %> <%= yield %> <% end %> diff --git a/decidim-conferences/app/views/layouts/decidim/conferences/redesigned_application.html.erb b/decidim-conferences/app/views/layouts/decidim/conferences/redesigned_application.html.erb deleted file mode 100644 index 4eeb9f52a5b4e..0000000000000 --- a/decidim-conferences/app/views/layouts/decidim/conferences/redesigned_application.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= append_javascript_pack_tag "decidim_conferences" %> -<%= append_stylesheet_pack_tag "decidim_conferences" %> - -<%= render "layouts/decidim/redesigned_application" do %> - <%= yield %> -<% end %> diff --git a/decidim-conferences/app/views/layouts/decidim/redesigned_conference.html.erb b/decidim-conferences/app/views/layouts/decidim/redesigned_conference.html.erb deleted file mode 100644 index 5683af5a8fb3c..0000000000000 --- a/decidim-conferences/app/views/layouts/decidim/redesigned_conference.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<% add_decidim_page_title(translated_attribute(current_component.name)) if try(:current_component) %> -<% add_decidim_page_title(translated_attribute(current_participatory_space.title)) %> -<% add_decidim_meta_tags( - image_url: current_participatory_space.attached_uploader(:banner_image).path, - description: translated_attribute(current_participatory_space.short_description) -) %> - -<%= append_javascript_pack_tag "decidim_conferences" %> -<%= append_stylesheet_pack_tag "decidim_conferences" %> - -<%= render "layouts/decidim/redesigned_application" do %> - <%= cell "decidim/translation_bar", current_organization %> - - <%= yield %> -<% end %> - -<% provide :meta_image_url, current_participatory_space.attached_uploader(:banner_image).path %> diff --git a/decidim-core/app/cells/decidim/upload_modal/show.erb b/decidim-core/app/cells/decidim/upload_modal/show.erb index f5a8125f92b27..6365885da10ca 100644 --- a/decidim-core/app/cells/decidim/upload_modal/show.erb +++ b/decidim-core/app/cells/decidim/upload_modal/show.erb @@ -1,3 +1,3 @@ <%= render :files unless modal_only? %> -<%= render redesign_enabled? ? :modal : :legacy_modal %> +<%= render(redesign_enabled? ? :modal : :legacy_modal) %> diff --git a/decidim-core/app/cells/decidim/upload_modal_cell.rb b/decidim-core/app/cells/decidim/upload_modal_cell.rb index 7e51b9b8c3044..5aa3c2647068f 100644 --- a/decidim-core/app/cells/decidim/upload_modal_cell.rb +++ b/decidim-core/app/cells/decidim/upload_modal_cell.rb @@ -6,7 +6,6 @@ class UploadModalCell < Decidim::ViewModel include LayoutHelper include Cell::ViewModel::Partial include ERB::Util - include Decidim::RedesignHelper include Decidim::SanitizeHelper alias form model @@ -19,6 +18,10 @@ def show private + def modal_open_key + redesign_enabled? ? "dialog-open" : "open" + end + # REDESIGN_PENDING: Remove once redesign is done. This cell is called from # a form builder method and from there the context of controller is not # available diff --git a/decidim-core/app/controllers/concerns/decidim/devise_controllers.rb b/decidim-core/app/controllers/concerns/decidim/devise_controllers.rb index befbb896abf3d..390a6263c5daf 100644 --- a/decidim-core/app/controllers/concerns/decidim/devise_controllers.rb +++ b/decidim-core/app/controllers/concerns/decidim/devise_controllers.rb @@ -21,9 +21,6 @@ module DeviseControllers include NeedsSnippets include UserBlockedChecker - include RedesignLayout - redesign active: true - helper Decidim::TranslationsHelper helper Decidim::MetaTagsHelper helper Decidim::DecidimFormHelper diff --git a/decidim-core/app/controllers/concerns/decidim/user_profile.rb b/decidim-core/app/controllers/concerns/decidim/user_profile.rb index 462dd997f371d..5191a0e02762b 100644 --- a/decidim-core/app/controllers/concerns/decidim/user_profile.rb +++ b/decidim-core/app/controllers/concerns/decidim/user_profile.rb @@ -15,7 +15,6 @@ module UserProfile included do helper Decidim::UserProfileHelper - redesign active: true layout "layouts/decidim/user_profile" helper_method :available_verification_workflows diff --git a/decidim-core/app/controllers/decidim/application_controller.rb b/decidim-core/app/controllers/decidim/application_controller.rb index 2a8260f59a9f5..8bc585675f693 100644 --- a/decidim-core/app/controllers/decidim/application_controller.rb +++ b/decidim-core/app/controllers/decidim/application_controller.rb @@ -24,9 +24,6 @@ class ApplicationController < ::DecidimController include NeedsPasswordChange include LinkedResourceReference - include RedesignLayout - redesign active: true - helper Decidim::MetaTagsHelper helper Decidim::DecidimFormHelper helper Decidim::LanguageChooserHelper diff --git a/decidim-core/app/controllers/decidim/components/base_controller.rb b/decidim-core/app/controllers/decidim/components/base_controller.rb index 319842bca7ad5..a6bc4f6ba0921 100644 --- a/decidim-core/app/controllers/decidim/components/base_controller.rb +++ b/decidim-core/app/controllers/decidim/components/base_controller.rb @@ -10,7 +10,7 @@ class BaseController < Decidim::ApplicationController include Decidim::NeedsPermission include ParticipatorySpaceContext - participatory_space_layout + before_action :authorize_participatory_space helper Decidim::FiltersHelper helper Decidim::OrdersHelper diff --git a/decidim-core/app/controllers/decidim/messaging/conversations_controller.rb b/decidim-core/app/controllers/decidim/messaging/conversations_controller.rb index 9b8d6fdd87978..102923fb7a712 100644 --- a/decidim-core/app/controllers/decidim/messaging/conversations_controller.rb +++ b/decidim-core/app/controllers/decidim/messaging/conversations_controller.rb @@ -10,16 +10,12 @@ class ConversationsController < Decidim::ApplicationController helper ConversationHelper - layout "layouts/decidim/application", force_redesign: true + layout "layouts/decidim/application" before_action :authenticate_user! helper_method :conversation, :user_grouped_messages, :sender_is_user?, :user_groups, :validation_messages - def redesign_enabled? - true - end - # Shows the form to initiate a conversation with an user (the recipient) # recipient is passed via GET parameter: # - if the recipient does not exists, goes back to the users profile page diff --git a/decidim-core/app/controllers/decidim/profiles_controller.rb b/decidim-core/app/controllers/decidim/profiles_controller.rb index 6f77b31dc5b00..6f58a3b422be1 100644 --- a/decidim-core/app/controllers/decidim/profiles_controller.rb +++ b/decidim-core/app/controllers/decidim/profiles_controller.rb @@ -16,8 +16,6 @@ class ProfilesController < Decidim::ApplicationController before_action :ensure_profile_holder_is_a_user, only: [:groups, :following] before_action :ensure_user_not_blocked - redesign active: true - def show return redirect_to profile_members_path if profile_holder.is_a?(Decidim::UserGroup) diff --git a/decidim-core/app/controllers/decidim/user_activities_controller.rb b/decidim-core/app/controllers/decidim/user_activities_controller.rb index 1251eb3c98799..d00f49f37bdb5 100644 --- a/decidim-core/app/controllers/decidim/user_activities_controller.rb +++ b/decidim-core/app/controllers/decidim/user_activities_controller.rb @@ -12,8 +12,6 @@ class UserActivitiesController < Decidim::ApplicationController helper Decidim::ResourceHelper helper_method :activities, :resource_types, :user - redesign active: true - def index raise ActionController::RoutingError, "Missing user: #{params[:nickname]}" unless user raise ActionController::RoutingError, "Blocked User" if user.blocked? && !current_user&.admin? diff --git a/decidim-core/app/helpers/decidim/action_authorization_helper.rb b/decidim-core/app/helpers/decidim/action_authorization_helper.rb index a349846dbc6cb..47c996cd505d3 100644 --- a/decidim-core/app/helpers/decidim/action_authorization_helper.rb +++ b/decidim-core/app/helpers/decidim/action_authorization_helper.rb @@ -11,7 +11,7 @@ module ActionAuthorizationHelper # # Returns a String with the link. def action_authorized_link_to(action, *arguments, &block) - redesign_enabled? ? redesign_authorized_to(:link, action, arguments, block) : authorized_to(:link, action, arguments, block) + !respond_to?(:redesign_enabled?) || redesign_enabled? ? redesign_authorized_to(:link, action, arguments, block) : authorized_to(:link, action, arguments, block) end # Public: Emulates a `button_to` but conditionally renders a popup modal @@ -23,7 +23,7 @@ def action_authorized_link_to(action, *arguments, &block) # # Returns a String with the button. def action_authorized_button_to(action, *arguments, &block) - redesign_enabled? ? redesign_authorized_to(:button, action, arguments, block) : authorized_to(:button, action, arguments, block) + !respond_to?(:redesign_enabled?) || redesign_enabled? ? redesign_authorized_to(:button, action, arguments, block) : authorized_to(:button, action, arguments, block) end # Public: Emulates a `link_to` but conditionally renders a popup modal @@ -69,13 +69,13 @@ def authorized_to(tag, action, arguments, block) if !current_user html_options = clean_authorized_to_data_open(html_options) - html_options["data-open"] = "loginModal" + html_options["data-dialog-open"] = "loginModal" url = "#" elsif action && !action_authorized_to(action, resource:, permissions_holder:).ok? html_options = clean_authorized_to_data_open(html_options) - html_options["data-open"] = "authorizationModal" - html_options["data-open-url"] = modal_path(action, resource) + html_options["data-dialog-open"] = "authorizationModal" + html_options["data-dialog-remote-url"] = modal_path(action, resource) url = "#" end @@ -140,8 +140,8 @@ def modal_path(action, resource) end def clean_authorized_to_data_open(html_options) - html_options.delete(:"data-open") - html_options.delete(:"data-open-url") + html_options.delete(:"data-dialog-open") + html_options.delete(:"data-dialog-remote-url") [:data, "data"].each do |key| next unless html_options[key].is_a?(Hash) diff --git a/decidim-core/app/helpers/decidim/application_helper.rb b/decidim-core/app/helpers/decidim/application_helper.rb index 0f4e438e8bcac..516dece0358c7 100644 --- a/decidim-core/app/helpers/decidim/application_helper.rb +++ b/decidim-core/app/helpers/decidim/application_helper.rb @@ -8,7 +8,6 @@ module ApplicationHelper include Decidim::ContextualHelpHelper include Decidim::AmendmentsHelper include Decidim::CacheHelper - include Decidim::RedesignHelper # Truncates a given text respecting its HTML tags. # diff --git a/decidim-core/app/helpers/decidim/contextual_help_helper.rb b/decidim-core/app/helpers/decidim/contextual_help_helper.rb index cd4b5d9e94f2a..8d058608c8772 100644 --- a/decidim-core/app/helpers/decidim/contextual_help_helper.rb +++ b/decidim-core/app/helpers/decidim/contextual_help_helper.rb @@ -6,9 +6,5 @@ module ContextualHelpHelper def floating_help(id, &) render partial: "decidim/shared/floating_help", locals: { content: capture(&), id: } end - - def redesigned_floating_help(id, &) - render partial: "decidim/shared/redesigned_floating_help", locals: { content: capture(&), id: } - end end end diff --git a/decidim-core/app/helpers/decidim/endorsable_helper.rb b/decidim-core/app/helpers/decidim/endorsable_helper.rb index b08053a7df43b..a4e0044fef0bb 100644 --- a/decidim-core/app/helpers/decidim/endorsable_helper.rb +++ b/decidim-core/app/helpers/decidim/endorsable_helper.rb @@ -5,11 +5,7 @@ module Decidim module EndorsableHelper # Invokes the decidim/endorsement_buttons cell. def endorsement_buttons_cell(resource) - if redesign_enabled? - cell("decidim/endorsement_block", resource) - else - cell("decidim/endorsement_buttons", resource) - end + cell("decidim/endorsement_block", resource) end # Invokes the decidim/endorsers_list cell. diff --git a/decidim-core/app/helpers/decidim/layout_helper.rb b/decidim-core/app/helpers/decidim/layout_helper.rb index ee69a63ce0ee1..e48ca225aba80 100644 --- a/decidim-core/app/helpers/decidim/layout_helper.rb +++ b/decidim-core/app/helpers/decidim/layout_helper.rb @@ -100,7 +100,7 @@ def legacy_icon(name, options = {}) end def icon(*args) - redesign_enabled? ? redesigned_icon(*args) : legacy_icon(*args) + !respond_to?(:redesign_enabled?) || redesign_enabled? ? redesigned_icon(*args) : legacy_icon(*args) end # Outputs a SVG icon from an external file. It apparently renders an image diff --git a/decidim-core/app/helpers/decidim/participatory_space_helpers.rb b/decidim-core/app/helpers/decidim/participatory_space_helpers.rb index e7ef238b52f4f..15bb55539e2b3 100644 --- a/decidim-core/app/helpers/decidim/participatory_space_helpers.rb +++ b/decidim-core/app/helpers/decidim/participatory_space_helpers.rb @@ -30,13 +30,7 @@ def participatory_space_helpers def participatory_space_floating_help return if help_section.blank? - if redesign_enabled? - redesigned_floating_help(help_id) { translated_attribute(help_section).html_safe } - else - content_tag "div", class: "row collapse" do - floating_help(help_id) { translated_attribute(help_section).html_safe } - end - end + floating_help(help_id) { translated_attribute(help_section).html_safe } end # deprecated diff --git a/decidim-core/app/helpers/decidim/redesign_helper.rb b/decidim-core/app/helpers/decidim/redesign_helper.rb deleted file mode 100644 index 823cc86444c2a..0000000000000 --- a/decidim-core/app/helpers/decidim/redesign_helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -module Decidim - # Module to add some redesign shared helper methods. - module RedesignHelper - # REDESIGN_PENDING: When redesign enabled for all the controllers this - # method will be unnecessary and the dialog-open key should be used - # directly instead of calling this - def modal_open_key - redesign_enabled? ? "dialog-open" : "open" - end - - def modal_remote_key - redesign_enabled? ? "dialog-remote-url" : "open-url" - end - - def data_modal_open_key - "data-#{modal_open_key}" - end - - def data_modal_remote_key - "data-#{modal_remote_key}" - end - end -end diff --git a/decidim-core/app/helpers/decidim/social_share_button_helper.rb b/decidim-core/app/helpers/decidim/social_share_button_helper.rb index ab4b171f24213..4ce0c47daac57 100644 --- a/decidim-core/app/helpers/decidim/social_share_button_helper.rb +++ b/decidim-core/app/helpers/decidim/social_share_button_helper.rb @@ -6,14 +6,8 @@ module SocialShareButtonHelper def social_share_button_tag(title, args) return unless enabled_services.length.positive? - if redesign_enabled? - content_tag :div, class: "share-modal__list", data: { social_share: "" } do - render_social_share_buttons(enabled_services, title, args) - end - else - content_tag :div, class: "social-share-button" do - render_social_share_buttons(enabled_services, title, args) - end + content_tag :div, class: "share-modal__list", data: { social_share: "" } do + render_social_share_buttons(enabled_services, title, args) end end diff --git a/decidim-core/app/views/decidim/authorization_modals/_content.html.erb b/decidim-core/app/views/decidim/authorization_modals/_content.html.erb deleted file mode 100644 index cecf59a453c26..0000000000000 --- a/decidim-core/app/views/decidim/authorization_modals/_content.html.erb +++ /dev/null @@ -1,49 +0,0 @@ - - -<% if current_user && !current_user.verifiable? %> -
-

<%= t ".unconfirmed.title" %>

-
-

<%= t ".unconfirmed.explanation_html", email: current_user.email %>

-

<%= t ".unconfirmed.confirmation_instructions" %>

-
-
- <%= link_to t(".unconfirmed.request_confirmation_instructions"), new_confirmation_path(Decidim::User), class: "button expanded" %> -
-
-<% else %> - <% base_code = authorizations.global_code || :missing %> -
-

<%= t ".#{base_code}.title" %>

-
- <% authorizations.statuses.each do |status| %> - <% next if status.ok? || authorizations.global_code && status.code != base_code %> -

<%= t ".#{status.code}.explanation", authorization: t("#{status.handler_name}.name", scope: "decidim.authorization_handlers") %>

- <% [status.data[:extra_explanation]].flatten.compact.each do |extra_explanation| %> -

<%= t extra_explanation[:key], **extra_explanation[:params] %>

- <% end %> - <% if status.data[:fields] %> - - <% end %> -
-
- <% if status.data[:action].present? %> - <%= link_to t(".#{status.code}.#{status.data[:action]}", authorization: t("#{status.handler_name}.name", scope: "decidim.authorization_handlers")), authorize_action_path(status.handler_name), class: "button expanded" %> - <% else %> - - <% end %> -
-
- <% if status.data[:cancel] %> -
- -
- <% end %> - <% end %> -<% end %> diff --git a/decidim-core/app/views/decidim/authorization_modals/_redesigned_content.html.erb b/decidim-core/app/views/decidim/authorization_modals/_redesigned_content.html.erb deleted file mode 100644 index 1b024e70c47fc..0000000000000 --- a/decidim-core/app/views/decidim/authorization_modals/_redesigned_content.html.erb +++ /dev/null @@ -1,49 +0,0 @@ -<% - base_code = authorizations.global_code || :missing - - title = current_user && !current_user.verifiable? ? t("unconfirmed.title", scope: "decidim.authorization_modals.content") : t("#{base_code}.title", scope: "decidim.authorization_modals.content") - - verifications = if current_user && !current_user.verifiable? - messages = [] - messages << t("unconfirmed.explanation_html", scope: "decidim.authorization_modals.content", email: current_user.email) if current_user && !current_user.verifiable? - messages << t("unconfirmed.confirmation_instructions", scope: "decidim.authorization_modals.content") if current_user && !current_user.verifiable? - - cta = { type: :a, text: t("unconfirmed.request_confirmation_instructions", scope: "decidim.authorization_modals.content"), url: new_confirmation_path(Decidim::User) } - - [[messages, cta, []]] - else - authorizations.statuses.map do |status| - next if status.ok? || authorizations.global_code && status.code != base_code - - [status_messages(status), status_cta(status), status_fields(status)] - end - end.compact_blank -%> -
- <%= icon "lock-line" %> -

<%= title %>

-
-
- <% verifications.each do |(messages, cta, fields)| %> -
- <% messages.each do |msg| %> -

<%= msg %>

- <% end %> - - <% if fields.any? %> -
    - <% fields.each do |field| %> -
  • <%= value %>
  • - <% end %> -
- <% end %> - - <%= content_tag cta[:type], class: "button button__lg button__secondary", href: cta[:url], data: cta[:data] do %> - <%= cta[:text] %> - <%= icon "arrow-right-line" %> - <% end %> -
- <% end %> -
-
-
diff --git a/decidim-core/app/views/decidim/authorization_modals/show.html.erb b/decidim-core/app/views/decidim/authorization_modals/show.html.erb index 1b56065534d84..3696d1300bbba 100644 --- a/decidim-core/app/views/decidim/authorization_modals/show.html.erb +++ b/decidim-core/app/views/decidim/authorization_modals/show.html.erb @@ -1,5 +1 @@ -<% if redesign_enabled? %> - <%= cell "decidim/authorization_modal", authorizations %> -<% else %> - <%= render partial: "decidim/authorization_modals/content" %> -<% end %> +<%= cell "decidim/authorization_modal", authorizations %> diff --git a/decidim-core/app/views/decidim/devise/confirmations/new.html.erb b/decidim-core/app/views/decidim/devise/confirmations/new.html.erb index e6f109cb4d6fc..cc962de9b2bae 100644 --- a/decidim-core/app/views/decidim/devise/confirmations/new.html.erb +++ b/decidim-core/app/views/decidim/devise/confirmations/new.html.erb @@ -20,7 +20,7 @@
<% end %> diff --git a/decidim-core/app/views/decidim/devise/passwords/edit.html.erb b/decidim-core/app/views/decidim/devise/passwords/edit.html.erb index 85e7f9d9665f0..ee1e25a0b5b55 100644 --- a/decidim-core/app/views/decidim/devise/passwords/edit.html.erb +++ b/decidim-core/app/views/decidim/devise/passwords/edit.html.erb @@ -24,7 +24,7 @@ <% unless current_user %> <% end %> <% end %> diff --git a/decidim-core/app/views/decidim/devise/passwords/new.html.erb b/decidim-core/app/views/decidim/devise/passwords/new.html.erb index 64d5371dd3e7b..ddd5d8dad12e5 100644 --- a/decidim-core/app/views/decidim/devise/passwords/new.html.erb +++ b/decidim-core/app/views/decidim/devise/passwords/new.html.erb @@ -20,7 +20,7 @@ <% end %> diff --git a/decidim-core/app/views/decidim/devise/registrations/new.html.erb b/decidim-core/app/views/decidim/devise/registrations/new.html.erb index ab9bc399badf4..94e3e171b333e 100644 --- a/decidim-core/app/views/decidim/devise/registrations/new.html.erb +++ b/decidim-core/app/views/decidim/devise/registrations/new.html.erb @@ -69,7 +69,7 @@ <% end %> <% end %> diff --git a/decidim-core/app/views/decidim/devise/sessions/new.html.erb b/decidim-core/app/views/decidim/devise/sessions/new.html.erb index 5b1b6f748dad6..e3d7aad410061 100644 --- a/decidim-core/app/views/decidim/devise/sessions/new.html.erb +++ b/decidim-core/app/views/decidim/devise/sessions/new.html.erb @@ -49,7 +49,7 @@ <% end %> diff --git a/decidim-core/app/views/decidim/devise/shared/_links.html.erb b/decidim-core/app/views/decidim/devise/shared/_links.html.erb index e8418f50164c5..00f82f06f2671 100644 --- a/decidim-core/app/views/decidim/devise/shared/_links.html.erb +++ b/decidim-core/app/views/decidim/devise/shared/_links.html.erb @@ -1,29 +1,19 @@ <%- if controller_name != "sessions" && resource_class != Decidim::UserGroup %> -

- <%= link_to t("devise.shared.links.sign_in"), new_session_path(resource_name) %> -

+ <%= link_to t("devise.shared.links.sign_in"), new_session_path(resource_name) %> <% end -%> <%- if current_organization.sign_up_enabled? && devise_mapping.registerable? && controller_name != "registrations" %> -

- <%= link_to t("devise.shared.links.sign_up"), new_registration_path(resource_name) %> -

+ <%= link_to t("devise.shared.links.sign_up"), new_registration_path(resource_name) %> <% end -%> <%- if devise_mapping.recoverable? && controller_name != "passwords" %> -

- <%= link_to t("devise.shared.links.forgot_your_password"), new_password_path(resource_name) %> -

+ <%= link_to t("devise.shared.links.forgot_your_password"), new_password_path(resource_name) %> <% end -%> <%- if current_organization.sign_up_enabled? && devise_mapping.confirmable? && controller_name != "confirmations" %> -

- <%= link_to t("devise.shared.links.didn_t_receive_confirmation_instructions"), new_confirmation_path(resource_name) %> -

+ <%= link_to t("devise.shared.links.didn_t_receive_confirmation_instructions"), new_confirmation_path(resource_name) %> <% end -%> <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != "unlocks" %> -

- <%= link_to t("devise.shared.links.didn_t_receive_unlock_instructions"), new_unlock_path(resource_name) %> -

+ <%= link_to t("devise.shared.links.didn_t_receive_unlock_instructions"), new_unlock_path(resource_name) %> <% end -%> diff --git a/decidim-core/app/views/decidim/devise/shared/_omniauth_buttons.html.erb b/decidim-core/app/views/decidim/devise/shared/_omniauth_buttons.html.erb index c3bdb1ee708dd..2e7e0f8ab44b8 100644 --- a/decidim-core/app/views/decidim/devise/shared/_omniauth_buttons.html.erb +++ b/decidim-core/app/views/decidim/devise/shared/_omniauth_buttons.html.erb @@ -2,8 +2,7 @@ <% if Devise.mappings[:user].omniauthable? && current_organization.enabled_omniauth_providers.any? %>
"> <%- current_organization.enabled_omniauth_providers.keys.each do |provider| %> - <%# REDESIGN_PENDING: The current classes breaks the accessibility of the page with legacy design. Please, review it it works with the redesigned layout %> - <% link_classes = Decidim.redesign_active ? "login__omniauth-button button--#{normalize_provider_name(provider)}" : "" %> + <% link_classes = "login__omniauth-button button--#{normalize_provider_name(provider)}" %> <%= link_to decidim.send("user_#{provider}_omniauth_authorize_path"), class: link_classes, method: :post, title: t("devise.shared.links.sign_in_with_provider", provider: normalize_provider_name(provider).titleize) do %> <%= oauth_icon provider %> diff --git a/decidim-core/app/views/decidim/devise/shared/_redesigned_links.html.erb b/decidim-core/app/views/decidim/devise/shared/_redesigned_links.html.erb deleted file mode 100644 index 00f82f06f2671..0000000000000 --- a/decidim-core/app/views/decidim/devise/shared/_redesigned_links.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%- if controller_name != "sessions" && resource_class != Decidim::UserGroup %> - <%= link_to t("devise.shared.links.sign_in"), new_session_path(resource_name) %> -<% end -%> - -<%- if current_organization.sign_up_enabled? && devise_mapping.registerable? && controller_name != "registrations" %> - <%= link_to t("devise.shared.links.sign_up"), new_registration_path(resource_name) %> -<% end -%> - -<%- if devise_mapping.recoverable? && controller_name != "passwords" %> - <%= link_to t("devise.shared.links.forgot_your_password"), new_password_path(resource_name) %> -<% end -%> - -<%- if current_organization.sign_up_enabled? && devise_mapping.confirmable? && controller_name != "confirmations" %> - <%= link_to t("devise.shared.links.didn_t_receive_confirmation_instructions"), new_confirmation_path(resource_name) %> -<% end -%> - -<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != "unlocks" %> - <%= link_to t("devise.shared.links.didn_t_receive_unlock_instructions"), new_unlock_path(resource_name) %> -<% end -%> diff --git a/decidim-core/app/views/decidim/devise/unlocks/new.html.erb b/decidim-core/app/views/decidim/devise/unlocks/new.html.erb index 8ccaee79a02ae..7d1faccfa8638 100644 --- a/decidim-core/app/views/decidim/devise/unlocks/new.html.erb +++ b/decidim-core/app/views/decidim/devise/unlocks/new.html.erb @@ -20,7 +20,7 @@
<% end %> diff --git a/decidim-core/app/views/decidim/endorsements/update_buttons_and_counters.js.erb b/decidim-core/app/views/decidim/endorsements/update_buttons_and_counters.js.erb index 8e6650a5a358d..b67952dfbb2ad 100644 --- a/decidim-core/app/views/decidim/endorsements/update_buttons_and_counters.js.erb +++ b/decidim-core/app/views/decidim/endorsements/update_buttons_and_counters.js.erb @@ -1,53 +1,27 @@ -<% render_endorsement_cell_method = redesign_enabled? ? :show : :render_user_identity_endorse_button %> +updateEndorsementBlock(); -<% if redesign_enabled? %> - updateEndorsementBlock(); +function updateEndorsementBlock() { + var $endorsementBlock = $('#resource-<%= resource.id %>-endorsement-block'); + var $endorsementListTrigger = $('#resource-<%= resource.id %>-endorsement-block #dropdown-trigger'); + var $endorsementButton = $('#resource-<%= resource.id %>-endorsement-button'); + var $endorsementIdentitiesButton = $('#resource-<%= resource.id %>-endorsement-button #select-identity-button'); + var $endorsementListGrid = $('#dropdown-menu-endorsers-list .endorsers-list__grid'); + var endorsersCount = <%= j(cell("decidim/endorsers_list", resource).endorsers_count) %> - function updateEndorsementBlock() { - var $endorsementBlock = $('#resource-<%= resource.id %>-endorsement-block'); - var $endorsementListTrigger = $('#resource-<%= resource.id %>-endorsement-block #dropdown-trigger'); - var $endorsementButton = $('#resource-<%= resource.id %>-endorsement-button'); - var $endorsementIdentitiesButton = $('#resource-<%= resource.id %>-endorsement-button #select-identity-button'); - var $endorsementListGrid = $('#dropdown-menu-endorsers-list .endorsers-list__grid'); - var endorsersCount = <%= j(cell("decidim/endorsers_list", resource).endorsers_count) %> - - $endorsementListTrigger[0].innerHTML = '<%= j(cell("decidim/endorsers_list", resource)).strip.html_safe %>'; - $endorsementListGrid[0].innerHTML = '<%= j(cell("decidim/endorsers_list", resource).full_endorsers_list).strip.html_safe %>'; - if (endorsersCount > 0) { - $endorsementListTrigger.removeClass('hidden'); - } else { - $endorsementListTrigger.addClass('hidden'); - } - - <%# If the endorsement button displays a modal to select the identity to endorse only the content of the button %> - <%# has to be updated to maintain the function of the button to open the modal. Otherwise the button has to be fully %> - <%# updated because the form request also changes %> - if ($endorsementIdentitiesButton.length == 0) { - $endorsementButton[0].outerHTML = '<%= j(cell("decidim/endorsement_buttons", resource).show).strip.html_safe %>'; - } else { - $endorsementIdentitiesButton[0].innerHTML = '<%= j(cell("decidim/endorsement_buttons", resource).button_content).strip.html_safe %>'; - } - } -<% else %> - <% if Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.empty? %> - update_main_page_button(); - <% end %> - update_identities_rows(); - - function update_identities_rows() { - <% fully_endorsed = fully_endorsed?(resource, current_user) %> - var $endorsementsRowCount = $('#resource-<%= resource.id %>-endorsements-count'); - morphdom($endorsementsRowCount[0], '<%= j(endorsement_buttons_cell(resource).render_endorsements_count).strip.html_safe %>'); - var $endorsementsRowButton = $($('#select-identity-button')[0]); - <% if fully_endorsed %> - $endorsementsRowButton.addClass('active') - <% else %> - $endorsementsRowButton.removeClass('active') - <% end %> + $endorsementListTrigger[0].innerHTML = '<%= j(cell("decidim/endorsers_list", resource)).strip.html_safe %>'; + $endorsementListGrid[0].innerHTML = '<%= j(cell("decidim/endorsers_list", resource).full_endorsers_list).strip.html_safe %>'; + if (endorsersCount > 0) { + $endorsementListTrigger.removeClass('hidden'); + } else { + $endorsementListTrigger.addClass('hidden'); } - function update_main_page_button() { - var $endorsementButton = $('#resource-<%= resource.id %>-endorsement-button'); - morphdom($endorsementButton[0], '<%= j(endorsement_buttons_cell(resource).send(render_endorsement_cell_method)).strip.html_safe %>'); + <%# If the endorsement button displays a modal to select the identity to endorse only the content of the button %> + <%# has to be updated to maintain the function of the button to open the modal. Otherwise the button has to be fully %> + <%# updated because the form request also changes %> + if ($endorsementIdentitiesButton.length == 0) { + $endorsementButton[0].outerHTML = '<%= j(cell("decidim/endorsement_buttons", resource).show).strip.html_safe %>'; + } else { + $endorsementIdentitiesButton[0].innerHTML = '<%= j(cell("decidim/endorsement_buttons", resource).button_content).strip.html_safe %>'; } -<% end %> +} diff --git a/decidim-core/app/views/decidim/shared/_authorization_modal.html.erb b/decidim-core/app/views/decidim/shared/_authorization_modal.html.erb index 37687e4d04960..604b9a314b453 100644 --- a/decidim-core/app/views/decidim/shared/_authorization_modal.html.erb +++ b/decidim-core/app/views/decidim/shared/_authorization_modal.html.erb @@ -1 +1 @@ -
+<%= decidim_modal id: "authorizationModal", remote: true, class: "authorization-modal" %> diff --git a/decidim-core/app/views/decidim/shared/_confirm_modal.html.erb b/decidim-core/app/views/decidim/shared/_confirm_modal.html.erb index 4a84bdd0a2c2b..b51913c268f7e 100644 --- a/decidim-core/app/views/decidim/shared/_confirm_modal.html.erb +++ b/decidim-core/app/views/decidim/shared/_confirm_modal.html.erb @@ -1,18 +1,17 @@ -