Skip to content

Commit

Permalink
Adds status service field
Browse files Browse the repository at this point in the history
- Adds `status` service field and test.
- Renames name partial container and CSS from `title` to `name-box`.
  • Loading branch information
anselmbradford committed Nov 11, 2014
1 parent b98fd2f commit c1a1d17
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/assets/stylesheets/_base.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1233,14 +1233,18 @@ body {
}

.services-box {
.status {
font-size: $font_size_95;
color: $alert-error-base;
}
.website {
margin-right: 10px;
}
.website,
.email {
@include inline-block();
}
.title {
.title-box {
margin-top: 10px;
margin-bottom: 10px;
padding-bottom: 0;
Expand Down
2 changes: 1 addition & 1 deletion app/views/component/detail/_service_name.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%section.title
%section.name-box
%span.name
= service.name
- if service.alternate_name.present?
Expand Down
8 changes: 8 additions & 0 deletions app/views/component/detail/_service_status.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- if service.status == 'defunct' || service.status == 'inactive'
%section.status
%i.fa.fa-warning
%span
- if service.status == 'defunct'
= t('service_fields.status_defunct')
- elsif service.status == 'inactive'
= t('service_fields.status_inactive')
4 changes: 3 additions & 1 deletion app/views/component/locations/detail/_body.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@
- @location.services.each do |service|

%section.service{ itemscope: '', itemtype: 'http://schema.org/Service' }
= render 'component/detail/service_name', service: service
%section.title-box
= render 'component/detail/service_status', service: service
= render 'component/detail/service_name', service: service
%section.web-addresses-box
= render 'component/detail/service_website', service: service
= render 'component/detail/service_email', service: service
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ en:
keywords: 'Keyword Tags'
required_documents: 'Required Documents:'
service_areas: 'Service Areas:'
status_defunct: 'This service is no longer operating!'
status_inactive: 'This service is not currently operating!'
urls: 'Homepage:'
wait: 'Service Wait Estimate:'

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions spec/features/details/location_service_details_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,18 @@
expect(page).to have_content('Monday-Friday, 8-5; Saturday, 10-6;')
end
end

context 'when service element status is present', :vcr do
it 'includes defunct status notice' do
visit('/locations/fake-org/location-with-no-phone')
element = '.services-box .status'
expect(find(element)).to have_content(I18n.t('service_fields.status_defunct'))
end

it 'includes inactive status notice' do
visit('/locations/admin-test-org/admin-test-location')
element = '.services-box .status'
expect(find(element)).to have_content(I18n.t('service_fields.status_inactive'))
end
end
end

0 comments on commit c1a1d17

Please sign in to comment.