Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #476 - Adds missing location details #516

Merged
merged 2 commits into from
Jul 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/assets/stylesheets/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1676,6 +1676,11 @@ body { top: 0px !important; }
padding: 35px;
padding-top: 0px;
padding-bottom: 20px;

// Indentation for service category hierarchy.
.hierarchy-depth-1{ margin-left: 10px; }
.hierarchy-depth-2{ margin-left: 20px; }
.hierarchy-depth-3{ margin-left: 30px; }
}

> section > section > section
Expand Down
1 change: 1 addition & 0 deletions app/controllers/organizations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def show

if @org[:services].present?
@categories = @org.services.map { |s| s[:categories] }.flatten.compact
@keywords = @org.services.map { |s| s[:keywords] }.flatten.compact.uniq
end

# To disable or remove the Result list button on details page
Expand Down
4 changes: 2 additions & 2 deletions app/views/component/detail/_accessibility.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- if org[:accessibility].present?
%section{:class=>css_class_format('accessibility')}
%section{ class: css_class_format('accessibility') }
- if defined? iconclass
%i{:class=>iconclass}
%i{ class: iconclass }
%h1 Accessibility Options:
%ul
- org.accessibility.sort.each do |accessibility_option|
Expand Down
4 changes: 2 additions & 2 deletions app/views/component/detail/_languages.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- if org[:languages].present?
%section{:class=>css_class_format('languages')}
%section{ class: css_class_format('languages') }
- if defined? iconclass
%i{:class=>iconclass}
%i{ class: iconclass }
%h1 Languages Spoken:
%ul
- org.languages.sort.each do |lang|
Expand Down
8 changes: 4 additions & 4 deletions app/views/component/detail/_mail_address.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
= org.mail_address.attention
%br

%span.street-address{:itemprop=>"streetAddress"}
%span.street-address{ itemprop: 'streetAddress' }
= superscript_ordinals(org.mail_address.street)
%br

%span.city{:itemprop=>"addressLocality"}><
%span.city{ itemprop: 'addressLocality' }><
= org.mail_address.city
= ','

%span.state{:itemprop=>"addressRegion"}
%span.state{ itemprop: 'addressRegion' }
= org.mail_address.state

%span.zipcode{:itemprop=>"postalCode"}
%span.zipcode{ itemprop: 'postalCode' }
= org.mail_address.zip
8 changes: 8 additions & 0 deletions app/views/component/detail/_service_areas.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- if service[:service_areas].present?
%section{ class: 'service-areas' }
%h1= t('service_fields.service_areas')
%ul
- service.service_areas.sort.each do |f|
%li
%span
= f
5 changes: 5 additions & 0 deletions app/views/component/detail/_service_audience.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- if service[:audience].present?
%section{ class: 'audience' }
%h1= t('service_fields.audience')
%span
= service.audience
5 changes: 5 additions & 0 deletions app/views/component/detail/_service_description.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- if service[:description].present?
%section{ class: 'description' }
%h1= t('service_fields.description')
%span
= service.description
5 changes: 5 additions & 0 deletions app/views/component/detail/_service_eligibility.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- if service[:eligibility].present?
%section{ class: 'eligibility' }
%h1= t('service_fields.eligibility')
%span
= service.eligibility
5 changes: 5 additions & 0 deletions app/views/component/detail/_service_fees.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- if service[:fees].present?
%section{ class: 'fees' }
%h1= t('service_fields.fees')
%span
= service.fees
5 changes: 5 additions & 0 deletions app/views/component/detail/_service_how_to_apply.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- if service[:how_to_apply].present?
%section{ class: 'how-to-apply' }
%h1= t('service_fields.how_to_apply')
%span
= service.how_to_apply
9 changes: 9 additions & 0 deletions app/views/component/detail/_service_keywords.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- if @keywords.present?
%section#keywords-box
%h1= t('service_fields.keywords')
%section.keywords
%ul
- @keywords.each do |keyword|
%li
%span
= link_to keyword, organizations_path(request.query_parameters.merge(keyword: keyword))
4 changes: 4 additions & 0 deletions app/views/component/detail/_service_name.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- if service[:name].present?
%section{ class: 'name' }
%span
= service.name
10 changes: 10 additions & 0 deletions app/views/component/detail/_service_urls.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- if service[:urls].present?
%section{ class: 'urls' }
%h1= t('service_fields.urls')
%ul
- service.urls.sort.each do |url|
%li
%span
%a{ href: url, target: '_blank' }
%span{ itemprop: 'url' }
= format_url(url)
5 changes: 5 additions & 0 deletions app/views/component/detail/_service_wait.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- if service[:wait].present?
%section{ class: 'wait' }
%h1= t('service_fields.wait')
%span
= service.wait
2 changes: 1 addition & 1 deletion app/views/component/detail/_template.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- if org[field].present?
%section{:class=>css_class_format(field.to_s)}
%section{ class: css_class_format(field.to_s) }
- if defined? iconclass
%i{ class: iconclass }
- if defined? stitle
Expand Down
14 changes: 0 additions & 14 deletions app/views/component/detail/_urls.html.haml

This file was deleted.

30 changes: 17 additions & 13 deletions app/views/component/organizations/detail/_body.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,16 @@
%section#categories-box
%h1 Service Categories
%section.services{ itemscope: '', itemtype: 'http://schema.org/Service' }
%ul{ itemscope: '', itemtype: 'http://schema.org/ServiceType' }
%ul{ itemscope: '', itemtype: 'http://schema.org/serviceType' }
- @categories.each do |category|
%li{ class: "depth#{category.depth}" }
%li{ class: "hierarchy-depth-#{category.depth}" }
%span{ itemprop: 'serviceType' }
-# Category links are disabled till there's a corresponding filter that can be toggled!
= link_to category.name, organizations_path(@search_params.merge(:category => category.name))
= link_to category.name, organizations_path(@search_params.merge(category: category.name))
= category.name

= render 'component/detail/service_keywords'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The keywords section should be moved to its own partial. This will make it easier to remove from _body if desired.

/ Main detail content.
%section

Expand All @@ -118,7 +120,7 @@
%section

= render partial: 'component/detail/template', locals: { org: @org, field: :short_desc }
= render partial: 'component/detail/template', locals: { org: @org, field: :description, stitle: 'Description' }
= render partial: 'component/detail/template', locals: { org: @org, field: :description, stitle: 'Location Description' }

- if @org[:coordinates].present? || @org[:transportation].present?
%section.map-box
Expand Down Expand Up @@ -166,15 +168,17 @@

%section.service{ itemscope: '', itemtype: 'http://schema.org/Service' }

= render partial: 'component/detail/template', locals: { org: service, field: :name}
= render partial: 'component/detail/template', locals: { org: service, field: :description}
= render partial: 'component/detail/urls', locals: { org: service, field: :urls, stitle: 'Homepage' }
= render partial: 'component/detail/template', locals: { org: service, field: :fees, stitle: 'Fees' }
= render partial: 'component/detail/template', locals: { org: service, field: :audience, stitle: 'Audience' }
= render partial: 'component/detail/template', locals: { org: service, field: :eligibility, stitle: 'Eligibility' }
= render partial: 'component/detail/template', locals: { org: service, field: :how_to_apply, stitle: 'How to Apply' }

/ detail footer content
= render 'component/detail/service_name', service: service
= render 'component/detail/service_description', service: service
= render 'component/detail/service_urls', service: service
= render 'component/detail/service_fees', service: service
= render 'component/detail/service_audience', service: service
= render 'component/detail/service_eligibility', service: service
= render 'component/detail/service_how_to_apply', service: service
= render 'component/detail/service_wait', service: service
= render 'component/detail/service_areas', service: service

/ Detail footer content.
- if @org[:updated_at].present?
%footer
%section.metadata
Expand Down
15 changes: 15 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ en:
homepage_search: 'Search'
services_near_me: 'Services near me'
update_search_results: 'Update search results'

helpers:
page_entries_info:
one_page:
Expand All @@ -35,15 +36,29 @@ en:
other: "Displaying <strong>all %{count}</strong> %{entry_name}"
more_pages:
display_entries: "Displaying <strong>%{first} - %{last}</strong> of <strong>%{total}</strong> %{entry_name}"

labels:
address_search: 'Address search'
agency_search: 'Organization name search'
homepage_search: 'I need...'

placeholders:
address_search: 'address or ZIP code'
agency_search: 'full or partial name...'
homepage_keyword_search: 'what are you looking for?'
results_page_keyword_search: 'search for...'

service_fields:
audience: 'Audience:'
description: 'Service Description:'
eligibility: 'Eligibility:'
fees: 'Fees:'
how_to_apply: 'How to Apply:'
keywords: 'Keyword Tags'
service_areas: 'Service Areas:'
urls: 'Homepage:'
wait: 'Service Wait Estimate:'

views:
pagination:
first: "&laquo; First"
Expand Down
60 changes: 31 additions & 29 deletions spec/features/details/location_details_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,12 @@
expect(page).to have_content('Walk in or apply by phone or mail')
end

# Wait time not included in the view.
# Till we have a consistent meaning for wait time
# it's best left out of the front-end view
xit 'includes wait info' do
it 'includes wait estimate info' do
expect(page).to have_content('No wait to 2 weeks')
end

# Service areas not included in view.
# Best to leave this out of the view, this is data that could easily be
# wrong and it's better that the client contact the agency and ask for
# services and be referred accordingly vs. going off this list.
xit 'includes service areas' do
expect(page).to have_content('Marin County')
it 'includes service areas info' do
expect(page).to have_content('San Mateo County')
end

it 'includes updated time' do
Expand All @@ -121,8 +114,27 @@
end
end

it 'includes URLs' do
expect(page).to have_link('www.smchealth.org')
it 'includes short description' do
within '.short-desc' do
expect(page).
to have_content('[NOTE THIS IS NOT A REAL ENTRY--')
end
end

it 'includes description' do
expect(page).to have_content('Lorem ipsum')
end

it 'includes transporation info' do
expect(page).to have_content('SAMTRANS stops within 1 block')
end

it 'includes hours info' do
expect(page).to have_content('Monday-Friday, 8-5; Saturday, 10-6;')
end

it 'includes languages info' do
expect(page).to have_content('Chinese (Cantonese)')
end

it 'includes accessibility info' do
Expand All @@ -138,36 +150,26 @@
expect(page).to have_link('sanmaceo@co.sanmaceo.ca.us')
end

it 'includes hours info' do
expect(page).to have_content('Monday-Friday, 8-5; Saturday, 10-6;')
it 'includes URLs' do
expect(page).to have_link('www.smchealth.org')
end

it 'includes languages info' do
expect(page).to have_content('Chinese (Cantonese)')
it 'includes Physical Address info' do
expect(page).to have_content('Avenue of the fellows')
end

it 'includes Mailing Address info' do
expect(page).to have_content('Hella Fellas')
end

it 'includes description' do
expect(page).to have_content('Lorem ipsum')
end

it 'includes short description' do
within '.short-desc' do
expect(page).
to have_content('[NOTE THIS IS NOT A REAL ENTRY--')
end
end

it 'includes transporation info' do
expect(page).to have_content('SAMTRANS stops within 1 block')
it 'includes keywords' do
expect(page).to have_link('Ruby on Rails/MongoDB/Redis')
end

it 'sets the page title to the location name + site title' do
expect(page).to have_title('San Maceo Agency | Ohana Web Search')
end

end

describe 'Edit link' do
Expand Down