Skip to content

Commit

Permalink
Fix slim-lint offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
monfresh committed Apr 6, 2017
1 parent e931aff commit e9b19e5
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 109 deletions.
84 changes: 42 additions & 42 deletions app/views/component/locations/detail/_body.html.haml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
= render 'component/locations/detail/header'
= render 'component/locations/detail/header', location: location

%section#detail-info{ itemscope: '', itemtype: 'http://schema.org/Organization' }

%header
%section
%p{ class: "kind icon #{@location.kind.parameterize}" }
= link_to @location.kind, locations_path(kind: @location.kind), title: "All locations of type #{@location.kind}"
%p{ class: "kind icon #{location.kind.parameterize}" }
= link_to location.kind, locations_path(kind: location.kind), title: "All locations of type #{location.kind}"
%hgroup
%h1.name
= superscript_ordinals(full_name_content_for(@location))
= superscript_ordinals(full_name_content_for(location))

- if @location.organization.name && @location.organization.name != @location.name
- if location.organization.name && location.organization.name != location.name
%h2.agency
= link_to(locations_path(org_name: @location.organization.name)) do
= link_to(locations_path(org_name: location.organization.name)) do
%span
= superscript_ordinals(@location.organization.name)
= superscript_ordinals(location.organization.name)

/ detail sidebar content
.location-sidebar-box
%aside.location-sidebar

- if @location.hours.present?
- if location.hours.present?
%section.schedules-box.location-sidebar-section
%h1 Location Hours
%section.location-sidebar-content
= render 'component/detail/location_hours', location: @location
= render 'component/detail/location_hours', location: location

- if @location.regular_schedules.present?
- if location.regular_schedules.present?
%section.schedules-box.location-sidebar-section
%h1 Regular Hours
%section.location-sidebar-content
= render 'component/detail/location_regular_schedule', schedules: @location.regular_schedules
= render 'component/detail/location_regular_schedule', schedules: location.regular_schedules

- if @location.holiday_schedules.present?
- if location.holiday_schedules.present?
%section.schedules-box.location-sidebar-section
%h1 Holiday Hours
%section.location-sidebar-content
= render 'component/detail/location_holiday_schedule', schedules: @location.holiday_schedules
= render 'component/detail/location_holiday_schedule', schedules: location.holiday_schedules

- if (@location.fields & location_contact_fields).any?
- if (location.fields & location_contact_fields).any?
%section.contact-box-general.location-sidebar-section
%h1 General Contact Info
%section.location-sidebar-content
= render 'component/detail/website', website: @location.website
= render 'component/detail/email', email: @location.email
= render 'component/detail/website', website: location.website
= render 'component/detail/email', email: location.email

- if @location.phones.present?
- if location.phones.present?
%section.phones.location-sidebar-content-group
- @location.phones.each do |phone|
- location.phones.each do |phone|
= render 'component/detail/phone', phone: phone, show_phone_type_and_department: true

- if @location[:contacts].present?
- @location.contacts.each do |contact|
- if location[:contacts].present?
- location.contacts.each do |contact|
%section.contact-box-specific.location-sidebar-section
%h1 Specific Contact
%section.location-sidebar-content
Expand All @@ -69,23 +69,23 @@
- contact.phones.each do |phone|
= render 'component/detail/phone', phone: phone, show_phone_type_and_department: true

- if @location.address.present?
- if location.address.present?
%section.address-box.location-sidebar-section
%h1 Physical Address
%section.location-sidebar-content
%section.address.icon-text-block
%i.fa.fa-map-marker
%span
= render 'component/detail/address', location: @location, lines: 2
= render 'component/detail/address', location: location, lines: 2

- if @location.mail_address.present?
- if location.mail_address.present?
%section.address-box.location-sidebar-section
%h1 Mailing Address
%section.location-sidebar-content
%section.mail-address.icon-text-block
%i.fa.fa-envelope
%span
= render 'component/detail/mail_address', location: @location
= render 'component/detail/mail_address', location: location

- if @categories.present?
%aside.location-sidebar
Expand All @@ -103,53 +103,53 @@
%section
%section.overview-box
%section
= render 'component/detail/location_short_desc', location: @location
= render 'component/detail/location_description', location: @location
= render 'component/detail/location_short_desc', location: location
= render 'component/detail/location_description', location: location

- if @location[:coordinates].present? || @location[:transportation].present?
- if location[:coordinates].present? || location[:transportation].present?
%section.map-box
%h1 Location

%div
- if @location[:transportation].present?
- if location[:transportation].present?
%section.transportation-availability
%h1 Public Transit:
%span
= @location.transportation
= location.transportation

- if @location.coordinates.present?
- if location.coordinates.present?
%section.map#detail-map-view
#detail-map-canvas
%span.hide#detail-map-canvas-title
= full_address_for(@location.address)
= full_address_for(location.address)
%span.hide#detail-map-canvas-lat
= @location.latitude
= location.latitude
%span.hide#detail-map-canvas-lng
= @location.longitude
= location.longitude
%span.hide#detail-map-canvas-kind
= @location.kind
= location.kind
%noscript
-# Hides map when JavaScript is disabled.
:sass
#detail-map-view
display: none

- if @location[:languages].present? || @location[:accessibility].present?
- if location[:languages].present? || location[:accessibility].present?
%section.service-opt-box
%h1 Service Options
%section
= render 'component/detail/languages', location: @location
= render 'component/detail/accessibility', location: @location
= render 'component/detail/languages', location: location
= render 'component/detail/accessibility', location: location

- if @location.kind == "Farmers' Markets"
- if location.kind == "Farmers' Markets"
%section.payment-box
%h1 Payment & Products
= render 'component/detail/farmers_markets'

- if @location.services.present?
- if location.services.present?
%section.services-box
%h1 Services
- @location.services.each do |service|
- location.services.each do |service|

%section.service{ itemscope: '', itemtype: 'http://schema.org/Service' }
%section.title-box
Expand Down Expand Up @@ -190,10 +190,10 @@
= render 'component/detail/service_service_areas', service: service

/ Detail footer content.
- if @location.updated_at.present?
- if location.updated_at.present?
%footer
%section.metadata
.button-edit
= link_to "#{SETTINGS[:admin_site]}/locations/#{@location.slug}", rel: 'nofollow' do
= link_to "#{SETTINGS[:admin_site]}/locations/#{location.slug}", rel: 'nofollow' do
%i.fa.fa-pencil
Edit
31 changes: 30 additions & 1 deletion app/views/component/locations/detail/_header.html.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
%header.results-header#floating-results-header
= render partial: 'component/locations/detail/header_summary', locals: { location: @location }
%div
.right-column
.floating-content.hide><
%span
%a.button-utility.button-top{ href: '#' }
%i.fa.fa-chevron-up
Top
%span.utility-links
%span.button-print-container><
%a.button-utility.button-print.hide{ href: '#' }
%i.fa.fa-print
Print
%span><
%a.button-utility.button-share-email{ href: mailto_url }
%i.fa.fa-share
Email
- if location.coordinates.present?
%span><
%a.button-utility.button-directions{ href: "https://maps.google.com/maps?saddr=current+location&daddr=#{full_address_for(location.address)}", target: '_blank' }
%i.fa.fa-external-link-square
%span Directions
%span
%a.button-utility.button-back{ href: "#{locations_url(request.query_parameters)}##{location.id}", target: '_self' }
%i.fa.fa-arrow-circle-left
Back

.left-column
.floating-content.hide
%h1
= superscript_ordinals(full_name_content_for(location))
30 changes: 0 additions & 30 deletions app/views/component/locations/detail/_header_summary.html.haml

This file was deleted.

12 changes: 6 additions & 6 deletions app/views/component/locations/results/_body.html.haml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
= render 'component/locations/results/header'
= render 'component/locations/results/header', search: search
%section#results-entries
- unless @search.map_data.empty?
= render 'component/locations/results/map_view'
- unless search.map_data.empty?
= render 'component/locations/results/map_view', search: search

- if info_box_key_corresponding_to_keyword.present?
%section#terminology-box-container
.terminology-box
= render_info_box(info_box_key_corresponding_to_keyword)

- if @search.locations.present?
- if search.locations.present?

- if params[:org_name].present?
%section#organization-detail-container
= render 'component/locations/results/organization_detail',
organization: @search.locations.first.organization
organization: search.locations.first.organization

= render 'component/locations/results/list_view'
= render 'component/locations/results/list_view', search: search
- else
%section.no-results
.message
Expand Down
23 changes: 22 additions & 1 deletion app/views/component/locations/results/_header.html.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
%header.results-header#floating-results-header
= render 'component/locations/results/header_summary'
%div
.right-column
.floating-content.hide><
%span
%a.button-utility.button-top{ href: '#' }
%i.fa.fa-chevron-up
Top

= paginate search.results

.left-column
%span.static-content><
- unless search.map_data.empty?
%a.button-utility.button-map-zoom#map-size-control{ href: '#', disabled: 'disabled' }
%i.fa.fa-refresh.fa-spin
Loading map...
%p.search-summary
%span
= page_entries_info search.results, entry_name: 'result'

%span.map-summary.static-content
= map_summary unless search.map_data.empty?
22 changes: 0 additions & 22 deletions app/views/component/locations/results/_header_summary.html.haml

This file was deleted.

4 changes: 2 additions & 2 deletions app/views/component/locations/results/_list_view.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%section#list-view
%ul
- @search.locations.each do |location|
- search.locations.each do |location|

%li
%a{ href: location_link_for(location), title: location.name, name: location.id }
Expand Down Expand Up @@ -33,4 +33,4 @@
%p.short-desc
= location.short_desc
%footer
= paginate @search.results
= paginate search.results
3 changes: 2 additions & 1 deletion app/views/component/locations/results/_map_view.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
%section#map-view
#map-canvas
= render 'component/search/map_data'
%script#map-locations-data{ type: 'application/json' }
= raw(search.map_data.to_json)
%noscript
-# Hide map when JavaScript is disabled.
:sass
Expand Down
2 changes: 0 additions & 2 deletions app/views/component/search/_map_data.html.haml

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/locations/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- title search_results_page_title
= render 'component/search/aside'
%section#results-container{ class: ('result-map-showing' unless @search.map_data.empty?) }
= render 'component/locations/results/body'
= render 'component/locations/results/body', search: @search
2 changes: 1 addition & 1 deletion app/views/locations/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
- @location.name == @location.organization.name ? canonical("#{locations_url}/#{@location.slug}") : canonical("#{locations_url}/#{@location.organization.slug}/#{@location.slug}")
= render 'component/search/aside'
%section#results-container
= render 'component/locations/detail/body'
= render 'component/locations/detail/body', location: @location

0 comments on commit e9b19e5

Please sign in to comment.