Add booths to admin sidebar

This commit is contained in:
nasia 2017-08-11 15:14:22 +03:00 committed by Stella Rouzi
parent 835859e350
commit 834e9d96e4
4 changed files with 15 additions and 1 deletions

View file

@ -90,6 +90,10 @@ module Admin
update_state(:cancel, 'Booth is canceled')
end
def confirm
update_state(:confirm, 'Booth successfully confirmed')
end
private
def update_state(transition, notice)

View file

@ -42,3 +42,8 @@
%li= link_to 'Cancel booth',
cancel_admin_conference_booth_path(@conference.short_title, booth),
method: :patch, id: "cancel_booth_#{booth.id}"
- if booth.transition_possible? :confirm
%li= link_to 'Confirm booth',
confirm_admin_conference_booth_path(@conference.short_title, booth),
method: :patch, id: "confirm_booth_#{booth.id}"

View file

@ -116,7 +116,11 @@
- if can? :update, @conference.tickets.build
%li{class: active_nav_li(admin_conference_tickets_path(@conference.short_title)) }
= link_to 'Tickets', admin_conference_tickets_path(@conference.short_title)
- if can? :manage, @conference.booths
%li
= link_to admin_conference_booths_path(@conference.short_title) do
%span.fa.fa-shopping-bag
Booths
- if (can? :manage, @conference.targets.build) || (can? :manage, @conference.campaigns.build)
%li
%a

View file

@ -57,6 +57,7 @@ Osem::Application.routes.draw do
patch :reset
patch :to_reject
patch :cancel
patch :confirm
end
end