mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Registrations dashbox eliminated from registrations
This commit is contained in:
parent
62c3ee1631
commit
1d7f3207a6
5 changed files with 205 additions and 209 deletions
|
|
@ -57,3 +57,7 @@
|
|||
display: inline-block;
|
||||
padding: 0px 10px 0px 0px;
|
||||
}
|
||||
|
||||
.margin-event-table{
|
||||
margin-top: 40px !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ module Admin
|
|||
@registrations = @conference.registrations.includes(:user).order('registrations.created_at ASC')
|
||||
@attended = @conference.registrations.where('attended = ?', true).count
|
||||
|
||||
@new_reg = @conference.registrations.where('created_at > ?', current_user.last_sign_in_at).count
|
||||
@registration_distribution = @conference.registration_distribution
|
||||
@affiliation_distribution = @conference.affiliation_distribution
|
||||
end
|
||||
|
|
|
|||
|
|
@ -14,161 +14,162 @@
|
|||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Confirmed events scheduled', data: @scheduled_event_distribution}
|
||||
.col-md-4
|
||||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Tracks of confirmed events', data: @tracks_distribution_confirmed}
|
||||
.row{ style: "margin-top: 40px;"}
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table.table-striped.table-bordered.table-hover.datatable
|
||||
%thead
|
||||
%th
|
||||
%b ID
|
||||
%th
|
||||
%b Title
|
||||
- if @program.rating_enabled?
|
||||
%div.margin-event-table
|
||||
%table.table.table-striped.table-bordered.table-hover.datatable
|
||||
%thead
|
||||
%th
|
||||
%b Rating
|
||||
%th
|
||||
%b Submitter
|
||||
%th
|
||||
%b Speaker
|
||||
-if @program.languages.present?
|
||||
%b ID
|
||||
%th
|
||||
%b Language
|
||||
%th
|
||||
%b Requires Registration
|
||||
%th
|
||||
%b Highlight
|
||||
%th
|
||||
%b Type
|
||||
%th
|
||||
%b Track
|
||||
%th
|
||||
%b Difficulty
|
||||
%th
|
||||
%b State
|
||||
- @events.each do |event|
|
||||
%tr
|
||||
%td
|
||||
= event.id
|
||||
%td
|
||||
=link_to event.title, admin_conference_program_event_path(@conference.short_title, event)
|
||||
|
||||
%b Title
|
||||
- if @program.rating_enabled?
|
||||
%td.col-md-1{'data-order' => "#{event.average_rating}"}
|
||||
- if event.average_rating.to_f > 0
|
||||
#{event.average_rating}/#{@program.rating}
|
||||
%br
|
||||
#{pluralize(event.voters.length, 'voter')}
|
||||
%br
|
||||
- @program.rating.times do |counter|
|
||||
- if event.average_rating.to_f.round == counter+1
|
||||
= label_tag "label_rating", "", :class => "avgrating", :avgrate => true
|
||||
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
|
||||
- else
|
||||
= label_tag "label_rating", "", :class => "avgrating"
|
||||
%br
|
||||
- voted = event.voted?(event, current_user)
|
||||
- if voted
|
||||
%span.label.label-success
|
||||
Your rating: #{voted.rating}
|
||||
- else
|
||||
%span.label.label-danger
|
||||
Not rated
|
||||
- else
|
||||
0/#{@program.rating}
|
||||
%br
|
||||
|
||||
- if event.submitter && event.submitter.registrations && event.submitter.registrations.count < 1
|
||||
- bgcolor="#F7819F"
|
||||
- else
|
||||
- bgcolor=""
|
||||
%td{:style=>"background-color: #{bgcolor}"}
|
||||
- if !event.submitter.nil?
|
||||
=link_to event.submitter.name, admin_user_path(event.submitter)
|
||||
- if event.submitter.registrations.count < 1
|
||||
(Unregistered!)
|
||||
- else
|
||||
Unknown submitter
|
||||
%td
|
||||
- if speaker = event.speakers.first
|
||||
= link_to speaker.name, admin_user_path(speaker)
|
||||
- else
|
||||
Unknown speaker
|
||||
|
||||
%th
|
||||
%b Rating
|
||||
%th
|
||||
%b Submitter
|
||||
%th
|
||||
%b Speaker
|
||||
-if @program.languages.present?
|
||||
%th
|
||||
%b Language
|
||||
%th
|
||||
%b Requires Registration
|
||||
%th
|
||||
%b Highlight
|
||||
%th
|
||||
%b Type
|
||||
%th
|
||||
%b Track
|
||||
%th
|
||||
%b Difficulty
|
||||
%th
|
||||
%b State
|
||||
- @events.each do |event|
|
||||
%tr
|
||||
%td
|
||||
= event.language
|
||||
= event.id
|
||||
%td
|
||||
=link_to event.title, admin_conference_program_event_path(@conference.short_title, event)
|
||||
|
||||
%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.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',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
off_text: 'No' }
|
||||
|
||||
%td
|
||||
.btn-group
|
||||
%button{:type=>"button", :class=>"btn btn-link dropdown-toggle", "data-toggle"=>"dropdown"}
|
||||
- if event.event_type.nil?
|
||||
Event Type
|
||||
- if @program.rating_enabled?
|
||||
%td.col-md-1{'data-order' => "#{event.average_rating}"}
|
||||
- if event.average_rating.to_f > 0
|
||||
#{event.average_rating}/#{@program.rating}
|
||||
%br
|
||||
#{pluralize(event.voters.length, 'voter')}
|
||||
%br
|
||||
- @program.rating.times do |counter|
|
||||
- if event.average_rating.to_f.round == counter+1
|
||||
= label_tag "label_rating", "", :class => "avgrating", :avgrate => true
|
||||
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
|
||||
- else
|
||||
= label_tag "label_rating", "", :class => "avgrating"
|
||||
%br
|
||||
- voted = event.voted?(event, current_user)
|
||||
- if voted
|
||||
%span.label.label-success
|
||||
Your rating: #{voted.rating}
|
||||
- else
|
||||
%span.label.label-danger
|
||||
Not rated
|
||||
- else
|
||||
= event.event_type.title
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
- @event_types.each do |type|
|
||||
%li= link_to type.title,
|
||||
admin_conference_program_event_path(@conference.short_title,
|
||||
event,
|
||||
event: { event_type_id: type.id }),
|
||||
method: :patch
|
||||
%td
|
||||
.btn-group
|
||||
%button{:type=>"button", :class=>"btn btn-link dropdown-toggle", "data-toggle"=>"dropdown"}
|
||||
- if event.track.nil?
|
||||
Track
|
||||
- else
|
||||
= event.track.name
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
- @tracks.each do |track|
|
||||
%li= link_to track.name,
|
||||
admin_conference_program_event_path(@conference.short_title,
|
||||
event,
|
||||
event: { track_id: track.id }),
|
||||
method: :patch
|
||||
%td
|
||||
.btn-group
|
||||
%button{:type=>"button", :class=>"btn btn-link dropdown-toggle", "data-toggle"=>"dropdown"}
|
||||
- if event.difficulty_level.nil?
|
||||
Difficulty
|
||||
- else
|
||||
= event.difficulty_level.title
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
- @difficulty_levels.each do |difficulty_level|
|
||||
%li= link_to difficulty_level.title,
|
||||
admin_conference_program_event_path(@conference.short_title,
|
||||
event,
|
||||
event: { difficulty_level_id: difficulty_level.id }),
|
||||
method: :patch
|
||||
0/#{@program.rating}
|
||||
%br
|
||||
|
||||
%td
|
||||
- if event.state == "withdrawn"
|
||||
Withdrawn
|
||||
- if event.submitter && event.submitter.registrations && event.submitter.registrations.count < 1
|
||||
- bgcolor="#F7819F"
|
||||
- else
|
||||
- bgcolor=""
|
||||
%td{:style=>"background-color: #{bgcolor}"}
|
||||
- if !event.submitter.nil?
|
||||
=link_to event.submitter.name, admin_user_path(event.submitter)
|
||||
- if event.submitter.registrations.count < 1
|
||||
(Unregistered!)
|
||||
- else
|
||||
Unknown submitter
|
||||
%td
|
||||
- if speaker = event.speakers.first
|
||||
= link_to speaker.name, admin_user_path(speaker)
|
||||
- else
|
||||
Unknown speaker
|
||||
|
||||
-if @program.languages.present?
|
||||
%td
|
||||
= event.language
|
||||
|
||||
%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.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',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
off_text: 'No' }
|
||||
|
||||
%td
|
||||
.btn-group
|
||||
%button{:type=>"button", :class=>"btn btn-link dropdown-toggle", "data-toggle"=>"dropdown"}
|
||||
= event.state.humanize
|
||||
- if event.event_type.nil?
|
||||
Event Type
|
||||
- else
|
||||
= event.event_type.title
|
||||
%span.caret
|
||||
%ul.dropdown-menu{:role=>"menu"}
|
||||
= render 'change_state_dropdown', event: event
|
||||
%ul.dropdown-menu
|
||||
- @event_types.each do |type|
|
||||
%li= link_to type.title,
|
||||
admin_conference_program_event_path(@conference.short_title,
|
||||
event,
|
||||
event: { event_type_id: type.id }),
|
||||
method: :patch
|
||||
%td
|
||||
.btn-group
|
||||
%button{:type=>"button", :class=>"btn btn-link dropdown-toggle", "data-toggle"=>"dropdown"}
|
||||
- if event.track.nil?
|
||||
Track
|
||||
- else
|
||||
= event.track.name
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
- @tracks.each do |track|
|
||||
%li= link_to track.name,
|
||||
admin_conference_program_event_path(@conference.short_title,
|
||||
event,
|
||||
event: { track_id: track.id }),
|
||||
method: :patch
|
||||
%td
|
||||
.btn-group
|
||||
%button{:type=>"button", :class=>"btn btn-link dropdown-toggle", "data-toggle"=>"dropdown"}
|
||||
- if event.difficulty_level.nil?
|
||||
Difficulty
|
||||
- else
|
||||
= event.difficulty_level.title
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
- @difficulty_levels.each do |difficulty_level|
|
||||
%li= link_to difficulty_level.title,
|
||||
admin_conference_program_event_path(@conference.short_title,
|
||||
event,
|
||||
event: { difficulty_level_id: difficulty_level.id }),
|
||||
method: :patch
|
||||
|
||||
%td
|
||||
- if event.state == "withdrawn"
|
||||
Withdrawn
|
||||
- else
|
||||
.btn-group
|
||||
%button{:type=>"button", :class=>"btn btn-link dropdown-toggle", "data-toggle"=>"dropdown"}
|
||||
= event.state.humanize
|
||||
%span.caret
|
||||
%ul.dropdown-menu{:role=>"menu"}
|
||||
= render 'change_state_dropdown', event: event
|
||||
|
|
|
|||
|
|
@ -11,19 +11,6 @@
|
|||
= link_to 'Export XLS', {format: :xlsx}, class: 'btn btn-success'
|
||||
%p.text-muted
|
||||
All the people who registered to your event
|
||||
.row
|
||||
.col-sm-4.col-xs-4
|
||||
.dashbox.text-center
|
||||
%span.fa.fa-user.fa-lg
|
||||
%span.fa.fa-lg
|
||||
= @registrations.length
|
||||
%p
|
||||
%small
|
||||
#{'Registration'.pluralize(@registrations.length)}
|
||||
- if @new_reg
|
||||
%span.label.label-success{title: "+#{@new_reg} since you last logged in!"}
|
||||
+
|
||||
= @new_reg
|
||||
.col-md-4
|
||||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Affiliation', data: @affiliation_distribution}
|
||||
- unless @conference.pending?
|
||||
|
|
@ -31,57 +18,58 @@
|
|||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Attended registrations', data: @registration_distribution}
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table.table-hover.datatable#registrations
|
||||
%thead
|
||||
%tr
|
||||
%th ID#
|
||||
%th Name
|
||||
%th E-Mail
|
||||
%th Arrival
|
||||
%th Departure
|
||||
- if @conference.questions.any?
|
||||
%th Questions
|
||||
%th Actions
|
||||
%tbody
|
||||
- @registrations.each_with_index do |registration, index|
|
||||
%div.margin-event-table
|
||||
%table.table.table-hover.datatable#registrations
|
||||
%thead
|
||||
%tr
|
||||
%td
|
||||
= registration.id
|
||||
%td
|
||||
= registration.name.present? ? registration.name : registration.username
|
||||
%br
|
||||
- registration.user.roles.where(resource: @conference).each do |role|
|
||||
%span.label.label-info
|
||||
= role.name.titleize
|
||||
%td
|
||||
= registration.email
|
||||
%td
|
||||
- if registration.arrival
|
||||
= registration.arrival.strftime('%d %b %H:%M')
|
||||
- else
|
||||
n/a
|
||||
%td
|
||||
- if registration.departure
|
||||
= registration.departure.strftime('%d %b %H:%M')
|
||||
- else
|
||||
n/a
|
||||
-if @conference.questions.any?
|
||||
%th ID#
|
||||
%th Name
|
||||
%th E-Mail
|
||||
%th Arrival
|
||||
%th Departure
|
||||
- if @conference.questions.any?
|
||||
%th Questions
|
||||
%th Actions
|
||||
%tbody
|
||||
- @registrations.each_with_index do |registration, index|
|
||||
%tr
|
||||
%td
|
||||
= link_to 'Questions','#', class: 'btn btn-success question-btn', 'data-id' => index, 'data-name' => registration.name
|
||||
%td
|
||||
= check_box_tag "#{@conference.short_title}_#{registration.id}", registration.id, registration.attended,
|
||||
class: 'switch-checkbox', method: :patch,
|
||||
url: toggle_attendance_admin_conference_registration_path(@conference.short_title, id: registration.id)+"?attended=",
|
||||
data: { size: 'small',
|
||||
on_color: 'success',
|
||||
off_color: 'warning',
|
||||
on_text: 'Present',
|
||||
off_text: 'Absent' }
|
||||
.btn-group
|
||||
= link_to 'Edit', edit_admin_conference_registration_path(@conference.short_title, id: registration),
|
||||
method: :get, class: 'btn btn-primary'
|
||||
= link_to 'Delete', admin_conference_registration_path(@conference.short_title, registration),
|
||||
method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete the Registration for #{registration.name}?" }
|
||||
= registration.id
|
||||
%td
|
||||
= registration.name.present? ? registration.name : registration.username
|
||||
%br
|
||||
- registration.user.roles.where(resource: @conference).each do |role|
|
||||
%span.label.label-info
|
||||
= role.name.titleize
|
||||
%td
|
||||
= registration.email
|
||||
%td
|
||||
- if registration.arrival
|
||||
= registration.arrival.strftime('%d %b %H:%M')
|
||||
- else
|
||||
n/a
|
||||
%td
|
||||
- if registration.departure
|
||||
= registration.departure.strftime('%d %b %H:%M')
|
||||
- else
|
||||
n/a
|
||||
-if @conference.questions.any?
|
||||
%td
|
||||
= link_to 'Questions','#', class: 'btn btn-success question-btn', 'data-id' => index, 'data-name' => registration.name
|
||||
%td
|
||||
= check_box_tag "#{@conference.short_title}_#{registration.id}", registration.id, registration.attended,
|
||||
class: 'switch-checkbox', method: :patch,
|
||||
url: toggle_attendance_admin_conference_registration_path(@conference.short_title, id: registration.id)+"?attended=",
|
||||
data: { size: 'small',
|
||||
on_color: 'success',
|
||||
off_color: 'warning',
|
||||
on_text: 'Present',
|
||||
off_text: 'Absent' }
|
||||
.btn-group
|
||||
= link_to 'Edit', edit_admin_conference_registration_path(@conference.short_title, id: registration),
|
||||
method: :get, class: 'btn btn-primary'
|
||||
= link_to 'Delete', admin_conference_registration_path(@conference.short_title, registration),
|
||||
method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete the Registration for #{registration.name}?" }
|
||||
- @registrations.each_with_index do |registration, index|
|
||||
.questions{class: "question#{index}", style: 'display:none;'}
|
||||
= render partial: 'questions', locals: { registration: registration }
|
||||
|
|
|
|||
|
|
@ -352,9 +352,13 @@ ActiveRecord::Schema.define(version: 20160427104236) do
|
|||
t.boolean "include_registrations"
|
||||
t.boolean "include_sponsors"
|
||||
t.boolean "include_lodgings"
|
||||
t.string "banner_photo_file_name"
|
||||
t.string "banner_photo_content_type"
|
||||
t.integer "banner_photo_file_size"
|
||||
t.datetime "banner_photo_updated_at"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.boolean "include_cfp", default: false
|
||||
t.boolean "include_cfp", default: false
|
||||
end
|
||||
|
||||
create_table "sponsors", force: :cascade do |t|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue