Godwin
8 years ago
10 changed files with 500 additions and 118 deletions
@ -0,0 +1,11 @@ |
|||||
|
.guests-housed |
||||
|
%h5 Guests Housed: |
||||
|
.data="#{@guests_housed} / #{@guests.size}" |
||||
|
|
||||
|
%table.hosts.admin-edit |
||||
|
- @hosts.each do | id, registration | |
||||
|
%tr.host |
||||
|
%th |
||||
|
.name=registration.user.name |
||||
|
.address=registration.housing_data['address'] |
||||
|
%td.inner-table{colspan: 2}=host_guests_table(registration) |
@ -1,47 +1,7 @@ |
|||||
- add_inline_script :housing |
- add_inline_script :housing |
||||
= form_tag administration_update_path(@this_conference.slug, :housing), id: :hosts, class: 'on-top-target' do |
= form_tag administration_update_path(@this_conference.slug, :housing), id: 'housing-table-form' do |
||||
= hidden_field_tag :guest_id |
#housing-table= render partial: 'conferences/admin/hosts_table' |
||||
.on-top-controls |
#guest-selector |
||||
= button_tag :close, type: :button, class: ['on-top-close'] |
= form_tag administration_update_path(@this_conference.slug, :housing), class: 'guest-dlg', id: 'guest-list-table' do |
||||
%ul |
%h3 Select a Guest |
||||
- @hosts.each do | id, registration | |
#table |
||||
- if registration.user.present? |
|
||||
- widget_data = host_guests_widget(registration) |
|
||||
%li{id: "host-#{id}", class: widget_data[:class]} |
|
||||
%h4=registration.user.name |
|
||||
.email=registration.user.email |
|
||||
.address=registration.housing_data['address'] |
|
||||
.guests=widget_data[:html] |
|
||||
#guests |
|
||||
%h4=_'articles.admin.housing.headings.guests', :t |
|
||||
%ul.guests |
|
||||
- @guests.each do | id, registration | |
|
||||
- if registration.user.present? |
|
||||
%li.guest{id: "guest-#{id}", data: { id: id, 'affected-hosts': @hosts_affected_by_guests[id].join(',') }} |
|
||||
%h4= registration.user.name |
|
||||
.city=registration.city |
|
||||
.on-top-only.details |
|
||||
= data_set(:h4, 'articles.admin.housing.headings.email') do |
|
||||
= registration.user.email |
|
||||
= data_set(:h4, 'articles.admin.housing.headings.housing') do |
|
||||
= registration.housing |
|
||||
- if registration.arrival.present? |
|
||||
= data_set(:h4, 'articles.admin.housing.headings.arrival_departure') do |
|
||||
= date_span(registration.arrival.to_date, registration.departure.to_date) |
|
||||
- if (registration.housing_data || {})['companions'].present? |
|
||||
= data_set(:h4, 'articles.admin.housing.headings.companion') do |
|
||||
- companion = User.find_by_email(registration.housing_data['companions'].first) |
|
||||
- if companion |
|
||||
= "#{companion.firstname} (#{companion.email})" |
|
||||
- else |
|
||||
= registration.housing_data['companions'].first |
|
||||
= _'articles.admin.housing.headings.unregistered' |
|
||||
- if registration.allergies.present? |
|
||||
= data_set(:h4, 'articles.admin.housing.headings.allergies') do |
|
||||
= registration.allergies |
|
||||
- if registration.other.present? |
|
||||
= data_set(:h4, 'articles.admin.housing.headings.other') do |
|
||||
= registration.other |
|
||||
= button_tag :set_host, type: :button, class: [:small, 'set-host', 'not-on-top'] |
|
||||
|
|
||||
|
|
||||
|
@ -0,0 +1,46 @@ |
|||||
|
= hidden_field_tag :host, host.id |
||||
|
.host-field |
||||
|
%h4.inline=_'forms.labels.generic.name' |
||||
|
%span.plain-value= host.user.name |
||||
|
.host-field |
||||
|
%h4.inline=_'articles.conference_registration.headings.host.availability' |
||||
|
%span.plain-value= date_span(host.housing_data['availability'][0].to_date, host.housing_data['availability'][1].to_date) |
||||
|
- if host.housing_data['considerations'].present? |
||||
|
.host-field |
||||
|
%h4.inline=_'articles.conference_registration.headings.host.considerations' |
||||
|
%span.plain-value= (host.housing_data['considerations'].map { | consideration | _"articles.conference_registration.host.considerations.#{consideration}" }).join(', ') |
||||
|
- if sanitize(host.housing_data['notes'], tags: []).present? |
||||
|
.host-field |
||||
|
%h4=_'articles.conference_registration.headings.host.notes' |
||||
|
%blockquote= host.housing_data['notes'].html_safe |
||||
|
%table.guests.admin-edit |
||||
|
%tr |
||||
|
%th.corner |
||||
|
%th=_'forms.labels.generic.city' |
||||
|
%th=_'forms.labels.generic.housing' |
||||
|
%th=_'articles.admin.housing.headings.arrival_departure' |
||||
|
%th=_'forms.labels.generic.companion' |
||||
|
%th=_'forms.labels.generic.food' |
||||
|
%th=_'forms.labels.generic.allergies' |
||||
|
%th=_'forms.labels.generic.other' |
||||
|
- @guests.each do | id, registration | |
||||
|
%tr.selectable{class: get_housing_match(host, registration, space).to_s.gsub('_', '-'), data: {host: host.id, guest: id, space: space}} |
||||
|
%th=registration.user.name |
||||
|
%td=registration.city |
||||
|
%td=_"articles.conference_registration.questions.housing.#{registration.housing}" |
||||
|
%td=date_span(registration.arrival.to_date, registration.departure.to_date) |
||||
|
- companion = companion(registration) |
||||
|
%td=companion.present? ? (companion.is_a?(User) ? companion.name : (_"articles.conference_registration.terms.registration_status.#{companion}")) : '' |
||||
|
%td=_"articles.conference_registration.questions.food.#{registration.food}" |
||||
|
%td=registration.allergies |
||||
|
%td |
||||
|
.p=registration.other |
||||
|
|
||||
|
.legend |
||||
|
%h4 Legend |
||||
|
%ul |
||||
|
%li.good-match Good Match |
||||
|
%li.bad-match Poor Match |
||||
|
%li.selected-space Also in this space |
||||
|
%li.other-space Also with this host |
||||
|
%li.other-host Already hosted |
Loading…
Reference in new issue