Skip to content

Commit

Permalink
add publish and unpublish routes
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed Jun 13, 2024
1 parent 8263684 commit 3b13207
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def publish
Decidim::Conference::Admin::PublishConferenceSpeaker.call(conference_speaker, current_user) do
on(:ok) do
flash[:notice] = I18n.t("conference_speakers.publish.success", scope: "decidim.admin")
redirect_to conference_speakers_path
redirect_to conference_speakers_path(current_conference)
end

on(:invalid) do
Expand All @@ -96,7 +96,7 @@ def unpublish
Decidim::Conference::Admin::UnpublishConferenceSpeaker.call(conference_speaker, current_user) do
on(:ok) do
flash[:notice] = I18n.t("conference_speakers.unpublish.success", scope: "decidim.admin")
redirect_to conference_speakers_path
redirect_to conference_speakers_path(current_conference)
end

on(:invalid) do
Expand Down
7 changes: 6 additions & 1 deletion decidim-conferences/lib/decidim/conferences/admin_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ class AdminEngine < ::Rails::Engine
resources :conferences, param: :slug, except: [:show, :destroy] do
resource :publish, controller: "conference_publications", only: [:create, :destroy]
resources :copies, controller: "conference_copies", only: [:new, :create]
resources :speakers, controller: "conference_speakers"
resources :speakers, controller: "conference_speakers" do
member do
put :publish
put :unpublish
end
end
resources :partners, controller: "partners", except: [:show]
resources :media_links, controller: "media_links"
resources :registration_types, controller: "registration_types" do
Expand Down

0 comments on commit 3b13207

Please sign in to comment.