Admin improvements
This commit is contained in:
@@ -1,11 +1,20 @@
|
||||
.guests-housed
|
||||
%h5 Guests Housed:
|
||||
.data="#{@guests_housed} / #{@guests.size}"
|
||||
.data{class: @guests_housed < @guests.size ? :unhappy : :happy }="#{@guests_housed} / #{@guests.size}"
|
||||
- if @guests_housed > 0
|
||||
.guests-housed
|
||||
%h5 Unhappy hosts and guests:
|
||||
.data{class: @unhappy_people.size > 0 ? :unhappy : :happy }="#{@unhappy_people.size}"
|
||||
|
||||
- first_row = true
|
||||
%table.hosts.admin-edit
|
||||
- @hosts.each do | id, registration |
|
||||
- @hosts.each do |id, registration|
|
||||
- unless first_row
|
||||
%tr.spacer
|
||||
%td
|
||||
%tr.host
|
||||
%th
|
||||
.name=registration.user.name
|
||||
.address=registration.housing_data['address']
|
||||
%td.inner-table{colspan: 2}=host_guests_table(registration)
|
||||
- first_row = false
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
= admin_update_form class: 'guest-dlg', id: 'guest-list-table' do
|
||||
%h3 Select a Guest
|
||||
#table
|
||||
.actions
|
||||
.actions.center
|
||||
= link_to (_'links.download.Excel'), administration_step_path(@this_conference.slug, @admin_step, :format => :xlsx), class: [:button, :download]
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
%a.button{data: { expands: 'registrations-table' }}='expand'
|
||||
%a.button.delete{data: { contracts: 'registrations-table' }}='close'
|
||||
%a.button.modify{data: { 'opens-modal': 'new-registration' }}='+'
|
||||
.table-scroller
|
||||
= html_table @excel_data, registrations_table_options
|
||||
.table-scroller#registrations
|
||||
= html_table(@excel_data, registrations_table_options)
|
||||
= admin_update_form id: 'new-registration', class: 'modal-edit' do
|
||||
.modal-edit-overlay{data: { 'closes-modal': 'new-registration' }}
|
||||
.modal-edit-content
|
||||
= html_edit_table @excel_data, registrations_edit_table_options
|
||||
.actions.right
|
||||
%a.button.subdued{data: { 'closes-modal': 'new-registration' }}='Cancel'
|
||||
.actions.center
|
||||
%a.button.subdued{data: { 'closes-modal': 'new-registration' }} Cancel
|
||||
= button :save, value: :save, class: :modify
|
||||
|
||||
@@ -1,50 +1,54 @@
|
||||
= 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= host.housing_data['availability'].present? && host.housing_data['availability'][1].present? ? 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.organization'
|
||||
%th=_'forms.labels.generic.city'
|
||||
%th=_'forms.labels.generic.housing'
|
||||
%th=_'articles.admin.housing.headings.arrival_departure'
|
||||
%th=_'articles.conference_registration.headings.companion'
|
||||
%th=_'forms.labels.generic.food'
|
||||
%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
|
||||
- if registration.user.organizations.present?
|
||||
= registration.user.organizations.first.name
|
||||
- else
|
||||
%em None
|
||||
%td=registration.city
|
||||
%td=registration.housing.present? ? (_"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.named_email : (_"articles.conference_registration.terms.registration_status.#{companion}")) : ''
|
||||
%td=registration.food.present? ? (_"articles.conference_registration.questions.food.#{registration.food}") : ''
|
||||
%td
|
||||
.p=registration.other
|
||||
.host
|
||||
= hidden_field_tag :host, host.id
|
||||
%h4 Host
|
||||
.table-scroller.no-edit
|
||||
%table.guests.admin-edit
|
||||
%tr
|
||||
%th.corner
|
||||
%th=_'forms.labels.generic.hosting_space'
|
||||
%th=_'forms.labels.generic.first_day'
|
||||
%th=_'forms.labels.generic.last_day'
|
||||
%th=_'articles.conference_registration.headings.host.notes'
|
||||
%tr
|
||||
- availability = host.housing_data['availability']
|
||||
%th=host.user.name
|
||||
%td=_"forms.labels.generic.#{space}"
|
||||
%td=(availability || [])[0].present? ? availability[0].present? ? date(availability[0].to_date, :span_same_year_date_1) : '' : ''
|
||||
%td=(availability || [])[1].present? ? date(availability[1].to_date, :span_same_year_date_1) : ''
|
||||
%td=((host.housing_data || {})['notes'] || '').html_safe
|
||||
|
||||
.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
|
||||
%h4 Guests
|
||||
.guest-table
|
||||
.table-scroller.no-edit
|
||||
%table.guests.admin-edit
|
||||
%tr
|
||||
%th.corner
|
||||
%th=_'forms.labels.generic.housing'
|
||||
%th=_'forms.labels.generic.arrival'
|
||||
%th=_'forms.labels.generic.departure'
|
||||
%th=_'forms.labels.generic.other_notes'
|
||||
%th=_'forms.labels.generic.city'
|
||||
%th=_'forms.labels.generic.organization'
|
||||
%th=_'articles.conference_registration.headings.companion'
|
||||
%th=_'forms.labels.generic.food'
|
||||
- @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.break-ok=registration.user.name
|
||||
%td=registration.housing.present? ? (_"articles.conference_registration.questions.housing.#{registration.housing}") : ''
|
||||
%td
|
||||
- if registration.arrival.present?
|
||||
=date(registration.arrival.to_date, :span_same_year_date_1)
|
||||
%td
|
||||
- if registration.departure.present?
|
||||
=date(registration.departure.to_date, :span_same_year_date_1)
|
||||
%td.break-ok
|
||||
.p=[registration.allergies, registration.other, (registration.housing_data || {})['other']].compact.join("\n\n")
|
||||
%td=registration.city
|
||||
%td.break-ok
|
||||
- if registration.user.organizations.present?
|
||||
= registration.user.organizations.first.name
|
||||
- else
|
||||
%em None
|
||||
- companion = companion(registration)
|
||||
%td=companion.present? ? (companion.is_a?(User) ? companion.named_email : (_"articles.conference_registration.terms.registration_status.#{companion}")) : ''
|
||||
%td=registration.food.present? ? (_"articles.conference_registration.questions.food.#{registration.food}") : ''
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
- body_class 'banner-bottom' unless @this_conference.poster.present?
|
||||
- add_stylesheet :admin
|
||||
- content_for :banner do
|
||||
= render :partial => 'application/header', :locals => { page_group: :administration, page_key: 'Administration', image_file: @this_conference.poster_url || 'admin.jpg'}
|
||||
= render partial: 'application/header', locals: { page_group: :administration, page_key: 'Administration', image_file: @this_conference.poster_url || 'admin.jpg'}
|
||||
|
||||
%article
|
||||
= row do
|
||||
@@ -10,7 +10,7 @@
|
||||
%h2=@this_conference.title
|
||||
%p=_'articles.admin.paragraphs.administration', :p
|
||||
%ul.break
|
||||
- administration_steps.each do | step, actions |
|
||||
- administration_steps.each do |step, actions|
|
||||
%li
|
||||
.info
|
||||
%h3=_"articles.admin.#{step}.heading", :t
|
||||
@@ -18,7 +18,7 @@
|
||||
%p=_"articles.admin.#{step}.description", :p
|
||||
|
||||
.actions.figures
|
||||
- actions.each do | action |
|
||||
- actions.each do |action|
|
||||
- action_text = (_"articles.admin.#{step}.headings.#{action}", :t)
|
||||
.figure
|
||||
= link_to administration_step_path(@this_conference.slug, action.to_s) do
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
- body_class 'banner-bottom' unless @this_conference.poster.present?
|
||||
- add_stylesheet :admin
|
||||
- content_for :banner do
|
||||
= render :partial => 'application/header', :locals => { page_group: :administration, page_key: 'Administration', image_file: @this_conference.poster_url || 'admin.jpg'}
|
||||
= render partial: 'application/header', locals: { page_group: :administration, page_key: 'Administration', image_file: @this_conference.poster_url || 'admin.jpg'}
|
||||
|
||||
%article{id: "admin-#{@admin_step}"}
|
||||
= row do
|
||||
= columns(medium: 12) do
|
||||
- if admin_help_pages[@admin_step.to_sym]
|
||||
= link_help_dlg("admin_#{admin_help_pages[@admin_step.to_sym]}", class: ['button', 'help-link'])
|
||||
%h2.floating=(_"articles.admin.#{@admin_group}.headings.#{@admin_step}", :t)
|
||||
= row do
|
||||
= columns(medium: 12) do
|
||||
|
||||
Reference in New Issue
Block a user