Skip to content

Commit

Permalink
Removal of unused show pages in admin components (decidim#11193)
Browse files Browse the repository at this point in the history
* Removal of unsued show pages in admin

* Test

* Fixed spacing issue in attachment_collections

* partici_processes and meetings expect :show added

* Added attributes to the categories routes

* Added attributes to rest of the modules

* Removal of show methods in categories and attachments

* Removal of engine.rb in consulations
  • Loading branch information
greenwoodt committed Jul 31, 2023
1 parent 504733d commit 3abf45a
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:)
Expand Down

This file was deleted.

24 changes: 0 additions & 24 deletions decidim-admin/app/views/decidim/admin/attachments/show.html.erb

This file was deleted.

12 changes: 0 additions & 12 deletions decidim-admin/app/views/decidim/admin/categories/show.html.erb

This file was deleted.

6 changes: 3 additions & 3 deletions decidim-assemblies/lib/decidim/assemblies/admin_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions decidim-blogs/lib/decidim/blogs/admin_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions decidim-budgets/lib/decidim/budgets/admin_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions decidim-conferences/lib/decidim/conferences/admin_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions decidim-elections/lib/decidim/votings/admin_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions decidim-meetings/lib/decidim/meetings/admin_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
Expand Down

0 comments on commit 3abf45a

Please sign in to comment.