diff --git a/decidim-accountability/lib/decidim/accountability/admin_engine.rb b/decidim-accountability/lib/decidim/accountability/admin_engine.rb index 8b6846c7b244..c1697650316d 100644 --- a/decidim-accountability/lib/decidim/accountability/admin_engine.rb +++ b/decidim-accountability/lib/decidim/accountability/admin_engine.rb @@ -16,8 +16,8 @@ class AdminEngine < ::Rails::Engine resources :results, except: [:show] do get :proposals_picker, on: :collection - resources :attachment_collections - resources :attachments + resources :attachment_collections, except: [:show] + resources :attachments, except: [:show] resources :timeline_entries, except: [:show] end resources :projects_import, only: [:new, :create] diff --git a/decidim-admin/app/controllers/decidim/admin/categories_controller.rb b/decidim-admin/app/controllers/decidim/admin/categories_controller.rb index ba68353a43cf..1c7324efcf2d 100644 --- a/decidim-admin/app/controllers/decidim/admin/categories_controller.rb +++ b/decidim-admin/app/controllers/decidim/admin/categories_controller.rb @@ -58,11 +58,6 @@ def update end end - def show - @category = collection.find(params[:id]) - enforce_permission_to :read, :category, category: @category - end - def destroy @category = collection.find(params[:id]) enforce_permission_to :destroy, :category, category: @category diff --git a/decidim-admin/app/controllers/decidim/admin/concerns/has_attachment_collections.rb b/decidim-admin/app/controllers/decidim/admin/concerns/has_attachment_collections.rb index e74a7571bc5f..4963f36b30a7 100644 --- a/decidim-admin/app/controllers/decidim/admin/concerns/has_attachment_collections.rb +++ b/decidim-admin/app/controllers/decidim/admin/concerns/has_attachment_collections.rb @@ -69,12 +69,6 @@ def update end end - def show - @attachment_collection = collection.find(params[:id]) - enforce_permission_to :read, :attachment_collection, attachment_collection: @attachment_collection - render template: "decidim/admin/attachment_collections/show" - end - def destroy @attachment_collection = collection.find(params[:id]) enforce_permission_to :destroy, :attachment_collection, attachment_collection: @attachment_collection diff --git a/decidim-admin/app/controllers/decidim/admin/concerns/has_attachments.rb b/decidim-admin/app/controllers/decidim/admin/concerns/has_attachments.rb index 01bf879b0ba1..29dc1a466040 100644 --- a/decidim-admin/app/controllers/decidim/admin/concerns/has_attachments.rb +++ b/decidim-admin/app/controllers/decidim/admin/concerns/has_attachments.rb @@ -69,12 +69,6 @@ def update end end - def show - @attachment = collection.find(params[:id]) - enforce_permission_to(:read, :attachment, attachment:) - render template: "decidim/admin/attachments/show" - end - def destroy @attachment = collection.find(params[:id]) enforce_permission_to(:destroy, :attachment, attachment:) diff --git a/decidim-admin/app/views/decidim/admin/attachment_collections/show.html.erb b/decidim-admin/app/views/decidim/admin/attachment_collections/show.html.erb deleted file mode 100644 index d234d081f731..000000000000 --- a/decidim-admin/app/views/decidim/admin/attachment_collections/show.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -

<%= translated_attribute(@attachment_collection.name) %>

- -
-
- <%= link_to t("decidim.admin.actions.edit"), ["edit", @attachment_collection.collection_for, @attachment_collection], class: "button" if allowed_to? :update, :attachment_collection, attachment_collection: @attachment_collection %> - <%= link_to t("decidim.admin.actions.destroy"), [@attachment_collection.collection_for, @attachment_collection], method: :delete, class: "alert button", data: { confirm: t("decidim.admin.actions.confirm_destroy") } if allowed_to? :destroy, :attachment_collection, attachment_collection: @attachment_collection %> -
- -
- <%= display_for @attachment_collection, - :name, - :description %> -
diff --git a/decidim-admin/app/views/decidim/admin/attachments/show.html.erb b/decidim-admin/app/views/decidim/admin/attachments/show.html.erb deleted file mode 100644 index 8af67fa8a9b1..000000000000 --- a/decidim-admin/app/views/decidim/admin/attachments/show.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -

<%= translated_attribute(@attachment.title) %>

- -
-
- <%= link_to t("decidim.admin.actions.edit"), ["edit", @attachment.attached_to, @attachment] if allowed_to? :update, :attachment, attachment: @attachment %> - <%= link_to t("decidim.admin.actions.destroy"), [@attachment.attached_to, @attachment], method: :delete, class: "alert button", data: { confirm: t("decidim.admin.actions.confirm_destroy") } if allowed_to? :destroy, :attachment, attachment: @attachment %> -
- -
- <%= display_for @attachment, - :title, - :description, - :file_type %> -
<%= display_label(@attachment, :file_size) %>
-
<%= number_to_human_size(@attachment.file_size) %>
-
<%= display_label(@attachment, :file) %>
- <% if @attachment.photo? %> - <%= link_to @attachment.big_url do %> - <%= image_tag @attachment.thumbnail_url, class: "thumbnail", alt: strip_tags(translated_attribute(@attachment.description)) %> - <% end %> - <% else %> - <%= link_to translated_attribute(@attachment.title), @attachment.url %> - <% end %> -
diff --git a/decidim-admin/app/views/decidim/admin/categories/show.html.erb b/decidim-admin/app/views/decidim/admin/categories/show.html.erb deleted file mode 100644 index a1d97207dd96..000000000000 --- a/decidim-admin/app/views/decidim/admin/categories/show.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -

<%= translated_attribute(@category.name) %>

- -
-
- <%= link_to t("decidim.admin.actions.edit"), ["edit", participatory_space, @category] if allowed_to? :update, :category, category: @category %> - <%= link_to t("decidim.admin.actions.destroy"), [participatory_space, @category], method: :delete, class: "alert button", data: { confirm: t("decidim.admin.actions.confirm_destroy") } if allowed_to? :destroy, :category, category: @category %> -
- -
- <%= display_for @category, - :name %> -
diff --git a/decidim-assemblies/lib/decidim/assemblies/admin_engine.rb b/decidim-assemblies/lib/decidim/assemblies/admin_engine.rb index 15fd29677b43..fb67beb6eeff 100644 --- a/decidim-assemblies/lib/decidim/assemblies/admin_engine.rb +++ b/decidim-assemblies/lib/decidim/assemblies/admin_engine.rb @@ -29,8 +29,8 @@ class AdminEngine < ::Rails::Engine end end - resources :attachment_collections, controller: "assembly_attachment_collections" - resources :attachments, controller: "assembly_attachments" + resources :attachment_collections, controller: "assembly_attachment_collections", except: [:show] + resources :attachments, controller: "assembly_attachments", except: [:show] resource :export, controller: "assembly_exports", only: :create @@ -44,7 +44,7 @@ class AdminEngine < ::Rails::Engine end scope "/assemblies/:assembly_slug" do - resources :categories + resources :categories, except: [:show] resources :components do resource :permissions, controller: "component_permissions" diff --git a/decidim-blogs/lib/decidim/blogs/admin_engine.rb b/decidim-blogs/lib/decidim/blogs/admin_engine.rb index 5b8bc0602e35..3b8434ab75c4 100644 --- a/decidim-blogs/lib/decidim/blogs/admin_engine.rb +++ b/decidim-blogs/lib/decidim/blogs/admin_engine.rb @@ -12,8 +12,8 @@ class AdminEngine < ::Rails::Engine routes do resources :posts do - resources :attachment_collections - resources :attachments + resources :attachment_collections, except: [:show] + resources :attachments, except: [:show] end root to: "posts#index" end diff --git a/decidim-budgets/lib/decidim/budgets/admin_engine.rb b/decidim-budgets/lib/decidim/budgets/admin_engine.rb index a70f72259e42..41384d5c9487 100644 --- a/decidim-budgets/lib/decidim/budgets/admin_engine.rb +++ b/decidim-budgets/lib/decidim/budgets/admin_engine.rb @@ -26,8 +26,8 @@ class AdminEngine < ::Rails::Engine resources :projects, exclude: [:index, :new, :create, :edit, :update, :destroy] do get :proposals_picker, on: :collection - resources :attachment_collections - resources :attachments + resources :attachment_collections, except: [:show] + resources :attachments, except: [:show] end root to: "budgets#index" diff --git a/decidim-conferences/lib/decidim/conferences/admin_engine.rb b/decidim-conferences/lib/decidim/conferences/admin_engine.rb index 5c7014422ddf..a677382cade2 100644 --- a/decidim-conferences/lib/decidim/conferences/admin_engine.rb +++ b/decidim-conferences/lib/decidim/conferences/admin_engine.rb @@ -46,12 +46,12 @@ class AdminEngine < ::Rails::Engine end end - resources :attachment_collections, controller: "conference_attachment_collections" - resources :attachments, controller: "conference_attachments" + resources :attachment_collections, controller: "conference_attachment_collections", except: [:show] + resources :attachments, controller: "conference_attachments", except: [:show] end scope "/conferences/:conference_slug" do - resources :categories + resources :categories, except: [:show] resources :components do resource :permissions, controller: "component_permissions" diff --git a/decidim-elections/lib/decidim/votings/admin_engine.rb b/decidim-elections/lib/decidim/votings/admin_engine.rb index 00ee34757ebc..1b60bc91fe4e 100644 --- a/decidim-elections/lib/decidim/votings/admin_engine.rb +++ b/decidim-elections/lib/decidim/votings/admin_engine.rb @@ -30,8 +30,8 @@ class AdminEngine < ::Rails::Engine end resources :monitoring_committee_verify_elections, only: [:index] resources :monitoring_committee_election_results, only: [:index, :show, :update] - resources :attachments, controller: "voting_attachments" - resources :attachment_collections, controller: "voting_attachment_collections" + resources :attachments, controller: "voting_attachments", except: [:show] + resources :attachment_collections, controller: "voting_attachment_collections", except: [:show] resources :ballot_styles resource :census, only: [:show, :destroy, :create], controller: "/decidim/votings/census/admin/census" do diff --git a/decidim-initiatives/lib/decidim/initiatives/admin_engine.rb b/decidim-initiatives/lib/decidim/initiatives/admin_engine.rb index e2bca0481a84..567c87440064 100644 --- a/decidim-initiatives/lib/decidim/initiatives/admin_engine.rb +++ b/decidim-initiatives/lib/decidim/initiatives/admin_engine.rb @@ -37,7 +37,7 @@ class AdminEngine < ::Rails::Engine get :export end - resources :attachments, controller: "initiative_attachments" + resources :attachments, controller: "initiative_attachments", except: [:show] resources :committee_requests, only: [:index] do member do diff --git a/decidim-meetings/lib/decidim/meetings/admin_engine.rb b/decidim-meetings/lib/decidim/meetings/admin_engine.rb index f76a7ee833c4..bacdd588ac89 100644 --- a/decidim-meetings/lib/decidim/meetings/admin_engine.rb +++ b/decidim-meetings/lib/decidim/meetings/admin_engine.rb @@ -31,8 +31,8 @@ class AdminEngine < ::Rails::Engine end end resources :agenda, except: [:index, :destroy] - resources :attachment_collections - resources :attachments + resources :attachment_collections, except: [:show] + resources :attachments, except: [:show] resources :copies, controller: "meeting_copies", only: [:new, :create] resource :poll, only: [:edit, :update], controller: "meetings_poll" end diff --git a/decidim-participatory_processes/lib/decidim/participatory_processes/admin_engine.rb b/decidim-participatory_processes/lib/decidim/participatory_processes/admin_engine.rb index b84d6b8134af..f125d5a8c5d5 100644 --- a/decidim-participatory_processes/lib/decidim/participatory_processes/admin_engine.rb +++ b/decidim-participatory_processes/lib/decidim/participatory_processes/admin_engine.rb @@ -36,8 +36,8 @@ class AdminEngine < ::Rails::Engine post :resend_invitation, to: "participatory_process_user_roles#resend_invitation" end end - resources :attachment_collections, controller: "participatory_process_attachment_collections" - resources :attachments, controller: "participatory_process_attachments" + resources :attachment_collections, controller: "participatory_process_attachment_collections", except: [:show] + resources :attachments, controller: "participatory_process_attachments", except: [:show] resource :export, controller: "participatory_process_exports", only: :create @@ -50,7 +50,7 @@ class AdminEngine < ::Rails::Engine end scope "/participatory_processes/:participatory_process_slug" do - resources :categories + resources :categories, except: [:show] resources :components do resource :permissions, controller: "component_permissions"