Browse Source

Added house rules to housing admin and review

development
Godwin 7 years ago
parent
commit
2185129e55
  1. 12
      app/assets/stylesheets/_admin.scss
  2. 37
      app/assets/stylesheets/_application.scss
  3. 2
      app/controllers/conference_administration_controller.rb
  4. 10
      app/helpers/geocoder_helper.rb
  5. 8
      app/helpers/widgets_helper.rb
  6. 31
      app/views/conference_administration/_hosts_table.html.haml
  7. 10
      app/views/registration_steps/_review.html.haml
  8. 2
      app/views/shared/_navbar.html.haml
  9. 4
      config/locales/en.yml

12
app/assets/stylesheets/_admin.scss

@ -123,6 +123,7 @@ table, .table {
td, .table-td {
&.inner-table {
padding: 0.5em;
vertical-align: top;
table {
margin: 0;
@ -133,6 +134,10 @@ table, .table {
&.bold {
@include font-family(secondary);
}
.rules {
font-size: 0.75em;
}
}
tbody th {
@ -859,7 +864,7 @@ nav.sub-menu {
min-width: 15em;
}
.host-notes {
.host-notes, .house-rules {
@include font-family(primary);
font-size: 0.85em;
border: 0.1em solid $light-gray;
@ -876,6 +881,11 @@ nav.sub-menu {
}
}
.house-rules {
max-height: 30em;
overflow: auto;
}
.guest-notes {
position: relative;
float: left;

37
app/assets/stylesheets/_application.scss

@ -153,43 +153,6 @@ table, .table {
}
}
// td, .table-td {
// &.inner-table {
// padding: 0;
// table {
// margin: 0;
// width: 100%;
// }
// tr:first-child {
// td, th {
// border-top: 0;
// }
// }
// tr:last-child {
// td, th {
// border-bottom: 0;
// }
// }
// td, th {
// &:first-child {
// border-left: 0
// }
// &:last-child {
// border-right: 0
// }
// }
// }
// &.bold {
// @include font-family(secondary);
// }
// }
tbody th {
width: 0.1rem;
}

2
app/controllers/conference_administration_controller.rb

@ -479,8 +479,10 @@ class ConferenceAdministrationController < ApplicationController
end
end
@excel_data[:data] << host_data
end
return respond_to do |format|
format.xlsx { render xlsx: '../conferences/stats', filename: "housing" }
end

10
app/helpers/geocoder_helper.rb

@ -85,8 +85,14 @@ module GeocoderHelper
end
def location_link(location)
return '' unless location.present? && location.address.present?
content_tag(:a, (_!location.address), href: "http://www.google.com/maps/place/#{location.latitude},#{location.longitude}")
return '' unless location.present?
address = if location.is_a?(Location)
location.street
else
location.address
end
return '' unless address.present?
content_tag(:a, (_!address), href: "http://www.google.com/maps/place/#{location.latitude},#{location.longitude}")
end
def same_city?(location1, location2)

8
app/helpers/widgets_helper.rb

@ -112,20 +112,20 @@ module WidgetsHelper
@housing_data[id][:guest_data][guest_id][:errors].each do |error, value|
if value.is_a?(Array)
value.each do |v|
status_html += content_tag(:li, _("errors.messages.housing.space.#{error.to_s}", vars: v))
status_html += content_tag(:li, _("errors.messages.housing.space.#{error.to_s}", vars: v).html_safe)
end
else
status_html += content_tag(:li, _("errors.messages.housing.space.#{error.to_s}", vars: value))
status_html += content_tag(:li, _("errors.messages.housing.space.#{error.to_s}", vars: value).html_safe)
end
end
@housing_data[id][:guest_data][guest_id][:warnings].each do |error, value|
if value.is_a?(Array)
value.each do |v|
status_html += content_tag(:li, _("warnings.messages.housing.space.#{error.to_s}", v))
status_html += content_tag(:li, _("warnings.messages.housing.space.#{error.to_s}", v).html_safe)
end
else
status_html += content_tag(:li, _("warnings.messages.housing.space.#{error.to_s}", vars: value))
status_html += content_tag(:li, _("warnings.messages.housing.space.#{error.to_s}", vars: value).html_safe)
end
end

31
app/views/conference_administration/_hosts_table.html.haml

@ -8,15 +8,22 @@
- first_row = true
%table.hosts.admin-edit
- @hosts.each do |id, registration|
- unless first_row
%tr.spacer
%td
%tr.host
%th
.name=registration.user.name
.address=registration.housing_data['address']
- if registration.housing_data['notes'].present?
.host-notes=paragraph(registration.housing_data['notes'])
%td.inner-table{colspan: 2}=host_guests_table(registration)
- first_row = false
- @hosts.sort_by{ |id, registration| registration.user.name }.each do |id, registration|
- if @housing_data[id][:space].map { |k,v| v }.sum > 0
- unless first_row
%tr.spacer
%td
%tr.host
%th
.name=registration.user.name
.address=location_link(Location.find_location(registration.housing_data['address'], @this_conference.city))
- if registration.housing_data['notes'].present?
.host-notes=paragraph(registration.housing_data['notes'])
- if registration.housing_data['info'].present?
%div=_'articles.conference_registration.headings.housing.Rules', :t
.house-rules
=richtext(registration.housing_data['info'], 4)
%td.inner-table{colspan: 2}
=host_guests_table(registration)
- first_row = false

10
app/views/registration_steps/_review.html.haml

@ -39,6 +39,16 @@
- if @allow_reopen_attendance
.actions.centered
= button :reopen_registration, value: :reopen_registration
- if @host
= row do
= columns(medium: 12) do
%h3=_'articles.conferences.headings.housing_info', :t
%p=(_'articles.conference_registration.paragraphs.Housing', :p, vars: { name: @host.user.name, address: location_link(Location.find_location(@host.housing_data['address'], @this_conference.city)), phone: @host.housing_data['phone'], email: @host.user.email}).html_safe
= row do
= columns(medium: 12) do
%h4=_'articles.conference_registration.headings.hosting_info', :t
= richtext @host.housing_data['info']
= row do
= columns(medium: 12) do
%h3=_'articles.workshops.headings.Workshops', :t

2
app/views/shared/_navbar.html.haml

@ -20,6 +20,6 @@
- locale_translation = language_name(locale, true)
- translation_text = (_'translate.content.change_locale', "Read in #{locale_translation}", vars: {language: locale_translation}, locale: locale)
%a{href: url, lang: locale, title: translation_text}
%span{aria: {hidden: true}}=_!locale
%span{aria: {hidden: :true}}=_!locale
= off_screen translation_text

4
config/locales/en.yml

@ -1833,7 +1833,11 @@ en:
volunteering_info: Volunteering info
additional_details: Additional details
companion: Companion
Housing: Housing
housing:
Rules: House Rules
paragraphs:
Housing: You are staying at %{address}, your host's name is <strong>%{name}</strong>. You can contact them by email <a href="mailto:%{email}">%{email}</a> or by phone at <a href="tel:%{phone}">%{phone}</a>. Please take some time to read their house rules below.
pronoun: It is important that communications with you and about you are as
respectful as possible. If you do not provide a pronoun organizers may assume
he, she, or they based on your name or visual identity.

Loading…
Cancel
Save