Skip to content
Open
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
21 changes: 14 additions & 7 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,25 @@ def full_uri
end
else
get "/#{datastore.slug}" do
headers "metrics.datastore" => datastore.slug, "metrics.route" => "static_page"
Yabeda.datastore_request_count.increment({datastore: datastore.slug}, by: 1)
@presenter = Search::Presenters.for_datastore(slug: datastore.slug, uri: URI.parse(request.fullpath), patron: @patron)
erb :"datastores/layout", layout: :layout do
erb :"datastores/#{datastore.slug}"
if params.any?
@presenter = Search::Presenters.for_datastore_results(slug: datastore.slug, uri: full_uri, patron: @patron)
erb :"datastores/results/layout", layout: :layout do
erb :"datastores/results/#{datastore.slug}"
end
else
headers "metrics.datastore" => datastore.slug, "metrics.route" => "static_page"
Yabeda.datastore_request_count.increment({datastore: datastore.slug}, by: 1)
@presenter = Search::Presenters.for_datastore(slug: datastore.slug, uri: full_uri, patron: @patron)
erb :"datastores/layout", layout: :layout do
erb :"datastores/#{datastore.slug}"
end
end
end
end
if datastore.slug == "onlinejournals" || datastore.slug == "databases"
get "/#{datastore.slug}/browse" do
headers "metrics.datastore" => datastore.slug, "metrics.route" => "browse"
@presenter = Search::Presenters.for_datastore_browse(slug: datastore.slug, uri: URI.parse(request.fullpath), patron: @patron)
@presenter = Search::Presenters.for_datastore_browse(slug: datastore.slug, uri: full_uri, patron: @patron)
erb :"datastores/browse/layout", layout: :layout do
erb :"datastores/browse/#{datastore.slug}"
end
Expand All @@ -164,7 +171,7 @@ def full_uri
if datastore.slug == "everything"
get "/#{datastore.slug}/list" do
headers "metrics.datastore" => datastore.slug, "metrics.route" => "list"
@presenter = Search::Presenters.for_list(slug: datastore.slug, uri: URI.parse(request.fullpath), patron: @patron)
@presenter = Search::Presenters.for_list(slug: datastore.slug, uri: full_uri, patron: @patron)
erb :"datastores/list/layout", layout: :layout do
erb :"datastores/list/#{datastore.slug}"
end
Expand Down
51 changes: 51 additions & 0 deletions assets/styles/datastores/results/_everything.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
@use '../../media';
@use './partials/everything/datastore';

// --------------------------------------------------
//
// # Add To
// Styles to apply directly to `views/datastores/results/_everything.erb`.
//
// ## Table of Contents
// 1. Variables
// 1. Container
//
// --------------------------------------------------

// ******************** //
// *** 1. VARIABLES *** //
// ******************** //

$class: '.everything-results__container';





// ******************** //
// *** 2. CONTAINER *** //
// ******************** //

#{$class} {
max-width: 100%;
@media only screen {
@include media.breakpoint('xs') {
align-items: start;
display: grid;
gap: 1rem;
grid-template-columns: repeat(2, 1fr);
justify-content: center;
}
@include media.breakpoint('lg') {
grid-template-columns: repeat(auto-fit, minmax(0, 20rem));
}
}
@media print {
& > * {
page-break-inside: avoid;
}
& > * + * {
margin-top: 1rem;
}
}
}
1 change: 1 addition & 0 deletions assets/styles/datastores/results/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@use './partials/results-list';
@use './partials/pagination';
@use './partials/no-results';
@use './everything';

// --------------------------------------------------
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@use './results-list/list-item';
@use './results-list/specialists';
@use './results-list/keyword-switch';

// --------------------------------------------------
//
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
@use './datastore/header';
@use './datastore/description';
@use './datastore/no-results';
@use './datastore/footer';

// --------------------------------------------------
//
// # Add To
// Styles to apply directly to `views/datastores/results/partials/everything/_datastore.erb`.
//
// ## Table of Contents
// 1. Variables
// 1. Datastore
//
// --------------------------------------------------

// ******************** //
// *** 1. VARIABLES *** //
// ******************** //

$class: '.everything-results__datastore';





// ******************** //
// *** 2. DATASTORE *** //
// ******************** //

#{$class} {
overflow: hidden;
}





// ****************** //
// *** 3. RESULTS *** //
// ****************** //

#{$class}--results {
border-bottom: 1px solid var(--search-color-grey-400);
& > li {
border-top: 1px solid var(--search-color-grey-400);
padding: 1rem;
@media print {
padding: 1rem 0;
}
th {
clip-path: rect(1px 1px 1px 1px);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// --------------------------------------------------
//
// # Add To
// Styles to apply directly to `views/datastores/results/partials/everything/datastore/_description.erb`.
//
// ## Table of Contents
// 1. Variables
// 1. Description
//
// --------------------------------------------------

// ******************** //
// *** 1. VARIABLES *** //
// ******************** //

$class: '.everything-results__datastore--description';





// ********************** //
// *** 2. DESCRIPTION *** //
// ********************** //

#{$class} {
background: var(--search-color-blue-200);
padding: .75rem 1rem;
@media print{
background: none;
padding: 0.75rem 0;
}
& > *:first-child {
margin-top: 0;
}
& > *:last-child {
margin-bottom: 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@use '../../../../../utilities';

// --------------------------------------------------
//
// # Footer
// Styles to apply directly to `views/datastores/results/partials/everything/datastore/_footer.erb`.
//
// ## Table of Contents
// 1. Variables
// 1. Footer
//
// --------------------------------------------------

// ******************** //
// *** 1. VARIABLES *** //
// ******************** //

$class: '.everything-results__datastore--footer';





// ***************** //
// *** 2. FOOTER *** //
// ***************** //

#{$class} {
@include utilities.flex($wrap: true);
background: var(--search-color-grey-100);
justify-content: space-between;
padding: 0.5rem 1rem;
@media print {
padding: 0.5rem 0;
}
&:not(:hover) {
text-decoration: none;
}
&:hover {
text-decoration: none;
#{$class}-text {
text-decoration: underline;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@use '../../../../../utilities';

// --------------------------------------------------
//
// # Header
// Styles to apply directly to `views/datastores/results/partials/everything/datastore/_header.erb`.
//
// ## Table of Contents
// 1. Variables
// 1. Header
//
// --------------------------------------------------

// ******************** //
// *** 1. VARIABLES *** //
// ******************** //

$class: '.everything-results__datastore--header';





// ***************** //
// *** 2. HEADER *** //
// ***************** //

#{$class} {
@include utilities.flex($wrap: true);
background: var(--search-color-blue-400);
justify-content: space-between;
padding: 0.5rem 1rem;
@media print {
background: none;
padding: 0.5rem 0;
}
&,
& * {
@media only screen {
color: white;
}
margin: 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// --------------------------------------------------
//
// # No Results
// Styles to apply directly to `views/datastores/results/partials/everything/datastore/_no-results.erb`.
//
// ## Table of Contents
// 1. Variables
// 1. No Results
//
// --------------------------------------------------

// ******************** //
// *** 1. VARIABLES *** //
// ******************** //

$class: '.everything-results__datastore--no-results';





// ********************* //
// *** 2. NO RESULTS *** //
// ********************* //

#{$class} {
padding: 1rem;
@media print {
padding: 1rem 0;
}
& > *:first-child {
margin-top: 0;
}
& > *:last-child {
margin-bottom: 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@use '../../../../utilities';

// --------------------------------------------------
//
// # Keyword Switch
// Styles to apply directly to `views/datastores/results/partials/results-list/_keyword-switch.erb`.
//
// ## Table of Contents
// 1. Variables
// 2. Container
//
// --------------------------------------------------

// ******************** //
// *** 1. VARIABLES *** //
// ******************** //

$class: '.results__list-item--keyword-switch';





// ******************** //
// *** 2. CONTAINER *** //
// ******************** //

#{$class} {
@include utilities.flex($align: baseline);
border-left: 4px solid var(--color-maize-400);
padding: 0.5rem;
padding-left: 0.75rem;
.material-symbols-rounded {
color: var(--color-maize-400);
position: relative;
top: 0.25rem;
}
#{$class}-content {
& > * {
margin-bottom: 0;
margin-top: 0;
}
}
}
Loading
Loading