Godwin
8 years ago
10 changed files with 144 additions and 148 deletions
@ -1,122 +1,122 @@ |
|||||
- location = @conference.organizations.first.locations.first |
- location = @conference.organizations.first.locations.first |
||||
- location_name = location.city + ', ' + (location.territory ? Carmen::Country.coded(location.country).subregions.coded(location.territory).name : location.country) |
- location_name = location.city + ', ' + (location.territory ? Carmen::Country.coded(location.country).subregions.coded(location.territory).name : location.country) |
||||
|
|
||||
- title @conference.title |
- title @conference.title |
||||
- description "#{@conference.title} conference in #{location_name} for DIY bicycle collectives, co-ops, and advocacy groups" |
- description "#{@conference.title} conference in #{location_name} for DIY bicycle collectives, co-ops, and advocacy groups" |
||||
= render 'header' |
= render 'header' |
||||
- stats = {confirmed: 0, completed: 0, total: 0, paid: 0, collected: 0, housing_total: 0, housing_beds: 0, housing_couches: 0, housing_campers: 0, bikes: 0, small_bikes: 0, large_bikes: 0} |
- stats = {confirmed: 0, completed: 0, total: 0, paid: 0, collected: 0, housing_total: 0, housing_beds: 0, housing_couches: 0, housing_campers: 0, bikes: 0, small_bikes: 0, large_bikes: 0} |
||||
%article.row |
%article.row |
||||
.columns.large-10 |
.columns.large-10 |
||||
%h2=_'conference.registrations.title','Registrations' |
%h2=_'conference.registrations.title','Registrations' |
||||
%table.registrations |
%table.registrations |
||||
%tr |
%tr |
||||
%th='Email' |
%th='Email' |
||||
%th='First Name' |
%th='First Name' |
||||
%th='Last Name' |
%th='Last Name' |
||||
%th='Preferred Name' |
%th='Preferred Name' |
||||
%th='Confirmed?' |
%th='Confirmed?' |
||||
%th='Completed?' |
%th='Completed?' |
||||
%th='Paid?' |
%th='Paid?' |
||||
%th='Housing' |
%th='Housing' |
||||
%th='Bike' |
%th='Bike' |
||||
- @registrations.each do |registration| |
- @registrations.each do |registration| |
||||
%tr |
%tr |
||||
- data = YAML.load(registration.data) |
- data = YAML.load(registration.data) |
||||
- user = User.find_by(:email => registration.email) |
- user = User.find_user(registration.email) |
||||
- stats[:total] += 1 |
- stats[:total] += 1 |
||||
- stats[:confirmed] += (registration.is_confirmed ? 1 : 0) |
- stats[:confirmed] += (registration.is_confirmed ? 1 : 0) |
||||
- stats[:completed] += (registration.completed ? 1 : 0) |
- stats[:completed] += (registration.completed ? 1 : 0) |
||||
- stats[:paid] += (registration.registration_fees_paid ? 1 : 0) |
- stats[:paid] += (registration.registration_fees_paid ? 1 : 0) |
||||
- stats[:collected] += (registration.registration_fees_paid || 0) |
- stats[:collected] += (registration.registration_fees_paid || 0) |
||||
- stats[:housing_total] += (data[:questions][:housing] == 'none' ? 0 : 1) |
- stats[:housing_total] += (data[:questions][:housing] == 'none' ? 0 : 1) |
||||
- stats[:housing_beds] += (data[:questions][:housing] == 'bed' ? 1 : 0) |
- stats[:housing_beds] += (data[:questions][:housing] == 'bed' ? 1 : 0) |
||||
- stats[:housing_couches] += (data[:questions][:housing] == 'couch' ? 1 : 0) |
- stats[:housing_couches] += (data[:questions][:housing] == 'couch' ? 1 : 0) |
||||
- stats[:housing_campers] += (data[:questions][:housing] == 'camp' ? 1 : 0) |
- stats[:housing_campers] += (data[:questions][:housing] == 'camp' ? 1 : 0) |
||||
- stats[:bikes] += (data[:questions][:housing] == 'no' ? 0 : 1) |
- stats[:bikes] += (data[:questions][:housing] == 'no' ? 0 : 1) |
||||
- stats[:small_bikes] += (data[:questions][:housing] == 'small' ? 1 : 0) |
- stats[:small_bikes] += (data[:questions][:housing] == 'small' ? 1 : 0) |
||||
- stats[:large_bikes] += (data[:questions][:housing] == 'large' ? 1 : 0) |
- stats[:large_bikes] += (data[:questions][:housing] == 'large' ? 1 : 0) |
||||
- rows = 1 + (user.present? ? 1 : 0) + (data[:questions][:housing_extra].present? ? 1 :0) + (data[:questions][:other].present? ? 1 :0) |
- rows = 1 + (user.present? ? 1 : 0) + (data[:questions][:housing_extra].present? ? 1 :0) + (data[:questions][:other].present? ? 1 :0) |
||||
%td.user{rowspan: (rows > 1 ? rows : nil), id: user ? "user-#{user.id}" : nil}=registration.email |
%td.user{rowspan: (rows > 1 ? rows : nil), id: user ? "user-#{user.id}" : nil}=registration.email |
||||
%td=data[:user][:firstname] |
%td=data[:user][:firstname] |
||||
%td=data[:user][:lastname] |
%td=data[:user][:lastname] |
||||
%td=data[:user][:username] |
%td=data[:user][:username] |
||||
%td=registration.is_confirmed ? 'Yes' : 'No' |
%td=registration.is_confirmed ? 'Yes' : 'No' |
||||
%td=registration.completed ? 'Yes' : 'No' |
%td=registration.completed ? 'Yes' : 'No' |
||||
%td=registration.registration_fees_paid.nil? ? 'No' : 'Yes' |
%td=registration.registration_fees_paid.nil? ? 'No' : 'Yes' |
||||
%td=data[:questions][:housing] |
%td=data[:questions][:housing] |
||||
%td=data[:questions][:loaner_bike] |
%td=data[:questions][:loaner_bike] |
||||
- if user.present? |
- if user.present? |
||||
%tr |
%tr |
||||
%th='Organizations' |
%th='Organizations' |
||||
%td{colspan: 3} |
%td{colspan: 3} |
||||
- UserOrganizationRelationship.where(:user_id => user.id).each do |rel| |
- UserOrganizationRelationship.where(:user_id => user.id).each do |rel| |
||||
- org = Organization.find(rel.organization_id) |
- org = Organization.find(rel.organization_id) |
||||
- location_name = "#{org.locations[0].city}, #{org.locations[0].territory}" |
- location_name = "#{org.locations[0].city}, #{org.locations[0].territory}" |
||||
= link_to "#{org.name} (#{location_name})", org |
= link_to "#{org.name} (#{location_name})", org |
||||
%th='Workshops' |
%th='Workshops' |
||||
%td{colspan: 3} |
%td{colspan: 3} |
||||
- Workshop.where('workshop_facilitators.user_id' => user.id, :conference_id => @conference.id).joins(:workshop_facilitators).each do | workshop | |
- Workshop.where('workshop_facilitators.user_id' => user.id, :conference_id => @conference.id).joins(:workshop_facilitators).each do | workshop | |
||||
%a{href: "#workshop-#{workshop.slug}"}= workshop.title |
%a{href: "#workshop-#{workshop.slug}"}= workshop.title |
||||
- if data[:questions][:housing_extra].present? |
- if data[:questions][:housing_extra].present? |
||||
%tr |
%tr |
||||
%th='Housing Notes' |
%th='Housing Notes' |
||||
%td{colspan: 7}=data[:questions][:housing_extra] |
%td{colspan: 7}=data[:questions][:housing_extra] |
||||
- if data[:questions][:other].present? |
- if data[:questions][:other].present? |
||||
%tr |
%tr |
||||
%th='Other Notes' |
%th='Other Notes' |
||||
%td{colspan: 7}=data[:questions][:other] |
%td{colspan: 7}=data[:questions][:other] |
||||
|
|
||||
%h3=_'conference.registrations.workshops.title','Workshops' |
%h3=_'conference.registrations.workshops.title','Workshops' |
||||
%ul |
%ul |
||||
- Workshop.where(:conference_id => @conference.id).each do |workshop| |
- Workshop.where(:conference_id => @conference.id).each do |workshop| |
||||
%li.workshop{id: "workshop-#{workshop.slug}"} |
%li.workshop{id: "workshop-#{workshop.slug}"} |
||||
.columns |
.columns |
||||
%h4=workshop.title |
%h4=workshop.title |
||||
.columns.medium-10.medium-offset-1.end |
.columns.medium-10.medium-offset-1.end |
||||
= workshop.info.html_safe |
= workshop.info.html_safe |
||||
.columns.medium-8.medium-offset-2.end |
.columns.medium-8.medium-offset-2.end |
||||
%h5='Facilitators' |
%h5='Facilitators' |
||||
- workshop.workshop_facilitators.each do |facilitator| |
- workshop.workshop_facilitators.each do |facilitator| |
||||
- user = User.find(facilitator.user_id) |
- user = User.find(facilitator.user_id) |
||||
%div |
%div |
||||
%a{href: "#user-#{user.id}"}="#{user.username} (#{user.email})" |
%a{href: "#user-#{user.id}"}="#{user.username} (#{user.email})" |
||||
|
|
||||
- content_for :side_bar do |
- content_for :side_bar do |
||||
%h5='Stats' |
%h5='Stats' |
||||
%table |
%table |
||||
%tr |
%tr |
||||
%th='Confirmed Registrations:' |
%th='Confirmed Registrations:' |
||||
%td=stats[:confirmed] |
%td=stats[:confirmed] |
||||
%tr |
%tr |
||||
%th='Unconfirmed Registrations:' |
%th='Unconfirmed Registrations:' |
||||
%td=(stats[:total] - stats[:confirmed]) |
%td=(stats[:total] - stats[:confirmed]) |
||||
%tr |
%tr |
||||
%th='Completed Registrations:' |
%th='Completed Registrations:' |
||||
%td=stats[:completed] |
%td=stats[:completed] |
||||
%tr |
%tr |
||||
%th='Incomplete Registrations:' |
%th='Incomplete Registrations:' |
||||
%td=(stats[:total] - stats[:completed]) |
%td=(stats[:total] - stats[:completed]) |
||||
%tr |
%tr |
||||
%th='Fees Collected:' |
%th='Fees Collected:' |
||||
%td=number_to_currency(stats[:collected], :unit => '$') |
%td=number_to_currency(stats[:collected], :unit => '$') |
||||
%tr |
%tr |
||||
%th='Housing Total:' |
%th='Housing Total:' |
||||
%td=stats[:housing_total] |
%td=stats[:housing_total] |
||||
%tr |
%tr |
||||
%th='Beds:' |
%th='Beds:' |
||||
%td=stats[:housing_beds] |
%td=stats[:housing_beds] |
||||
%tr |
%tr |
||||
%th='Couch / Floorspace:' |
%th='Couch / Floorspace:' |
||||
%td=stats[:housing_couches] |
%td=stats[:housing_couches] |
||||
%tr |
%tr |
||||
%th='Campers:' |
%th='Campers:' |
||||
%td=stats[:housing_campers] |
%td=stats[:housing_campers] |
||||
%tr |
%tr |
||||
%th='Bikes Required:' |
%th='Bikes Required:' |
||||
%td=stats[:bikes] |
%td=stats[:bikes] |
||||
%tr |
%tr |
||||
%th='Small Bikes:' |
%th='Small Bikes:' |
||||
%td=stats[:small_bikes] |
%td=stats[:small_bikes] |
||||
%tr |
%tr |
||||
%th='Large Bikes:' |
%th='Large Bikes:' |
||||
%td=stats[:large_bikes] |
%td=stats[:large_bikes] |
||||
|
Loading…
Reference in new issue