Registration for Events
This commit is contained in:
parent
f188fd5575
commit
01ec43e53a
35 changed files with 522 additions and 46 deletions
|
|
@ -5,7 +5,9 @@
|
|||
%br
|
||||
%small
|
||||
= @event.subtitle
|
||||
= link_to 'Edit', edit_admin_conference_program_event_path(@conference.short_title, @event), class: 'btn btn-mini btn-primary pull-right'
|
||||
.btn-group.pull-right
|
||||
= link_to 'Registrations', registrations_admin_conference_program_event_path(@conference.short_title, @event), class: 'btn btn-success'
|
||||
= link_to 'Edit', edit_admin_conference_program_event_path(@conference.short_title, @event), class: 'btn btn-mini btn-primary'
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
|
|
@ -94,7 +96,8 @@
|
|||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
off_text: 'No' }
|
||||
|
||||
- if @event.require_registration
|
||||
= registered_text(@event)
|
||||
- if !@event.room.nil?
|
||||
%tr
|
||||
%td
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
%th
|
||||
%b Speaker
|
||||
%th
|
||||
%b Pre-registration
|
||||
%b Requires Registration
|
||||
%th
|
||||
%b Highlight
|
||||
%th
|
||||
|
|
@ -83,15 +83,18 @@
|
|||
- else
|
||||
Unknown speaker
|
||||
|
||||
%td{'data-order' => "#{event.require_registration}"}
|
||||
%td.text-center{'data-order' => "#{event.require_registration}"}
|
||||
= check_box_tag @conference.short_title, event.id, event.require_registration,
|
||||
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{event.id}?event[require_registration]=",
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
off_text: 'No' }
|
||||
- if event.require_registration
|
||||
%br
|
||||
= link_to registered_text(event), registrations_admin_conference_program_event_path(@conference.short_title, event), class: 'btn btn-xs btn-default'
|
||||
|
||||
%td{'data-order' => "#{event.is_highlight}"}
|
||||
%td.text-center{'data-order' => "#{event.is_highlight}"}
|
||||
= check_box_tag @conference.short_title, event.id, event.is_highlight,
|
||||
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{event.id}?event[is_highlight]=",
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
|
|
|
|||
40
app/views/admin/events/registrations.html.haml
Normal file
40
app/views/admin/events/registrations.html.haml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1
|
||||
Registrations (#{@event_registrations.length}/#{@event.max_attendees})
|
||||
.text-muted
|
||||
for
|
||||
= @event.title
|
||||
|
||||
- if @event.room && (@event_registrations.length > @event.room.size)
|
||||
%b Attention:
|
||||
You have more registrations than the capacity of the room!
|
||||
|
||||
.well
|
||||
%table.table.table-hover.table-borderd.table-striped.datatable#registrations
|
||||
%thead
|
||||
%th
|
||||
%th Name
|
||||
%th Email
|
||||
%th Created At
|
||||
%th Attended
|
||||
%th Attended Conference
|
||||
%tbody
|
||||
- @event_registrations.each.with_index(1) do |event_registration, index|
|
||||
%tr
|
||||
%td= index
|
||||
%td= event_registration.name
|
||||
%td= event_registration.email
|
||||
%td= event_registration.created_at
|
||||
%td
|
||||
= check_box_tag @conference.short_title, @event.id, event_registration.attended, class: 'switch-checkbox', method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{@event.id}/toggle_attendance?events_registration_id=#{event_registration.id}&&event_registration[attended]=",
|
||||
data: { size: 'small',
|
||||
off_color: 'danger',
|
||||
on_text: 'Yes',
|
||||
off_text: 'No' }
|
||||
%td
|
||||
- if event_registration.registration.attended
|
||||
%i.fa.fa-check.text-success
|
||||
-else
|
||||
%i.fa.fa-close.text-danger
|
||||
25
app/views/admin/users/_event_registrations.html.haml
Normal file
25
app/views/admin/users/_event_registrations.html.haml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
.row
|
||||
.col-md-12.page-header
|
||||
%h2
|
||||
Registrations to Events
|
||||
|
||||
.col-md-12
|
||||
.well
|
||||
%table.table.table-bordered.table-striped.table-hover.datatable#event_registrations
|
||||
%thead
|
||||
%th ID
|
||||
%th Conference
|
||||
%th Title
|
||||
%th Attended
|
||||
%tbody
|
||||
- @user.events_registrations.each do |event_registration|
|
||||
- event = event_registration.event
|
||||
%tr
|
||||
%td= event.id
|
||||
%td= link_to event.program.conference.short_title, admin_conference_path(event.program.conference.short_title)
|
||||
%td= link_to event.title, admin_conference_program_event_path(event.program.conference.short_title, event)
|
||||
%td
|
||||
- if @user.attended_event?(event)
|
||||
%i.fa.fa-check.text-success
|
||||
- else
|
||||
%i.fa.fa-times.text-danger
|
||||
|
|
@ -7,6 +7,8 @@
|
|||
- unless @user.events.blank?
|
||||
%li{class: "#{'active' if params[:tab] == 'submissions-content'}"}
|
||||
= link_to 'Submissions', '#submissions-content', 'data-toggle'=>'tab'
|
||||
%li{class: "#{'active' if params[:tab] == 'event_registrations-content'}"}
|
||||
= link_to 'Event Registrations', '#event_registrations', 'data-toggle'=>'tab'
|
||||
.tab-content
|
||||
#user-info-content.tab-pane{class: "#{'active' unless params[:tab] == 'submissions-content'}"}
|
||||
- if can? :edit, @user
|
||||
|
|
@ -31,3 +33,5 @@
|
|||
%td= @user.send(attr)
|
||||
#submissions-content.tab-pane{class: "#{'active' if params[:tab] == 'submissions-content'}"}
|
||||
= render 'submissions'
|
||||
#event_registrations.tab-pane{class: "#{'active' if params[:tab] == 'event_registrations'}"}
|
||||
= render 'event_registrations'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue