Bike!Bike! Website!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

122 lines
4.6 KiB

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