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

SAW - Search Result Institution Color #2

Merged
merged 4 commits into from
Jan 23, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/javascripts/catalog.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ $(document).ready ->
limit: 100,
templates: {
suggestion: Handlebars.compile('<button class="text-left" data-container="body" data-placement="right" data-toggle="tooltip" data-animation="false" title="{{description}}">
<span>{{parents}}</span><br>
<span><strong class="{{inst_css_class}}">{{institution}}</strong>{{parents}}</span><br>
<span><strong>Service: {{label}}</strong></span><br>
<span><strong>Abbreviation: {{abbreviation}}</strong></span><br>
<span><strong>CPT Code: {{cpt_code}}</strong></span>
Expand Down
10 changes: 10 additions & 0 deletions app/assets/stylesheets/proper/service_catalog.sass
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,24 @@

.blue-provider
background: $sparc-blue !important
.blue-provider-text
color: $sparc-blue
.green-provider
background: $sparc-green !important
.green-provider-text
color: $sparc-green
.light-blue-provider
background: $sparc-light-blue !important
.light-blue-provider-text
color: $sparc-light-blue
.red-provider
background: $sparc-red !important
.red-provider-text
color: $sparc-red
.orange-provider
background: $sparc-orange !important
.orange-provider-text
color: $sparc-orange

.institution-header.blue-provider:not(.clicked):hover,
.provider-header.blue-provider:not(.clicked):hover,
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def services

results.map! { |s|
{
parents: s.parents.map(&:abbreviation).join(' | '),
institution: s.institution.name,
inst_css_class: s.institution.css_class + '-text',
parents: ' | ' + s.parents.reject{ |p| p.type == 'Institution' }.map(&:abbreviation).join(' | '),
label: s.name,
value: s.id,
description: (s.description.nil? || s.description.blank?) ? t(:proper)[:catalog][:no_description] : s.description,
Expand Down