check abilities
This commit is contained in:
parent
ffb290de0c
commit
07877f3256
8 changed files with 150 additions and 116 deletions
|
|
@ -18,11 +18,13 @@
|
||||||
= ','
|
= ','
|
||||||
= label_tag dom_id(q), "Answers: #{q.answers.map {|a| a.title}.join(', ')}"
|
= label_tag dom_id(q), "Answers: #{q.answers.map {|a| a.title}.join(', ')}"
|
||||||
|
|
||||||
|
- if can? :update, q
|
||||||
%td= link_to 'Edit', edit_admin_conference_question_path(@conference.short_title, q),
|
%td= link_to 'Edit', edit_admin_conference_question_path(@conference.short_title, q),
|
||||||
class: 'btn btn-primary',
|
class: 'btn btn-primary',
|
||||||
disabled: q.global == true && !has_role?(current_user, 'Admin')
|
disabled: q.global == true
|
||||||
|
|
||||||
|
- if can? :destroy, q
|
||||||
%td= link_to 'Delete', admin_conference_question_path(@conference.short_title, q),
|
%td= link_to 'Delete', admin_conference_question_path(@conference.short_title, q),
|
||||||
method: :delete, remote: true, class: 'btn btn-danger',
|
method: :delete, remote: true, class" 'btn btn-danger',
|
||||||
confirm: "Delete question '#{q.title}'?",
|
confirm: "Delete question '#{q.title}'?",
|
||||||
disabled: q.global == true && !has_role?(current_user, "Admin")
|
disabled: q.global == true
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,9 @@
|
||||||
= "(#{@registrations.length})"
|
= "(#{@registrations.length})"
|
||||||
= " - Attended (#{@attended})"
|
= " - Attended (#{@attended})"
|
||||||
.btn-group.pull-right
|
.btn-group.pull-right
|
||||||
|
- if can? :create, Registration
|
||||||
= link_to "New", new_admin_conference_registration_path(@conference.short_title), :class => "btn btn-default"
|
= link_to "New", new_admin_conference_registration_path(@conference.short_title), :class => "btn btn-default"
|
||||||
|
- if can? :read, Registration
|
||||||
= link_to "Export PDF", admin_conference_registrations_path(@conference.short_title, :format => :pdf), :class => "btn btn-default"
|
= link_to "Export PDF", admin_conference_registrations_path(@conference.short_title, :format => :pdf), :class => "btn btn-default"
|
||||||
= link_to "Export XLS", {:format => :xlsx}, :class => "btn btn-default"
|
= link_to "Export XLS", {:format => :xlsx}, :class => "btn btn-default"
|
||||||
%table.table.table-bordered.table-striped.table-hover#registrations
|
%table.table.table-bordered.table-striped.table-hover#registrations
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
- if @users
|
- if @users
|
||||||
= "(#{@users.length})"
|
= "(#{@users.length})"
|
||||||
|
|
||||||
= link_to "New User", new_admin_user_path, :class => "btn btn-success pull-right"
|
= link_to "New User", new_admin_user_path, class: 'btn btn-success pull-right'
|
||||||
.well
|
.well
|
||||||
%table.table.table-striped.table-bordered.table-hover#users
|
%table.table.table-striped.table-bordered.table-hover#users
|
||||||
%thead
|
%thead
|
||||||
|
|
@ -61,11 +61,17 @@
|
||||||
%button{:class=> "btn btn-danger", "data-dismiss"=> "modal", "aria-hidden"=>"true"}
|
%button{:class=> "btn btn-danger", "data-dismiss"=> "modal", "aria-hidden"=>"true"}
|
||||||
Cancel
|
Cancel
|
||||||
= f.action :submit, :as => :button, :button_html => {:value => "Save", :class => "btn btn-primary"}
|
= f.action :submit, :as => :button, :button_html => {:value => "Save", :class => "btn btn-primary"}
|
||||||
|
- if can? :update, Role
|
||||||
=link_to "#{user.roles.map { |role| role.name }.join ', '}", "#", "data-toggle" => "modal", "data-target" => "#user-role-selection-#{user.id}",id: "user-modify-role-#{user.id}"
|
=link_to "#{user.roles.map { |role| role.name }.join ', '}", "#", "data-toggle" => "modal", "data-target" => "#user-role-selection-#{user.id}",id: "user-modify-role-#{user.id}"
|
||||||
|
- else
|
||||||
|
= user.roles.map { |role| role.name }.join ', '
|
||||||
|
- if can? :update, user
|
||||||
%td
|
%td
|
||||||
= link_to "Edit", edit_admin_user_path(user)
|
= link_to "Edit", edit_admin_user_path(user)
|
||||||
|
- if can? :show, user
|
||||||
%td
|
%td
|
||||||
= link_to "View", admin_user_path(user)
|
= link_to "View", admin_user_path(user)
|
||||||
|
- if can? :destroy, user
|
||||||
%td
|
%td
|
||||||
- if current_user.id == user.id or user.role_ids.include? 3
|
- if current_user.id == user.id or user.role_ids.include? 3
|
||||||
=link_to 'Delete',admin_user_path(user), :method => :delete , :data => {:confirm => 'Are you sure ?'}, :disabled => true,:class => "btn btn-primary disabled btn-danger",:role => "button"
|
=link_to 'Delete',admin_user_path(user), :method => :delete , :data => {:confirm => 'Are you sure ?'}, :disabled => true,:class => "btn btn-primary disabled btn-danger",:role => "button"
|
||||||
|
|
|
||||||
|
|
@ -10,83 +10,104 @@
|
||||||
%span.glyphicon.glyphicon-home
|
%span.glyphicon.glyphicon-home
|
||||||
All Conferences
|
All Conferences
|
||||||
- @conferences.each do |conference|
|
- @conferences.each do |conference|
|
||||||
|
- if can? :show, conference
|
||||||
%li
|
%li
|
||||||
= link_to(admin_conference_path(conference.short_title)) do
|
= link_to(admin_conference_path(conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-cog
|
%span.glyphicon.glyphicon-cog
|
||||||
Manage
|
Manage
|
||||||
= conference.short_title
|
= conference.short_title
|
||||||
|
- if can? :create, Conference
|
||||||
%li
|
%li
|
||||||
= link_to(new_admin_conference_path) do
|
= link_to(new_admin_conference_path) do
|
||||||
%span.glyphicon.glyphicon-plus
|
%span.glyphicon.glyphicon-plus
|
||||||
New Conference
|
New Conference
|
||||||
%hr
|
%hr
|
||||||
|
- if can? :show, @conference
|
||||||
%li{:class=> "#{active_nav_li(admin_conference_path(@conference.short_title))} nav-header nav-header-bigger"}
|
%li{:class=> "#{active_nav_li(admin_conference_path(@conference.short_title))} nav-header nav-header-bigger"}
|
||||||
= link_to(admin_conference_path(@conference.short_title)) do
|
= link_to(admin_conference_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-dashboard
|
%span.glyphicon.glyphicon-dashboard
|
||||||
Manage
|
Manage
|
||||||
|
- if can? :index, Event, conference_id: @conference.id
|
||||||
%li{:class=> active_nav_li(admin_conference_events_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_events_path(@conference.short_title))}
|
||||||
= link_to(admin_conference_events_path(@conference.short_title)) do
|
= link_to(admin_conference_events_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-comment
|
%span.glyphicon.glyphicon-comment
|
||||||
Events
|
Events
|
||||||
|
- if can? :index, @conference => Registration
|
||||||
%li{:class=> active_nav_li(admin_conference_registrations_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_registrations_path(@conference.short_title))}
|
||||||
= link_to(admin_conference_registrations_path(@conference.short_title)) do
|
= link_to(admin_conference_registrations_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-user
|
%span.glyphicon.glyphicon-user
|
||||||
Registrations
|
Registrations
|
||||||
|
- if can? :update, :schedule
|
||||||
%li{class: active_nav_li(admin_conference_schedule_path(@conference.short_title))}
|
%li{class: active_nav_li(admin_conference_schedule_path(@conference.short_title))}
|
||||||
= link_to(admin_conference_schedule_path(@conference.short_title), target: '_blank') do
|
= link_to(admin_conference_schedule_path(@conference.short_title), target: '_blank') do
|
||||||
%span.glyphicon.glyphicon-calendar
|
%span.glyphicon.glyphicon-calendar
|
||||||
Schedule
|
Schedule
|
||||||
|
- if can? :index, Campaign, conference_id: @conference.id
|
||||||
%li{class: active_nav_li(admin_conference_campaigns_path(@conference.short_title))}
|
%li{class: active_nav_li(admin_conference_campaigns_path(@conference.short_title))}
|
||||||
= link_to(admin_conference_campaigns_path(@conference.short_title)) do
|
= link_to(admin_conference_campaigns_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-bullhorn
|
%span.glyphicon.glyphicon-bullhorn
|
||||||
Campaigns
|
Campaigns
|
||||||
%hr
|
%hr
|
||||||
|
- if can? :update, Conference, id: @conference.id
|
||||||
%li{:class=> "#{active_nav_li(edit_admin_conference_path(@conference.short_title))} nav-header nav-header-bigger"}
|
%li{:class=> "#{active_nav_li(edit_admin_conference_path(@conference.short_title))} nav-header nav-header-bigger"}
|
||||||
= link_to(edit_admin_conference_path(@conference.short_title)) do
|
= link_to(edit_admin_conference_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-cog
|
%span.glyphicon.glyphicon-cog
|
||||||
Settings
|
Settings
|
||||||
|
- if can? :index, Target, conference_id: @conference.id
|
||||||
%li{:class=> "#{active_nav_li(admin_conference_targets_path(@conference.short_title))}"}
|
%li{:class=> "#{active_nav_li(admin_conference_targets_path(@conference.short_title))}"}
|
||||||
= link_to(admin_conference_targets_path(@conference.short_title)) do
|
= link_to(admin_conference_targets_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-flag
|
%span.glyphicon.glyphicon-flag
|
||||||
Targets
|
Targets
|
||||||
|
- if can? :index, Venue, id: @conference.venue.id
|
||||||
%li{:class=> "#{active_nav_li(admin_conference_venue_info_path(@conference.short_title))} myAccordion"}
|
%li{:class=> "#{active_nav_li(admin_conference_venue_info_path(@conference.short_title))} myAccordion"}
|
||||||
= link_to(admin_conference_venue_info_path(@conference.short_title)) do
|
= link_to(admin_conference_venue_info_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-road
|
%span.glyphicon.glyphicon-road
|
||||||
Venue
|
Venue
|
||||||
%span.small.glyphicon.glyphicon-chevron-right
|
%span.small.glyphicon.glyphicon-chevron-right
|
||||||
%ul.nav.nav-stacked.nav-pills.small.collapse.subNav
|
%ul.nav.nav-stacked.nav-pills.small.collapse.subNav
|
||||||
|
- if can? :index, Room, conference_id: @conference.id
|
||||||
%li{:class=> active_nav_li(admin_conference_rooms_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_rooms_path(@conference.short_title))}
|
||||||
= link_to 'Rooms', admin_conference_rooms_path(@conference.short_title)
|
= link_to 'Rooms', admin_conference_rooms_path(@conference.short_title)
|
||||||
|
- if can? :index, Lodging, venue_id: @conference.venue.id
|
||||||
%li{ class: active_nav_li(admin_conference_lodgings_path(@conference.short_title)) }
|
%li{ class: active_nav_li(admin_conference_lodgings_path(@conference.short_title)) }
|
||||||
= link_to 'Lodgings', admin_conference_lodgings_path(@conference.short_title)
|
= link_to 'Lodgings', admin_conference_lodgings_path(@conference.short_title)
|
||||||
|
- if can? :index, SponsorshipLevel, conference_id: @conference.id
|
||||||
%li{:class=> "#{active_nav_li(admin_conference_sponsorship_levels_path(@conference.short_title))} myAccordion" }
|
%li{:class=> "#{active_nav_li(admin_conference_sponsorship_levels_path(@conference.short_title))} myAccordion" }
|
||||||
= link_to(admin_conference_sponsorship_levels_path(@conference.short_title)) do
|
= link_to(admin_conference_sponsorship_levels_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-star
|
%span.glyphicon.glyphicon-star
|
||||||
Sponsorship
|
Sponsorship
|
||||||
%span.small.glyphicon.glyphicon-chevron-right
|
%span.small.glyphicon.glyphicon-chevron-right
|
||||||
%ul.nav.nav-stacked.nav-pills.small.collapse.subNav
|
%ul.nav.nav-stacked.nav-pills.small.collapse.subNav
|
||||||
|
- if can? :index, Sponsor, conference_id: @conference.id
|
||||||
%li{:class=> active_nav_li(admin_conference_sponsors_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_sponsors_path(@conference.short_title))}
|
||||||
= link_to 'Sponsors', admin_conference_sponsors_path(@conference.short_title)
|
= link_to 'Sponsors', admin_conference_sponsors_path(@conference.short_title)
|
||||||
|
- if can? :index, SupporterLevel, conference_id: @conference.id
|
||||||
%li{ class: active_nav_li(admin_conference_supporter_levels_path(@conference.short_title)) }
|
%li{ class: active_nav_li(admin_conference_supporter_levels_path(@conference.short_title)) }
|
||||||
= link_to(admin_conference_supporter_levels_path(@conference.short_title)) do
|
= link_to(admin_conference_supporter_levels_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-usd
|
%span.glyphicon.glyphicon-usd
|
||||||
Supporter Levels
|
Supporter Levels
|
||||||
|
- if can? :index, EmailSettings, conference_id: @conference.id
|
||||||
%li{:class=> active_nav_li(admin_conference_emails_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_emails_path(@conference.short_title))}
|
||||||
= link_to(admin_conference_emails_path(@conference.short_title)) do
|
= link_to(admin_conference_emails_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-envelope
|
%span.glyphicon.glyphicon-envelope
|
||||||
E-Mails
|
E-Mails
|
||||||
|
- if can? :index, CallForPapers, conference_id: @conference.id
|
||||||
%li{:class=> "#{active_nav_li(admin_conference_callforpapers_path(@conference.short_title))} myAccordion"}
|
%li{:class=> "#{active_nav_li(admin_conference_callforpapers_path(@conference.short_title))} myAccordion"}
|
||||||
= link_to(admin_conference_callforpapers_path(@conference.short_title)) do
|
= link_to(admin_conference_callforpapers_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-comment
|
%span.glyphicon.glyphicon-comment
|
||||||
Call for papers
|
Call for papers
|
||||||
%span.small.glyphicon.glyphicon-chevron-right
|
%span.small.glyphicon.glyphicon-chevron-right
|
||||||
%ul.nav.nav-stacked.nav-pills.small.collapse.subNav
|
%ul.nav.nav-stacked.nav-pills.small.collapse.subNav
|
||||||
|
- if can? :index, @conference => Track
|
||||||
%li{:class=> active_nav_li(admin_conference_tracks_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_tracks_path(@conference.short_title))}
|
||||||
= link_to 'Tracks', admin_conference_tracks_path(@conference.short_title)
|
= link_to 'Tracks', admin_conference_tracks_path(@conference.short_title)
|
||||||
|
- if can? :index, EventType, conference_id: @conference.id
|
||||||
%li{:class=> active_nav_li(admin_conference_event_types_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_event_types_path(@conference.short_title))}
|
||||||
= link_to 'Event types', admin_conference_event_types_path(@conference.short_title)
|
= link_to 'Event types', admin_conference_event_types_path(@conference.short_title)
|
||||||
|
- if can? :index, DifficultyLevel, conference_id: @conference.id
|
||||||
%li{:class=> active_nav_li(admin_conference_difficulty_levels_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_difficulty_levels_path(@conference.short_title))}
|
||||||
= link_to 'Difficulty levels', admin_conference_difficulty_levels_path(@conference.short_title)
|
= link_to 'Difficulty levels', admin_conference_difficulty_levels_path(@conference.short_title)
|
||||||
|
- if can? :index, Question, conference_id: @conference.id
|
||||||
%li{:class=> active_nav_li(admin_conference_questions_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_questions_path(@conference.short_title))}
|
||||||
= link_to(admin_conference_questions_path(@conference.short_title)) do
|
= link_to(admin_conference_questions_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-question-sign
|
%span.glyphicon.glyphicon-question-sign
|
||||||
|
|
|
||||||
|
|
@ -10,15 +10,18 @@
|
||||||
%span.glyphicon.glyphicon-home
|
%span.glyphicon.glyphicon-home
|
||||||
All Conferences
|
All Conferences
|
||||||
- @conferences.each do |conference|
|
- @conferences.each do |conference|
|
||||||
|
- if can? :show, conference
|
||||||
%li
|
%li
|
||||||
= link_to(admin_conference_path(conference.short_title)) do
|
= link_to(admin_conference_path(conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-cog
|
%span.glyphicon.glyphicon-cog
|
||||||
Manage
|
Manage
|
||||||
= conference.short_title
|
= conference.short_title
|
||||||
|
- if can? :create, Conference
|
||||||
%li
|
%li
|
||||||
= link_to(new_admin_conference_path) do
|
= link_to(new_admin_conference_path) do
|
||||||
%span.glyphicon.glyphicon-plus
|
%span.glyphicon.glyphicon-plus
|
||||||
New Conference
|
New Conference
|
||||||
|
- if can? :index, User
|
||||||
%hr
|
%hr
|
||||||
%li
|
%li
|
||||||
= link_to(admin_users_path) do
|
= link_to(admin_users_path) do
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,13 @@
|
||||||
= link_to(destroy_user_session_path, :method=>'delete') do
|
= link_to(destroy_user_session_path, :method=>'delete') do
|
||||||
%span.glyphicon.glyphicon-minus
|
%span.glyphicon.glyphicon-minus
|
||||||
Sign out
|
Sign out
|
||||||
-if has_role?(current_user, "admin") || has_role?(current_user, "organizer")
|
- if can? :index, Conference
|
||||||
%li.divider
|
%li.divider
|
||||||
%li
|
%li
|
||||||
= link_to(admin_conference_index_path()) do
|
= link_to(admin_conference_index_path()) do
|
||||||
%span.glyphicon.glyphicon-home
|
%span.glyphicon.glyphicon-home
|
||||||
Administration
|
Administration
|
||||||
-if @conference and @conference.id
|
-if @conference and @conference.id and can? :index, @conference
|
||||||
%li
|
%li
|
||||||
= link_to(admin_conference_path(@conference.short_title)) do
|
= link_to(admin_conference_path(@conference.short_title)) do
|
||||||
%span.glyphicon.glyphicon-cog
|
%span.glyphicon.glyphicon-cog
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
data.formData = inputs.serializeArray();
|
data.formData = inputs.serializeArray();
|
||||||
});
|
});
|
||||||
$.getJSON($('#fileupload').prop('action'), function (files) {
|
$.getJSON($('#fileupload').prop('action'), function (files) {
|
||||||
var fu = $('#fileupload').data('fileupload'),
|
var fu = $('#fileupload').data('blueimpFileupload'),
|
||||||
template;
|
template;
|
||||||
fu._adjustMaxNumberOfFiles(-files.length);
|
fu._adjustMaxNumberOfFiles(-files.length);
|
||||||
template = fu._renderDownload(files)
|
template = fu._renderDownload(files)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
= semantic_form_for(@event, :url => @url) do |f|
|
= semantic_form_for(@event, :url => @url) do |f|
|
||||||
%section#basic
|
%section#basic
|
||||||
= f.inputs :name => "Session Information" do
|
= f.inputs :name => "Session Information" do
|
||||||
- if can? :update, @event
|
- if can? :update, @event or can? :create, @event
|
||||||
= f.input :title, :as => :string, :required => true
|
= f.input :title, :as => :string, :required => true
|
||||||
- else
|
- else
|
||||||
Title: #{@event.title}
|
Title: #{@event.title}
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
%br
|
%br
|
||||||
= f.input :subtitle, :as => :string
|
= f.input :subtitle, :as => :string
|
||||||
%section#details
|
%section#details
|
||||||
- if can? :update, @event
|
- if can? :update, @event or can? :create, @event
|
||||||
= f.input :event_type_id,:as => :select, :collection => @conference.event_types.map {|x| ["#{x.title} - #{show_time(x.length)}", x.id]}, :include_blank => false, :label => "Session Type"
|
= f.input :event_type_id,:as => :select, :collection => @conference.event_types.map {|x| ["#{x.title} - #{show_time(x.length)}", x.id]}, :include_blank => false, :label => "Session Type"
|
||||||
- else
|
- else
|
||||||
Event type: #{@event.event_type.title}
|
Event type: #{@event.event_type.title}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue