diff --git a/app/assets/stylesheets/_reset.scss b/app/assets/stylesheets/_reset.scss new file mode 100644 index 000000000..0568b16a2 --- /dev/null +++ b/app/assets/stylesheets/_reset.scss @@ -0,0 +1,32 @@ +// flatten all browser defaults and styles inherited from gov.uk header + +/* Borrowed from http://meyerweb.com/eric/tools/css/reset/ */ +div, span, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark { + border: none; + margin: 0; + padding: 0; +} + +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +input, textarea, +table, caption, tbody, tfoot, thead, tr, th, td { + font-size: inherit; + font-family: inherit; + line-height: inherit; + font-weight: normal; +} + diff --git a/app/assets/stylesheets/finder_frontend.scss b/app/assets/stylesheets/finder_frontend.scss index 2d55549d9..9c8f975ba 100644 --- a/app/assets/stylesheets/finder_frontend.scss +++ b/app/assets/stylesheets/finder_frontend.scss @@ -7,6 +7,7 @@ @import "design-patterns/buttons"; @import "not-ie-conditional"; +@import "reset"; #wrapper { display: block; @@ -43,14 +44,45 @@ } } - header h1 { - @include heading-48; - @include bold-48; - margin: 0 $gutter-half $gutter; - + header { + width: $full-width; + margin-bottom: $gutter; @include media(tablet) { - margin: $gutter; - width: $two-thirds; + margin-bottom: $gutter + } + + h1 { + @include heading-48; + font-weight: bold; + margin: $gutter-one-third $gutter-half; + + @include media(tablet) { + margin: $gutter-half $gutter; + width: $two-thirds; + } + } + .metadata { + position: relative; + @include core-14; + @extend %contain-floats; + width: 100%; + + dt { + float: left; + clear: left; + width: auto; + min-width: 120px; + @include media(tablet) { + padding-right: $gutter-one-third; + } + } + dd { + float: left; + width: 57%; + @include media(tablet) { + width: 70%; + } + } } } @@ -222,6 +254,7 @@ @include core-16; vertical-align: baseline; border-bottom: solid 1px $border-colour; + margin: $gutter-half 0; padding-bottom: $gutter-half; .result-count { diff --git a/app/views/finders/show.html.erb b/app/views/finders/show.html.erb index e0cc7b75f..c64460302 100644 --- a/app/views/finders/show.html.erb +++ b/app/views/finders/show.html.erb @@ -2,6 +2,16 @@

<%= raw(finder.name) %>

+ <% if finder.primary_organisation %> +
+
+
From:
+
+ <%= link_to finder.primary_organisation.title, finder.primary_organisation.web_url %> +
+
+
+ <% end %>
<%= render finder.facets %> diff --git a/features/step_definitions/filtering_steps.rb b/features/step_definitions/filtering_steps.rb index fafbf29b6..704c70099 100644 --- a/features/step_definitions/filtering_steps.rb +++ b/features/step_definitions/filtering_steps.rb @@ -1,10 +1,13 @@ Given(/^a collection of cases exist$/) do + stub_finder_artefact_api_request stub_case_collection_api_request end Then(/^I can get a list of all merger inquiries$/) do + stub_finder_artefact_api_request visit finder_path('cma-cases') page.should have_content('2 cases') + page.should have_css('a', text: 'Competition and Markets Authority') page.should have_css('.filtered-results .document', count: 2) within '.filtered-results .document:nth-child(1)' do @@ -20,6 +23,7 @@ end When(/^I search cases by keyword$/) do + stub_finder_artefact_api_request stub_keyword_search_api_request visit finder_path('cma-cases') diff --git a/features/support/case_helper.rb b/features/support/case_helper.rb index 99090122d..2d79ca520 100644 --- a/features/support/case_helper.rb +++ b/features/support/case_helper.rb @@ -1,4 +1,8 @@ +require 'gds_api/test_helpers/content_api' + module CaseHelper + include GdsApi::TestHelpers::ContentApi + def stub_case_collection_api_request stub_request(:get, finder_api_all_cases_url).to_return( body: all_cases_json, @@ -23,6 +27,11 @@ def stub_keyword_search_api_request ) end + def stub_finder_artefact_api_request + artefact_data = artefact_for_slug('cma-cases').merge(cma_case_artefact) + content_api_has_an_artefact('cma-cases', artefact_data) + end + def finder_api_all_cases_url "#{Plek.current.find('finder-api')}/finders/cma-cases/documents.json" end @@ -224,6 +233,34 @@ def schema_json | end + def cma_case_artefact + { + :id => "http://contentapi.dev.gov.uk/cma-cases.json", + :web_url => "http://finder-frontend.dev.gov.uk/cma-cases", + :title => "Competition and Markets Authority cases", + :format => "finder", + :updated_at => "2014-06-26T13:44:57+01:00", + :tags => [ + { + :id => "http://contentapi.dev.gov.uk/tags/organisation/competition-and-markets-authority.json", + :slug => "competition-and-markets-authority", + :web_url => "http://www.dev.gov.uk/government/organisations/competition-and-markets-authority", + :title => "Competition and Markets Authority ", + :details => { + :description => nil, + :short_description => nil, + :type => "organisation" + }, + :content_with_tag => { + :id => "http://contentapi.dev.gov.uk/with_tag.json?organisation=competition-and-markets-authority", + :web_url => nil + }, + :parent => nil + } + ] + } + end + def select_filters(facets = {}) within ".filter-form form" do facets.values.each do |value|