mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Rework cfp abilities
This commit is contained in:
parent
5f3b48c9f7
commit
f37d3095e1
4 changed files with 20 additions and 4 deletions
|
|
@ -139,6 +139,11 @@ class Ability
|
|||
cannot :destroy, Venue do |venue|
|
||||
venue.conference.program.events.where.not(room_id: nil).any?
|
||||
end
|
||||
|
||||
# Can't create cfp if there are no available cfp types
|
||||
cannot [:new, :create], Cfp do |cfp|
|
||||
cfp.program.remaining_cfp_types.empty?
|
||||
end
|
||||
end
|
||||
|
||||
def signed_in_with_organizer_role(user)
|
||||
|
|
@ -166,7 +171,7 @@ class Ability
|
|||
can :manage, Program, conference_id: conf_ids_for_organizer
|
||||
can :manage, Schedule, program: { conference_id: conf_ids_for_organizer }
|
||||
can :manage, EventSchedule, schedule: { program: { conference_id: conf_ids_for_organizer } }
|
||||
can :manage, Cfp, program: { conference_id: conf_ids_for_organizer}
|
||||
can :manage, Cfp, program: { conference_id: conf_ids_for_organizer }
|
||||
can :manage, Event, program: { conference_id: conf_ids_for_organizer}
|
||||
can :manage, EventType, program: { conference_id: conf_ids_for_organizer}
|
||||
can :manage, Track, program: { conference_id: conf_ids_for_organizer}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
.btn-group
|
||||
= link_to 'Edit', edit_admin_conference_program_cfp_path(@conference.short_title, cfp.id), method: :get, class: 'btn btn-primary'
|
||||
= link_to 'Delete', admin_conference_program_cfp_path(@conference.short_title, cfp.id), method: 'delete', class: 'btn btn-danger', data: { confirm: 'Are you sure you want to delete the CfP?' }
|
||||
- if @program.remaining_cfp_types.length > 0
|
||||
- if can? :new, @program.cfps.new
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= link_to 'Create Call for Papers', new_admin_conference_program_cfp_path(@conference.short_title), class: 'btn btn-primary'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue