From 068a255901c2158a822d5763ff4d9f0453615035 Mon Sep 17 00:00:00 2001 From: Max Turer Date: Tue, 20 Feb 2024 19:54:40 +0000 Subject: [PATCH 01/15] redone base button styles and homepage first block done --- .../stylesheets/scholarspace/base/_base.scss | 40 +- .../scholarspace/components/_footer.scss | 2 +- .../scholarspace/components/_header.scss | 2 +- .../scholarspace/components/_homepage.scss | 398 +++++++++++------- app/views/_controls.html.erb | 2 +- app/views/hyrax/base/_citations.html.erb | 2 +- .../collections/_sort_and_per_page.html.erb | 2 +- .../file_sets/media_display/_default.html.erb | 4 +- .../file_sets/media_display/_pdf.html.erb | 4 +- .../homepage/_home_header_block.html.erb | 16 + app/views/hyrax/homepage/index.html.erb | 2 +- spec/fixtures/content_blocks/share_page.html | 4 +- 12 files changed, 292 insertions(+), 186 deletions(-) create mode 100644 app/views/hyrax/homepage/_home_header_block.html.erb diff --git a/app/assets/stylesheets/scholarspace/base/_base.scss b/app/assets/stylesheets/scholarspace/base/_base.scss index 4c3c0b53..f7b35931 100644 --- a/app/assets/stylesheets/scholarspace/base/_base.scss +++ b/app/assets/stylesheets/scholarspace/base/_base.scss @@ -123,38 +123,52 @@ html { resize: none; } - .gw-btn, .btn-primary { + .btn-primary { display: inline-block; - padding: 0.3rem 0.75rem; margin: 0; border-radius: 0.25rem; - border: 2px solid $gw-light-blue !important; - background-color: $gw-light-blue !important; - color: $gw-white; font-size: 1em; font-weight: 200; line-height: 1.5; text-decoration: none; transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; text-align: center; - - &:focus { - color: $gw-white !important; - background-color: #005984 !important; - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(3, 60, 90, 0.25); + + &.gw-btn { + padding: 0.3rem 0.75rem; + border: 2px solid $gw-light-blue !important; + background-color: $gw-light-blue !important; + color: $gw-white; } - + + &.gw-ghost-btn { + margin: 0 0.75rem; + padding: 0.3rem 2rem; + border: 2px solid $gw-dark-blue !important; + background-color: $gw-white !important; + color: $gw-dark-blue; + } + + &.btn-home { + width: 14rem; + } + &:disabled { opacity: 0.65; } - &:hover { + &:hover, + &:focus { text-decoration: none; color: #212529 !important; border-color: $gw-hover-buff !important; background-color: $gw-hover-buff !important; } + + &:focus { + outline: 0; + box-shadow: 0 0 0 0.2rem rgba(3, 60, 90, 0.25); + } } form label { diff --git a/app/assets/stylesheets/scholarspace/components/_footer.scss b/app/assets/stylesheets/scholarspace/components/_footer.scss index 164b44a9..45dbd359 100644 --- a/app/assets/stylesheets/scholarspace/components/_footer.scss +++ b/app/assets/stylesheets/scholarspace/components/_footer.scss @@ -2,7 +2,7 @@ footer, .footer { position: absolute; bottom: 0; - height: 17.1rem; + height: 18.9rem; width: 100%; .container { diff --git a/app/assets/stylesheets/scholarspace/components/_header.scss b/app/assets/stylesheets/scholarspace/components/_header.scss index 05c5cda2..3bde00e9 100644 --- a/app/assets/stylesheets/scholarspace/components/_header.scss +++ b/app/assets/stylesheets/scholarspace/components/_header.scss @@ -166,7 +166,7 @@ header { align-items: center; #mobile-title { - font-size: 2.5em; + font-size: 2.1em; font-weight: bold; margin-left: 0.3rem; color: $gw-white; diff --git a/app/assets/stylesheets/scholarspace/components/_homepage.scss b/app/assets/stylesheets/scholarspace/components/_homepage.scss index 5e53cd23..c620b524 100644 --- a/app/assets/stylesheets/scholarspace/components/_homepage.scss +++ b/app/assets/stylesheets/scholarspace/components/_homepage.scss @@ -3,198 +3,274 @@ .home-content { display: flex; flex-direction: column; - - div.col-sm-6 { - width: 100%; - - &:last-child { - order: -1; - margin-bottom: 1em; - } - } - - .nav { + + #home-block-1 { margin-bottom: 0; - } - - @media (min-width: $mobile-breakpoint) { - flex-direction: row; + display: flex; + flex-direction: column; + align-items: center; + + h1#home-header { + margin-top: 0.8rem; + margin-bottom: 0; + color: $gw-light-blue; + font-size: 2.6em; + font-weight: bold; + line-height: 0.8em; + + @media (min-width: 560px) { + font-size: 4em; + } + + @media (min-width: 815px) { + font-size: 5em; + } + + @media (min-width: 1019px) { + font-size: 7.5em; + } + + @media (min-width: 1290px) { + font-size: 9.5em; + } + + @media (min-width: 1495px) { + font-size: 11em; + } + } + + .content-container { + display: flex; + flex-direction: row; + align-items: center; + margin: 0 8em; + + .gw-logo { + height: 10em; + width: auto; + background-color: $gw-dark-blue; + margin: 0 0.5em; + padding: 1em; + + img { + width: auto; + height: 100%; + } + } + + .intro { + margin: 0 0.5em; + padding: 1em; + + p { + margin: 0 0 1.4rem; + } + } + + @media (max-width: 1019px) { + margin: 1em 0 0; + } + + @media (max-width: $mobile-breakpoint) { + flex-direction: column; + + .gw-logo { + margin: 0; + height: 5em; + width: 100%; + text-align: center; + } + + .intro { + margin: 0em; + padding: 1em; + + h2 { + font-weight: 300; + font-size: 1.3em; + } - div.col-sm-6 { - &:last-child { - order: 1; - margin-bottom: 0; + p { + margin: 0 0 0.8rem; + } + } + + .button-container > a { + width: 100%; + margin: 0.2em 0; + } } } } } + + // Commenting out homepage tabs styles (will delete) + // .tabs-container { + // background-color: $gw-dark-blue; + // border-radius: 5px; + // padding: 0.5em; - .tabs-container { - background-color: $gw-dark-blue; - border-radius: 5px; - padding: 0.5em; + // li a { + // background-color: transparent; + // color: $gw-light-blue; + // text-decoration: underline; - li a { - background-color: transparent; - color: $gw-light-blue; - text-decoration: underline; + // &:hover { + // color: $gw-hover-orange; + // } + // } - &:hover { - color: $gw-hover-orange; - } - } + // #homeTabs { + // li { + // width: 50%; + // margin-left: 0; - #homeTabs { - li { - width: 50%; - margin-left: 0; - - a { - color: $gw-white; - background-color: $gw-light-blue; - text-decoration: none; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - text-align: center; + // a { + // color: $gw-white; + // background-color: $gw-light-blue; + // text-decoration: none; + // border-bottom-left-radius: 0; + // border-bottom-right-radius: 0; + // text-align: center; - &:hover, &:focus { - background-color: $gw-light-blue; - } - } + // &:hover, &:focus { + // background-color: $gw-light-blue; + // } + // } - @media (min-width: $mobile-breakpoint) { - width: fit-content; - } - } + // @media (min-width: $mobile-breakpoint) { + // width: fit-content; + // } + // } - li.active a { - color: $gw-dark-grey; - background-color: $gw-white; - } - } + // li.active a { + // color: $gw-dark-grey; + // background-color: $gw-white; + // } + // } - .tab-content { - overflow: hidden; - border-top-right-radius: 0; - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; - margin-bottom: 0 !important; + // .tab-content { + // overflow: hidden; + // border-top-right-radius: 0; + // border-bottom-left-radius: 5px; + // border-bottom-right-radius: 5px; + // margin-bottom: 0 !important; - #featured_container, #recently_uploaded { - background-color: $gw-white; - padding: 0; + // #featured_container, #recently_uploaded { + // background-color: $gw-white; + // padding: 0; - h3 { - margin-bottom: 0; - } + // h3 { + // margin-bottom: 0; + // } - p { - margin: 0; - padding: 0.5em; - } + // p { + // margin: 0; + // padding: 0.5em; + // } - #recent_docs, #featured_works { - list-style-type: none; - margin-bottom: 0; + // #recent_docs, #featured_works { + // list-style-type: none; + // margin-bottom: 0; - .recent-item, .featured-item { - border-top: none; - padding: 1em; + // .recent-item, .featured-item { + // border-top: none; + // padding: 1em; - .recent-label, .featured-label { - font-weight: 400; - } - } + // .recent-label, .featured-label { + // font-weight: 400; + // } + // } - li:nth-child(even) { - background-color: $gw-light-grey; - } - } + // li:nth-child(even) { + // background-color: $gw-light-grey; + // } + // } - #featured_works .dd-item { - padding: 0; - } + // #featured_works .dd-item { + // padding: 0; + // } - .table { - margin-bottom: 0; - } - } + // .table { + // margin-bottom: 0; + // } + // } - @media (min-width: $mobile-breakpoint) { - border-top-right-radius: 5px; - } - } - } + // @media (min-width: $mobile-breakpoint) { + // border-top-right-radius: 5px; + // } + // } + // } - .dd-placeholder { - margin-top: 0; - margin-bottom: 0.5rem; - } + // .dd-placeholder { + // margin-top: 0; + // margin-bottom: 0.5rem; + // } - .dd-dragel li, .dd-item { - display: flex; - flex-direction: row; - padding: 0; - margin-bottom: 0.5rem; - - .dd-handle { - position: inherit; - background: $gw-light-blue; - border: none; - border-radius: 0; - height: auto; - } + // .dd-dragel li, .dd-item { + // display: flex; + // flex-direction: row; + // padding: 0; + // margin-bottom: 0.5rem; - .panel { - margin: 0; - background: $gw-white; - border: 1px solid $gw-dark-grey; - border-left: none; - border-radius: 0; - height: auto; - width: 100%; - max-width: 100%; - font-size: 1rem; + // .dd-handle { + // position: inherit; + // background: $gw-light-blue; + // border: none; + // border-radius: 0; + // height: auto; + // } + + // .panel { + // margin: 0; + // background: $gw-white; + // border: 1px solid $gw-dark-grey; + // border-left: none; + // border-radius: 0; + // height: auto; + // width: 100%; + // max-width: 100%; + // font-size: 1rem; - h3 { - margin-bottom: 0; - } + // h3 { + // margin-bottom: 0; + // } - a { - font-size: 1rem; - text-decoration: underline; - } - } - } + // a { + // font-size: 1rem; + // text-decoration: underline; + // } + // } + // } - #new_featured_work_list .btn { - width: 100%; - max-width: 100%; - border: none; - border-radius: 0; - background-color: $gw-light-blue; - color: $gw-white; - - &:hover { - background-color: $gw-hover-buff; - color: $gw-dark-blue; - } - } + // #new_featured_work_list .btn { + // width: 100%; + // max-width: 100%; + // border: none; + // border-radius: 0; + // background-color: $gw-light-blue; + // color: $gw-white; - #publication-content { - h2 { - display: flex; - align-items: center; - } + // &:hover { + // background-color: $gw-hover-buff; + // color: $gw-dark-blue; + // } + // } + + // #publication-content { + // h2 { + // display: flex; + // align-items: center; + // } - img.featured { - margin: 0px 10px 10px 0px; - } - } + // img.featured { + // margin: 0px 10px 10px 0px; + // } + // } - //misc bootstrap overwrite - .nav-pills li.active a, .nav-pills li.active a:hover, .nav-pills li.active a:focus { - color: $gw-dark-grey; - background-color: $gw-white; - } + // //misc bootstrap overwrite + // .nav-pills li.active a, .nav-pills li.active a:hover, .nav-pills li.active a:focus { + // color: $gw-dark-grey; + // background-color: $gw-white; + // } \ No newline at end of file diff --git a/app/views/_controls.html.erb b/app/views/_controls.html.erb index c351cf06..7e68f12f 100644 --- a/app/views/_controls.html.erb +++ b/app/views/_controls.html.erb @@ -27,7 +27,7 @@ - diff --git a/app/views/hyrax/base/_citations.html.erb b/app/views/hyrax/base/_citations.html.erb index 0ba82a6b..7a6e57a9 100644 --- a/app/views/hyrax/base/_citations.html.erb +++ b/app/views/hyrax/base/_citations.html.erb @@ -1,6 +1,6 @@ <% if Hyrax.config.citations? %>
- <%= link_to "Citations", hyrax.citations_work_path(presenter), id: 'citations', class: 'gw-btn' %> + <%= link_to "Citations", hyrax.citations_work_path(presenter), id: 'citations', class: 'btn-primary gw-btn' %>
+   <% end %> <% end %> diff --git a/app/views/hyrax/file_sets/media_display/_default.html.erb b/app/views/hyrax/file_sets/media_display/_default.html.erb index 330d4886..d951cf5a 100644 --- a/app/views/hyrax/file_sets/media_display/_default.html.erb +++ b/app/views/hyrax/file_sets/media_display/_default.html.erb @@ -6,13 +6,13 @@ hyrax.download_path(file_set, :disposition => "attachment"), id: "file_download", data: { label: file_set.id }, - class: "gw-btn", + class: "btn-primary gw-btn", target: "_new" %>

<%= link_to t('hyrax.file_set.show.downloadable_content.default_new_tab'), hyrax.download_path(file_set, :disposition => "inline"), id: "file_download", data: { label: file_set.id }, - class: "gw-btn", + class: "btn-primary gw-btn", target: "_new" %> <% if (Rails.configuration.respond_to?(:accessibility_url)) && (@presenter.respond_to?(:permanent_url)) %>

<%= link_to t('hyrax.file_set.show.downloadable_content.pdf_new_tab'), hyrax.download_path(file_set, :disposition => "inline"), target: :_blank, id: "file_open", data: { label: file_set.id }, - class: "gw-btn" %> + class: "btn-primary gw-btn" %> <% if (Rails.configuration.respond_to?(:accessibility_url)) && (@presenter.respond_to?(:permanent_url)) %>
+

GW ScholarSpace

+
+ +
+

The George Washington University's Institutional Repository

+

As the George Washington University's institutional repository, GW ScholarSpace provides free, public access, broad visibility, and long-term preservation for the research and scholarly works created by GW's faculty, staff, and students, including electronic theses and dissertations (ETDs).

+ +
+
+
\ No newline at end of file diff --git a/app/views/hyrax/homepage/index.html.erb b/app/views/hyrax/homepage/index.html.erb index addb6128..c852144b 100644 --- a/app/views/hyrax/homepage/index.html.erb +++ b/app/views/hyrax/homepage/index.html.erb @@ -1,5 +1,5 @@ <% provide :page_title, application_name %>
- <%= render 'home_content' %> + <%= render 'home_header_block' %>
diff --git a/spec/fixtures/content_blocks/share_page.html b/spec/fixtures/content_blocks/share_page.html index 512dd165..0c798318 100644 --- a/spec/fixtures/content_blocks/share_page.html +++ b/spec/fixtures/content_blocks/share_page.html @@ -9,7 +9,7 @@

Share Your Work

Deposit an Electronic Thesis or Dissertation

To deposit your ETD, please start by visiting:

-

The Library's ETD Page

+

The Library's ETD Page

The University uses the ProQuest ETD Administrator to facilitate the submission/approval process of GW electronic theses and dissertations. By submitting to the ProQuest ETD Administrator, the final and approved version of your thesis or dissertation will be deposited to ProQuest's Dissertation and Theses Online Database and the University's institutional repository, GW ScholarSpace.

@@ -17,7 +17,7 @@

Deposit an Electronic Thesis or Dissertation

Deposit any other scholarship or research

To deposit any other type of work, please use:

-

The GW ScholarSpace Deposit Form

+

The GW ScholarSpace Deposit Form

From 84c48d9a203478b524ae7ced7e676888d7c1fc84 Mon Sep 17 00:00:00 2001 From: Max Turer Date: Tue, 27 Feb 2024 20:53:21 +0000 Subject: [PATCH 02/15] base collections block and login styles --- .../stylesheets/scholarspace/base/_base.scss | 80 +++++-- .../scholarspace/base/_variables.scss | 7 +- .../scholarspace/components/_header.scss | 2 +- .../scholarspace/components/_homepage.scss | 226 ++++++++++++++++-- .../scholarspace/components/_static-page.scss | 38 +-- app/views/devise/passwords/new.html.erb | 18 ++ app/views/devise/registrations/new.html.erb | 31 +++ app/views/devise/sessions/new.html.erb | 28 +++ app/views/hyrax/base/_citations.html.erb | 2 +- .../hyrax/collections/_search_form.html.erb | 2 +- .../collections/_sort_and_per_page.html.erb | 2 +- app/views/hyrax/contact_form/new.html.erb | 2 +- .../file_sets/media_display/_default.html.erb | 4 +- .../file_sets/media_display/_pdf.html.erb | 4 +- .../_home_categories_featured.html.erb | 27 +++ .../hyrax/homepage/_home_collections.html.erb | 23 ++ .../homepage/_home_header_block.html.erb | 4 +- app/views/hyrax/homepage/index.html.erb | 2 + app/views/hyrax/pages/_form.html.erb | 10 +- 19 files changed, 418 insertions(+), 94 deletions(-) create mode 100644 app/views/devise/passwords/new.html.erb create mode 100644 app/views/devise/registrations/new.html.erb create mode 100644 app/views/devise/sessions/new.html.erb create mode 100644 app/views/hyrax/homepage/_home_categories_featured.html.erb create mode 100644 app/views/hyrax/homepage/_home_collections.html.erb diff --git a/app/assets/stylesheets/scholarspace/base/_base.scss b/app/assets/stylesheets/scholarspace/base/_base.scss index f7b35931..c14b4701 100644 --- a/app/assets/stylesheets/scholarspace/base/_base.scss +++ b/app/assets/stylesheets/scholarspace/base/_base.scss @@ -67,6 +67,19 @@ html { } } + div.section-gw-white, + div.section-gw-darkblue { + h2.h2-section-header { + font-size: 1.7em; + + &:after { + content:' '; + display: block; + border: 2px solid $gw-buff; + } + } + } + div.section-gw-white { min-height: auto; @@ -107,23 +120,13 @@ html { h2 { color: $gw-white; } - - h2.h2-section-header { - font-size: 1.7em; - - &:after { - content:' '; - display: block; - border: 2px solid $gw-buff; - } - } } textarea { resize: none; } - .btn-primary { + .btn-base { display: inline-block; margin: 0; border-radius: 0.25rem; @@ -136,16 +139,15 @@ html { &.gw-btn { padding: 0.3rem 0.75rem; - border: 2px solid $gw-light-blue !important; - background-color: $gw-light-blue !important; + border: 2px solid $gw-light-blue; + background-color: $gw-light-blue; color: $gw-white; } &.gw-ghost-btn { - margin: 0 0.75rem; padding: 0.3rem 2rem; - border: 2px solid $gw-dark-blue !important; - background-color: $gw-white !important; + border: 2px solid $gw-dark-blue; + background-color: $gw-white; color: $gw-dark-blue; } @@ -153,6 +155,15 @@ html { width: 14rem; } + &.btn-categories { + width: 100%; + margin: 0.2em 0; + padding: 0.3rem 2rem; + border: 2px solid $gw-white; + background-color: $gw-white; + color: $gw-dark-blue; + } + &:disabled { opacity: 0.65; } @@ -160,9 +171,9 @@ html { &:hover, &:focus { text-decoration: none; - color: #212529 !important; - border-color: $gw-hover-buff !important; - background-color: $gw-hover-buff !important; + color: $gw-dark-blue !important; + border-color: $gw-hover-buff; + background-color: $gw-hover-buff; } &:focus { @@ -245,4 +256,33 @@ html { color: $gw-white; } } - \ No newline at end of file + +//Log In or Sign Up +.login-container { + padding: 0 3em; + + p { + margin: 0; + } + + label { + margin-bottom: 0; + } + + .field { + margin-bottom: 0.5em; + } + + .actions input[type="submit"] { + @extend .btn-base; + @extend .gw-btn; + } + + input[type="checkbox"] { + margin: 0 0.5em 0 0; + } + + #remember-me { + display: flex; + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/scholarspace/base/_variables.scss b/app/assets/stylesheets/scholarspace/base/_variables.scss index 6b750d2c..19c00c26 100644 --- a/app/assets/stylesheets/scholarspace/base/_variables.scss +++ b/app/assets/stylesheets/scholarspace/base/_variables.scss @@ -3,12 +3,11 @@ $gw-light-blue: #28659A; $gw-buff: #AA9868; $gw-hover-buff: #D9D0BB; $gw-hover-orange: #A75523; -$mobile-breakpoint: 768px; +$mobile-breakpoint: 767px; +$mobile-max: 766px; $gw-white: #fff; $gw-dark-grey: #444; $gw-light-grey: #eee; $font-family-sans-serif-fallback: Helvetica, Arial, sans-serif; -$font-family-sans-serif: "Gibson VF", $font-family-sans-serif-fallback; - -$mobile-breakpoint: 767px; \ No newline at end of file +$font-family-sans-serif: "Gibson VF", $font-family-sans-serif-fallback; \ No newline at end of file diff --git a/app/assets/stylesheets/scholarspace/components/_header.scss b/app/assets/stylesheets/scholarspace/components/_header.scss index 3bde00e9..ede3cae6 100644 --- a/app/assets/stylesheets/scholarspace/components/_header.scss +++ b/app/assets/stylesheets/scholarspace/components/_header.scss @@ -282,7 +282,7 @@ header { width: 70%; } - @media (min-width: 880px) { + @media (min-width: 895px) { width: 100%; } diff --git a/app/assets/stylesheets/scholarspace/components/_homepage.scss b/app/assets/stylesheets/scholarspace/components/_homepage.scss index c620b524..070c9282 100644 --- a/app/assets/stylesheets/scholarspace/components/_homepage.scss +++ b/app/assets/stylesheets/scholarspace/components/_homepage.scss @@ -4,47 +4,49 @@ display: flex; flex-direction: column; + .content-container { + display: flex; + flex-direction: row; + align-items: center; + margin: 0 1em; + } + #home-block-1 { - margin-bottom: 0; + margin-bottom: 1rem; display: flex; flex-direction: column; align-items: center; + .content-container { + margin: 0 8em; + + @media (max-width: 1150px) { + margin: 0; + } + } + h1#home-header { - margin-top: 0.8rem; - margin-bottom: 0; + margin-top: 0; + margin-bottom: 0.5em; color: $gw-light-blue; - font-size: 2.6em; + font-size: 10.5vw; font-weight: bold; line-height: 0.8em; - @media (min-width: 560px) { - font-size: 4em; - } - - @media (min-width: 815px) { - font-size: 5em; + @media (min-width: $mobile-breakpoint) { + margin-bottom: 0; } - @media (min-width: 1019px) { - font-size: 7.5em; + @media (min-width: 1034px) { + margin-top: 0.8rem; } - @media (min-width: 1290px) { - font-size: 9.5em; - } - - @media (min-width: 1495px) { - font-size: 11em; + //fix for large screens + @media (min-width: 1650px) { + font-size: 9vw; } } - .content-container { - display: flex; - flex-direction: row; - align-items: center; - margin: 0 8em; - .gw-logo { height: 10em; width: auto; @@ -65,13 +67,18 @@ p { margin: 0 0 1.4rem; } + + .button-container > .btn-home:first-child { + margin-right: 1em; + } } @media (max-width: 1019px) { margin: 1em 0 0; } - @media (max-width: $mobile-breakpoint) { + .content-container { + @media (max-width: $mobile-max) { flex-direction: column; .gw-logo { @@ -102,6 +109,175 @@ } } } + + #home-block-2 { + .content-container { + flex-direction: row; + align-items: flex-start; + + #browse-category, + #recently-uploaded { + width: 50%; + padding: 1.5em; + display: flex; + flex-direction: column; + + .content-container { + flex-direction: row; + align-items: center; + justify-content: center; + + #categories-container, + #categories-tooltip { + padding: 2em 0.5em 0.5em 0.5em; + } + + #categories-container { + width: 70%; + text-align: center; + display: flex; + flex-direction: column; + } + + #categories-tooltip { + display: flex; + flex-direction: row; + + #arrow-left { + width: 0; + height: 0; + border-top: 1.2em solid transparent; + border-bottom: 1.2em solid transparent; + border-right: 1.2em solid $gw-hover-buff; + } + + #tooltip-box { + width: 8.5vw; + height: 16em; + display: flex; + align-items: center; + padding: 3em 1.5em; + background-color: $gw-hover-buff; + text-align: center; + color: $gw-dark-blue; + + @media (max-width: 1590px) { + width: 8em; + } + } + } + + @media (max-width: 1280px) { + margin: 0; + padding: 2em 0 1.5em 0; + + #categories-container { + padding-left: 0; + + @media (max-width: 960) { + padding-right: 0; + } + } + + #categories-tooltip { + padding-left: 1em; + padding-right: 0; + } + } + } + } + + @media (max-width: 940px) { + flex-direction: column; + + #browse-category, + #recently-uploaded { + width: 100%; + padding: 1.5em 0; + + .content-container { + margin: 0; + flex-direction: row; + + #tooltip-box { + width: 20vw; + } + + @media (max-width:445px) { + #categories-container { + .btn-categories { + padding: 0.3rem 0.3rem; + } + } + + #categories-tooltip { + padding-left: 0; + } + } + } + } + } + } + } + + #home-block-3 { + .content-container { + margin: 0; + + #collections-bg { + width: 100%; + height: 10rem; + position: absolute; + background-color: $gw-light-blue; + } + + #collections { + width: 100%; + padding: 1.5em; + margin: 0 1em; + z-index: 20; + + #featured-h2 { + width: 50%; + } + + .content-container { + padding: 2em 0; + justify-content: space-around; + + .home-collection { + display: flex; + flex-direction: column; + align-items: center; + + .circle { + width: 11em; + height: 11em; + padding: 1.5em; + display: flex; + align-items: center; + text-align: center; + border-radius: 50%; + background-color: $gw-dark-blue; + color: $gw-white; + font-weight: bold; + font-size: 1.5em; + + &:hover { + background-color: $gw-hover-buff; + text-decoration: none; + } + } + } + + .btn-coll { + width: 15rem; + margin-bottom: 2.5rem; + } + } + } + } + } } // Commenting out homepage tabs styles (will delete) diff --git a/app/assets/stylesheets/scholarspace/components/_static-page.scss b/app/assets/stylesheets/scholarspace/components/_static-page.scss index ec7d8bda..9f2943b7 100644 --- a/app/assets/stylesheets/scholarspace/components/_static-page.scss +++ b/app/assets/stylesheets/scholarspace/components/_static-page.scss @@ -3,23 +3,11 @@ .share-header-text { margin-bottom: 0; color: $gw-light-blue; - font-size: 8em; + font-size: 8vw; font-weight: bold; - @media (max-width: 1200px) { - font-size: 7em; - } - - @media (max-width: 991px) { - font-size: 5em; - } - - @media (max-width: 670px) { - font-size: 4em; - } - - @media (max-width: 535px) { - font-size: 2.7em; + @media (min-width: 1786) { + font-size: 6.5em; } } @@ -37,7 +25,7 @@ padding: 2em 1em; } - @media (max-width: $mobile-breakpoint) { + @media (max-width: $mobile-max) { flex-direction: column; .deposit-etd, @@ -51,23 +39,15 @@ .about-header-text { margin-bottom: 0; color: $gw-light-blue; - font-size: 6em; + font-size: 8vw; font-weight: bold; - @media (max-width: 1200px) { - font-size: 5em; - } - - @media (max-width: 991px) { - font-size: 4em; - } - - @media (max-width: 748px) { - font-size: 3em; + @media (min-width: $mobile-breakpoint) { + font-size: 6vw; } - @media (max-width: 535px) { - font-size: 2.7em; + @media (min-width: 1786) { + font-size: 5.8em; } } diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb new file mode 100644 index 00000000..8ba65bc8 --- /dev/null +++ b/app/views/devise/passwords/new.html.erb @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb new file mode 100644 index 00000000..0c7ffa1c --- /dev/null +++ b/app/views/devise/registrations/new.html.erb @@ -0,0 +1,31 @@ + \ No newline at end of file diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb new file mode 100644 index 00000000..3f5617e8 --- /dev/null +++ b/app/views/devise/sessions/new.html.erb @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/app/views/hyrax/base/_citations.html.erb b/app/views/hyrax/base/_citations.html.erb index 7a6e57a9..22b1c47c 100644 --- a/app/views/hyrax/base/_citations.html.erb +++ b/app/views/hyrax/base/_citations.html.erb @@ -1,6 +1,6 @@ <% if Hyrax.config.citations? %>
- <%= link_to "Citations", hyrax.citations_work_path(presenter), id: 'citations', class: 'btn-primary gw-btn' %> + <%= link_to "Citations", hyrax.citations_work_path(presenter), id: 'citations', class: 'btn-base gw-btn' %>
diff --git a/app/views/hyrax/collections/_sort_and_per_page.html.erb b/app/views/hyrax/collections/_sort_and_per_page.html.erb index 98bfaf82..f420ad62 100644 --- a/app/views/hyrax/collections/_sort_and_per_page.html.erb +++ b/app/views/hyrax/collections/_sort_and_per_page.html.erb @@ -10,7 +10,7 @@ <%= select_tag(:per_page, options_for_select(Hyrax.config.range_for_number_of_results_to_display_per_page, h(params[:per_page])), title: t('.number_of_results_to_display_per_page')) %> <% end %> <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:per_page, :sort)) %> -   +   <% end %> <% end %> diff --git a/app/views/hyrax/contact_form/new.html.erb b/app/views/hyrax/contact_form/new.html.erb index 487a99c2..931d11b0 100644 --- a/app/views/hyrax/contact_form/new.html.erb +++ b/app/views/hyrax/contact_form/new.html.erb @@ -60,7 +60,7 @@ <% else %> <%= recaptcha_v3(action: 'contact', site_key: ENV['RECAPTCHA_SITE_KEY_V3']) %> <% end %> - <%= f.submit value: t('hyrax.contact_form.button_label'), class: "btn btn-primary" %> + <%= f.submit value: t('hyrax.contact_form.button_label'), class: "btn-base gw-btn" %> <% end %>
\ No newline at end of file diff --git a/app/views/hyrax/file_sets/media_display/_default.html.erb b/app/views/hyrax/file_sets/media_display/_default.html.erb index d951cf5a..ebb7a4dd 100644 --- a/app/views/hyrax/file_sets/media_display/_default.html.erb +++ b/app/views/hyrax/file_sets/media_display/_default.html.erb @@ -6,13 +6,13 @@ hyrax.download_path(file_set, :disposition => "attachment"), id: "file_download", data: { label: file_set.id }, - class: "btn-primary gw-btn", + class: "btn-base gw-btn", target: "_new" %>

<%= link_to t('hyrax.file_set.show.downloadable_content.default_new_tab'), hyrax.download_path(file_set, :disposition => "inline"), id: "file_download", data: { label: file_set.id }, - class: "btn-primary gw-btn", + class: "btn-base gw-btn", target: "_new" %> <% if (Rails.configuration.respond_to?(:accessibility_url)) && (@presenter.respond_to?(:permanent_url)) %>

<%= link_to t('hyrax.file_set.show.downloadable_content.pdf_new_tab'), hyrax.download_path(file_set, :disposition => "inline"), target: :_blank, id: "file_open", data: { label: file_set.id }, - class: "btn-primary gw-btn" %> + class: "btn-base gw-btn" %> <% if (Rails.configuration.respond_to?(:accessibility_url)) && (@presenter.respond_to?(:permanent_url)) %>
+
+
+

Browse by Category

+
+ +
+
+
Browse theses and dissertations by GW students
+
+
+
+
+

Recently Uploaded

+
+ <%= render 'recently_uploaded', recent_documents: @recent_documents %> +
+
+
+
\ No newline at end of file diff --git a/app/views/hyrax/homepage/_home_collections.html.erb b/app/views/hyrax/homepage/_home_collections.html.erb new file mode 100644 index 00000000..a5d4c8fb --- /dev/null +++ b/app/views/hyrax/homepage/_home_collections.html.erb @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/app/views/hyrax/homepage/_home_header_block.html.erb b/app/views/hyrax/homepage/_home_header_block.html.erb index 3e20feeb..eccd9e18 100644 --- a/app/views/hyrax/homepage/_home_header_block.html.erb +++ b/app/views/hyrax/homepage/_home_header_block.html.erb @@ -8,8 +8,8 @@

The George Washington University's Institutional Repository

As the George Washington University's institutional repository, GW ScholarSpace provides free, public access, broad visibility, and long-term preservation for the research and scholarly works created by GW's faculty, staff, and students, including electronic theses and dissertations (ETDs).

diff --git a/app/views/hyrax/homepage/index.html.erb b/app/views/hyrax/homepage/index.html.erb index c852144b..53c6a2ef 100644 --- a/app/views/hyrax/homepage/index.html.erb +++ b/app/views/hyrax/homepage/index.html.erb @@ -2,4 +2,6 @@
<%= render 'home_header_block' %> + <%= render 'home_categories_featured' %> + <%= render 'home_collections' %>
diff --git a/app/views/hyrax/pages/_form.html.erb b/app/views/hyrax/pages/_form.html.erb index 7efaa257..f36225b8 100644 --- a/app/views/hyrax/pages/_form.html.erb +++ b/app/views/hyrax/pages/_form.html.erb @@ -29,7 +29,7 @@ <% end %> @@ -45,7 +45,7 @@ <% end %> @@ -61,7 +61,7 @@ <% end %> @@ -77,7 +77,7 @@ <% end %> @@ -93,7 +93,7 @@ <% end %> From 457f9ca083278117d73f4fccb5b7c8a410280cc4 Mon Sep 17 00:00:00 2001 From: Max Turer Date: Fri, 1 Mar 2024 15:52:20 +0000 Subject: [PATCH 03/15] homepage fully responsive, recent document templates fixed for usability --- .../scholarspace/components/_homepage.scss | 629 ++++++++---------- app/controllers/hyrax/homepage_controller.rb | 51 ++ .../hyrax/homepage/_home_collections.html.erb | 24 +- .../hyrax/homepage/_recent_document.html.erb | 21 +- .../homepage/_recently_uploaded.html.erb | 2 - 5 files changed, 367 insertions(+), 360 deletions(-) create mode 100644 app/controllers/hyrax/homepage_controller.rb diff --git a/app/assets/stylesheets/scholarspace/components/_homepage.scss b/app/assets/stylesheets/scholarspace/components/_homepage.scss index 070c9282..4edb0bc7 100644 --- a/app/assets/stylesheets/scholarspace/components/_homepage.scss +++ b/app/assets/stylesheets/scholarspace/components/_homepage.scss @@ -1,250 +1,347 @@ // Homepage styling .home-content { + display: flex; + flex-direction: column; + + .content-container { + display: flex; + flex-direction: row; + align-items: center; + margin: 0 1em; + } + + #home-block-1 { + margin-bottom: 1rem; display: flex; flex-direction: column; + align-items: center; .content-container { - display: flex; - flex-direction: row; - align-items: center; - margin: 0 1em; + margin: 0 8em; + + @media (max-width: 3000px) { + margin: 0; + } } - #home-block-1 { - margin-bottom: 1rem; - display: flex; - flex-direction: column; - align-items: center; + h1#home-header { + margin-top: 0; + margin-bottom: 0.5em; + color: $gw-light-blue; + font-size: 10.5vw; + font-weight: bold; + line-height: 0.8em; - .content-container { - margin: 0 8em; + @media (min-width: $mobile-breakpoint) { + margin-bottom: 0; + } - @media (max-width: 1150px) { - margin: 0; - } + @media (min-width: 1034px) { + margin-top: 0.8rem; } - h1#home-header { - margin-top: 0; - margin-bottom: 0.5em; - color: $gw-light-blue; - font-size: 10.5vw; - font-weight: bold; - line-height: 0.8em; + //fix for large screens + @media (min-width: 1650px) { + font-size: 9vw; + } + } + + .gw-logo { + height: 10em; + width: auto; + background-color: $gw-dark-blue; + margin: 0 0.5em; + padding: 1em; - @media (min-width: $mobile-breakpoint) { - margin-bottom: 0; + img { + width: auto; + height: 100%; } + } + + .intro { + margin: 0 0.5em; + padding: 1em; - @media (min-width: 1034px) { - margin-top: 0.8rem; + p { + margin: 0 0 1.4rem; } - //fix for large screens - @media (min-width: 1650px) { - font-size: 9vw; + .button-container > .btn-home:first-child { + margin-right: 1em; } } - .gw-logo { - height: 10em; - width: auto; - background-color: $gw-dark-blue; - margin: 0 0.5em; - padding: 1em; + @media (max-width: 1019px) { + margin: 1em 0 0; + } - img { - width: auto; - height: 100%; - } + .content-container { + @media (max-width: $mobile-max) { + flex-direction: column; + + .gw-logo { + margin: 0; + height: 5em; + width: 100%; + text-align: center; } .intro { - margin: 0 0.5em; + margin: 0em; padding: 1em; - p { - margin: 0 0 1.4rem; + h2 { + font-weight: 300; + font-size: 1.3em; } - .button-container > .btn-home:first-child { - margin-right: 1em; + p { + margin: 0 0 0.8rem; } } - @media (max-width: 1019px) { - margin: 1em 0 0; + .button-container > a { + width: 100%; + margin: 0.2em 0; } + } + } + } - .content-container { - @media (max-width: $mobile-max) { + #home-block-2 { + .content-container { + flex-direction: row; + align-items: flex-start; + + #browse-category, + #recently-uploaded { + width: 50%; + padding: 1.5em; + display: flex; flex-direction: column; - .gw-logo { - margin: 0; - height: 5em; - width: 100%; - text-align: center; + .content-container { + height: 21vw; + flex-direction: row; + align-items: center; + justify-content: center; + + #categories-container, + #categories-tooltip { + padding: 2em 0.5em 0.5em 0.5em; + } + + #categories-container { + width: 70%; + text-align: center; + display: flex; + flex-direction: column; + } + + #categories-tooltip { + display: flex; + flex-direction: row; + + #arrow-left { + width: 0; + height: 0; + border-top: 1.2em solid transparent; + border-bottom: 1.2em solid transparent; + border-right: 1.2em solid $gw-hover-buff; + } + + #tooltip-box { + width: 8.5vw; + height: 16em; + display: flex; + align-items: center; + padding: 3em 1.5em; + background-color: $gw-hover-buff; + text-align: center; + color: $gw-dark-blue; + + @media (max-width: 1590px) { + width: 8em; + } + } + } } - .intro { - margin: 0em; - padding: 1em; + @media (min-width: 2050px) { + height: 21vw; + } - h2 { - font-weight: 300; - font-size: 1.3em; + @media (max-width: 1280px) { + height: 27vw; + margin: 0; + + #categories-container { + padding: 0.5em 0.5em 0.5em 0; + + @media (max-width: 960px) { + padding-right: 0; + } } - p { - margin: 0 0 0.8rem; + #categories-tooltip { + padding: 0.5em 0.5em 0.5em 0; } } + - .button-container > a { - width: 100%; - margin: 0.2em 0; + @media (max-width: 3000px) { + .content-container { + padding: 0; + margin: 0; + height: 28vw; + + #categories-container { + padding: 2em 0 0.5em 0; + } + } } } - } - } - #home-block-2 { - .content-container { - flex-direction: row; - align-items: flex-start; + #recently-uploaded { + height: 100%; - #browse-category, - #recently-uploaded { - width: 50%; - padding: 1.5em; + #recent_docs { + height: 100%; display: flex; - flex-direction: column; - - .content-container { - flex-direction: row; + flex-direction: row; + justify-content: space-between; + align-items: center; + + .recent-work { + width: 12vw; + margin: 0.5em 0.5em; + display: flex; align-items: center; - justify-content: center; - #categories-container, - #categories-tooltip { - padding: 2em 0.5em 0.5em 0.5em; - } + .image-wrapper { + position: relative; - #categories-container { - width: 70%; - text-align: center; - display: flex; - flex-direction: column; - } - - #categories-tooltip { - display: flex; - flex-direction: row; - - #arrow-left { - width: 0; - height: 0; - border-top: 1.2em solid transparent; - border-bottom: 1.2em solid transparent; - border-right: 1.2em solid $gw-hover-buff; + img { + width: 100%; + height: auto; } - - #tooltip-box { - width: 8.5vw; - height: 16em; + + .recent-title { + width: 100%; + height: 40%; + position: absolute; + top: 50%; + transform: translateY(-50%); display: flex; align-items: center; - padding: 3em 1.5em; - background-color: $gw-hover-buff; - text-align: center; - color: $gw-dark-blue; + justify-content: center; + background-color: $gw-light-blue; + + h3 { + font-size: 1em; + color: $gw-white; + text-decoration: underline; - @media (max-width: 1590px) { - width: 8em; + &:hover { + color: $gw-hover-buff; } + } } } - @media (max-width: 1280px) { - margin: 0; - padding: 2em 0 1.5em 0; + @media (max-width: 1300px) { + width: 14vw; + } - #categories-container { - padding-left: 0; + @media (max-width: 940px) { + width: 26.5vw; + } + } - @media (max-width: 960) { - padding-right: 0; - } - } + @media (max-width: $mobile-max) { + flex-direction: column; - #categories-tooltip { - padding-left: 1em; - padding-right: 0; - } + .recent-work { + width: 100%; + margin: 2em 0; } } } - @media (max-width: 940px) { - flex-direction: column; + @media (max-width: 1280px) { + height: unset; + } + } - #browse-category, - #recently-uploaded { - width: 100%; - padding: 1.5em 0; + @media (max-width: 940px) { + flex-direction: column; - .content-container { - margin: 0; - flex-direction: row; + #browse-category, + #recently-uploaded { + width: 100%; + height: unset; + padding: 1.5em 0; - #tooltip-box { - width: 20vw; - } + .content-container { + height: unset; + margin: 0; + flex-direction: row; - @media (max-width:445px) { - #categories-container { - .btn-categories { - padding: 0.3rem 0.3rem; - } - } + #tooltip-box { + width: 20vw; + } - #categories-tooltip { - padding-left: 0; + @media (max-width:445px) { + #categories-container { + .btn-categories { + padding: 0.3rem 0.3rem; } } + + #categories-tooltip { + padding-left: 0; + } } } } } } + } - #home-block-3 { - .content-container { - margin: 0; + #home-block-3 { + .content-container { + margin: 0; - #collections-bg { - width: 100%; - height: 10rem; - position: absolute; - background-color: $gw-light-blue; + #collections-bg { + width: 100%; + height: 10rem; + position: absolute; + background-color: $gw-light-blue; + } + + #collections { + width: 100%; + padding: 1.5em; + margin: 0 1em; + z-index: 20; + + #featured-h2 { + width: 50%; } - - #collections { - width: 100%; - padding: 1.5em; - margin: 0 1em; - z-index: 20; - - #featured-h2 { - width: 50%; - } - - .content-container { - padding: 2em 0; + + .content-container { + flex-direction: row; + padding: 2em 0; + justify-content: space-around; + + .home-collections { + width: 70vw; + display: flex; + flex-direction: row; justify-content: space-around; - + .home-collection { display: flex; flex-direction: column; @@ -253,6 +350,7 @@ .circle { width: 11em; height: 11em; + margin: 1em; padding: 1.5em; display: flex; align-items: center; @@ -265,188 +363,41 @@ &:hover { background-color: $gw-hover-buff; + color: $gw-dark-blue; text-decoration: none; } } } + } + + .btn-coll { + width: 15rem; + margin-bottom: 2.5rem; + } + + @media (max-width: 1280px) { + flex-direction: column; - .btn-coll { - width: 15rem; - margin-bottom: 2.5rem; + #featured-h2 { + width: 100%; + } + + .home-collections { + margin-bottom: 1em; } } + + @media (max-width: 940px) { + .home-collections { + flex-direction: column; + } + } + } + + @media (max-width: 1280px) { + padding: 1.5em 0; } } } - } - - // Commenting out homepage tabs styles (will delete) - // .tabs-container { - // background-color: $gw-dark-blue; - // border-radius: 5px; - // padding: 0.5em; - - // li a { - // background-color: transparent; - // color: $gw-light-blue; - // text-decoration: underline; - - // &:hover { - // color: $gw-hover-orange; - // } - // } - - // #homeTabs { - // li { - // width: 50%; - // margin-left: 0; - - // a { - // color: $gw-white; - // background-color: $gw-light-blue; - // text-decoration: none; - // border-bottom-left-radius: 0; - // border-bottom-right-radius: 0; - // text-align: center; - - // &:hover, &:focus { - // background-color: $gw-light-blue; - // } - // } - - // @media (min-width: $mobile-breakpoint) { - // width: fit-content; - // } - // } - - // li.active a { - // color: $gw-dark-grey; - // background-color: $gw-white; - // } - // } - - // .tab-content { - // overflow: hidden; - // border-top-right-radius: 0; - // border-bottom-left-radius: 5px; - // border-bottom-right-radius: 5px; - // margin-bottom: 0 !important; - - // #featured_container, #recently_uploaded { - // background-color: $gw-white; - // padding: 0; - - // h3 { - // margin-bottom: 0; - // } - - // p { - // margin: 0; - // padding: 0.5em; - // } - - // #recent_docs, #featured_works { - // list-style-type: none; - // margin-bottom: 0; - - // .recent-item, .featured-item { - // border-top: none; - // padding: 1em; - - // .recent-label, .featured-label { - // font-weight: 400; - // } - // } - - // li:nth-child(even) { - // background-color: $gw-light-grey; - // } - // } - - // #featured_works .dd-item { - // padding: 0; - // } - - // .table { - // margin-bottom: 0; - // } - // } - - // @media (min-width: $mobile-breakpoint) { - // border-top-right-radius: 5px; - // } - // } - // } - - // .dd-placeholder { - // margin-top: 0; - // margin-bottom: 0.5rem; - // } - - // .dd-dragel li, .dd-item { - // display: flex; - // flex-direction: row; - // padding: 0; - // margin-bottom: 0.5rem; - - // .dd-handle { - // position: inherit; - // background: $gw-light-blue; - // border: none; - // border-radius: 0; - // height: auto; - // } - - // .panel { - // margin: 0; - // background: $gw-white; - // border: 1px solid $gw-dark-grey; - // border-left: none; - // border-radius: 0; - // height: auto; - // width: 100%; - // max-width: 100%; - // font-size: 1rem; - - // h3 { - // margin-bottom: 0; - // } - - // a { - // font-size: 1rem; - // text-decoration: underline; - // } - // } - // } - - // #new_featured_work_list .btn { - // width: 100%; - // max-width: 100%; - // border: none; - // border-radius: 0; - // background-color: $gw-light-blue; - // color: $gw-white; - - // &:hover { - // background-color: $gw-hover-buff; - // color: $gw-dark-blue; - // } - // } - - // #publication-content { - // h2 { - // display: flex; - // align-items: center; - // } - - // img.featured { - // margin: 0px 10px 10px 0px; - // } - // } - - // //misc bootstrap overwrite - // .nav-pills li.active a, .nav-pills li.active a:hover, .nav-pills li.active a:focus { - // color: $gw-dark-grey; - // background-color: $gw-white; - // } - \ No newline at end of file + } +} \ No newline at end of file diff --git a/app/controllers/hyrax/homepage_controller.rb b/app/controllers/hyrax/homepage_controller.rb new file mode 100644 index 00000000..d34cc20d --- /dev/null +++ b/app/controllers/hyrax/homepage_controller.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +class Hyrax::HomepageController < ApplicationController + # Adds Hydra behaviors into the application controller + include Blacklight::SearchContext + include Blacklight::SearchHelper + include Blacklight::AccessControls::Catalog + + class_attribute :presenter_class + self.presenter_class = Hyrax::HomepagePresenter + layout 'homepage' + helper Hyrax::ContentBlockHelper + + def index + @presenter = presenter_class.new(current_ability, collections) + @featured_researcher = ContentBlock.for(:researcher) + @marketing_text = ContentBlock.for(:marketing) + @featured_work_list = FeaturedWorkList.new + @announcement_text = ContentBlock.for(:announcement) + recent + end + + private + + # Return 5 collections + def collections(rows: 5) + Hyrax::CollectionsService.new(self).search_results do |builder| + builder.rows(rows) + end + rescue Blacklight::Exceptions::ECONNREFUSED, Blacklight::Exceptions::InvalidRequest + [] + end + + def recent + # grab any recent documents + (_, @recent_documents) = search_service.search_results do |builder| + builder.rows(3) + builder.merge(sort: sort_field) + end + rescue Blacklight::Exceptions::ECONNREFUSED, Blacklight::Exceptions::InvalidRequest + @recent_documents = [] + end + + def search_service + Hyrax::SearchService.new(config: blacklight_config, user_params: { q: '' }, scope: self, search_builder_class: Hyrax::HomepageSearchBuilder) + end + + def sort_field + "date_uploaded_dtsi desc" + end + end + \ No newline at end of file diff --git a/app/views/hyrax/homepage/_home_collections.html.erb b/app/views/hyrax/homepage/_home_collections.html.erb index a5d4c8fb..4ddb8214 100644 --- a/app/views/hyrax/homepage/_home_collections.html.erb +++ b/app/views/hyrax/homepage/_home_collections.html.erb @@ -4,17 +4,19 @@
- - - diff --git a/app/views/hyrax/homepage/_recent_document.html.erb b/app/views/hyrax/homepage/_recent_document.html.erb index bd487a6f..a3cff852 100644 --- a/app/views/hyrax/homepage/_recent_document.html.erb +++ b/app/views/hyrax/homepage/_recent_document.html.erb @@ -1,15 +1,20 @@ -
  • -
    -
    +
    +
    <%= t('hyrax.homepage.recently_uploaded.document.title_label') %> -

    +
    <%= link_to [main_app, recent_document] do %> - <%= render_thumbnail_tag(recent_document, {width: 90, alt:"Preview of #{recent_document.title[0]}"}, {suppress_link: true}) + recent_document.to_s %> +
    + <%= render_thumbnail_tag(recent_document, {alt: "#{recent_document} #{ t('hyrax.homepage.admin_sets.thumbnail')}" }, {suppress_link: true}) %> +
    +
    +

    + <%= recent_document %> +

    +
    <% end %> -

    +

    <%= t('hyrax.homepage.recently_uploaded.document.keyword_label') %>: <%= link_to_facet_list(recent_document.keyword, 'keyword', t('hyrax.homepage.recently_uploaded.document.keyword_missing')).html_safe %>

    -
    -
  • +
    diff --git a/app/views/hyrax/homepage/_recently_uploaded.html.erb b/app/views/hyrax/homepage/_recently_uploaded.html.erb index 8479e700..dfcb8723 100644 --- a/app/views/hyrax/homepage/_recently_uploaded.html.erb +++ b/app/views/hyrax/homepage/_recently_uploaded.html.erb @@ -3,8 +3,6 @@

    <%= t('.no_public') %>

    <% else %>
    - <%= render partial: "recent_document", collection: recent_documents %> -
    <% end %> From 19209eafc12c0494d4c27f1a417cdab43411d95c Mon Sep 17 00:00:00 2001 From: Max Turer Date: Fri, 1 Mar 2024 18:27:18 +0000 Subject: [PATCH 04/15] collections results simplified temporarily and homepage JS incorporated --- app/assets/javascripts/tooltip.js | 41 ++++++++++++ .../scholarspace/components/_collection.scss | 2 +- .../scholarspace/components/_homepage.scss | 63 +++++++++++-------- .../scholarspace/components/_search.scss | 7 +++ .../hyrax/collections/_search_form.html.erb | 2 +- .../_home_categories_featured.html.erb | 12 ++-- 6 files changed, 92 insertions(+), 35 deletions(-) create mode 100644 app/assets/javascripts/tooltip.js diff --git a/app/assets/javascripts/tooltip.js b/app/assets/javascripts/tooltip.js new file mode 100644 index 00000000..14359696 --- /dev/null +++ b/app/assets/javascripts/tooltip.js @@ -0,0 +1,41 @@ +if (window.location.href.replaceAll(window.location.origin, '').replaceAll('/','').length === 0 || +window.location.href.replaceAll(window.location.origin, '').replaceAll('/','') == '?locale=en') { + + window.onload = init; + function init() { + arrow = document.getElementById('arrow-left'); + text = document.getElementById('tooltip-box'); + + etds = document.getElementById('etds'); + journals = document.getElementById('journals'); + articles = document.getElementById('articles'); + posters = document.getElementById('posters'); + presentations = document.getElementById('presentations'); + materials = document.getElementById('materials'); + + etds.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '0'; + text.innerHTML = 'Browse theses and dissertations by GW students'; + }); + journals.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '2.7em'; + text.innerHTML = 'Browse journals published by GW student organizations and other GW-affiliated organizations'; + }); + articles.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '5.5em'; + text.innerHTML = 'Browse individual articles authored by GW faculty, staff, students, and published by GW-affiliated orgnaizations'; + }); + posters.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '8.2em'; + text.innerHTML = 'Browse posters created by GW faculty, staff, and students for various research purposes'; + }); + presentations.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '10.9em'; + text.innerHTML = 'Browse presentations given by GW faculty, staff, and students for conferences and other meetings'; + }); + materials.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '13.6em'; + text.innerHTML = 'Browse digitized and born-digital content from the specialized collections of GW Libraries & Academic Innovation'; + }); + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/scholarspace/components/_collection.scss b/app/assets/stylesheets/scholarspace/components/_collection.scss index 082ab98b..d0ea5951 100755 --- a/app/assets/stylesheets/scholarspace/components/_collection.scss +++ b/app/assets/stylesheets/scholarspace/components/_collection.scss @@ -49,7 +49,7 @@ width: 100%; border-radius: 0; padding: 0.4rem; - margin-left: 0; + margin-left: 0.3rem; .glyphicon-search::before { font-size: 1rem; diff --git a/app/assets/stylesheets/scholarspace/components/_homepage.scss b/app/assets/stylesheets/scholarspace/components/_homepage.scss index 4edb0bc7..5306d01e 100644 --- a/app/assets/stylesheets/scholarspace/components/_homepage.scss +++ b/app/assets/stylesheets/scholarspace/components/_homepage.scss @@ -21,7 +21,7 @@ margin: 0 8em; @media (max-width: 3000px) { - margin: 0; + margin: 0 1.5em; } } @@ -43,7 +43,7 @@ //fix for large screens @media (min-width: 1650px) { - font-size: 9vw; + font-size: 10vw; } } @@ -147,13 +147,14 @@ #arrow-left { width: 0; height: 0; + margin-top: 0; border-top: 1.2em solid transparent; border-bottom: 1.2em solid transparent; border-right: 1.2em solid $gw-hover-buff; } #tooltip-box { - width: 8.5vw; + width: 9em; height: 16em; display: flex; align-items: center; @@ -163,7 +164,7 @@ color: $gw-dark-blue; @media (max-width: 1590px) { - width: 8em; + width: 9em; } } } @@ -172,33 +173,25 @@ @media (min-width: 2050px) { height: 21vw; } + + @media (max-width: 3000px) { + .content-container { + padding: 0; + margin: 0; - @media (max-width: 1280px) { - height: 27vw; - margin: 0; - - #categories-container { - padding: 0.5em 0.5em 0.5em 0; - - @media (max-width: 960px) { - padding-right: 0; + #categories-container, #categories-tooltip { + padding: 0 0.5em 0.5em 0; } } - - #categories-tooltip { - padding: 0.5em 0.5em 0.5em 0; - } } - - @media (max-width: 3000px) { + @media (max-width: 1300px) { .content-container { - padding: 0; + height: 19em; margin: 0; - height: 28vw; - #categories-container { - padding: 2em 0 0.5em 0; + #categories-container, #categories-tooltip { + padding: 0 0 0 0.5em } } } @@ -222,10 +215,26 @@ .image-wrapper { position: relative; + overflow: hidden; - img { - width: 100%; - height: auto; + a { + color: $gw-white; + img { + transition: transform .5s; + } + + &:hover { + color: $gw-hover-buff; + + img { + transform: scale(1.3); + } + } + + img { + width: 100%; + height: auto; + } } .recent-title { @@ -241,7 +250,6 @@ h3 { font-size: 1em; - color: $gw-white; text-decoration: underline; &:hover { @@ -360,6 +368,7 @@ color: $gw-white; font-weight: bold; font-size: 1.5em; + transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out; &:hover { background-color: $gw-hover-buff; diff --git a/app/assets/stylesheets/scholarspace/components/_search.scss b/app/assets/stylesheets/scholarspace/components/_search.scss index c9c039e7..aa82da8c 100644 --- a/app/assets/stylesheets/scholarspace/components/_search.scss +++ b/app/assets/stylesheets/scholarspace/components/_search.scss @@ -148,6 +148,13 @@ li.document { padding: 1em; + + &.blacklight-collection { + .col-md-2, + .col-md-10, + .collection-counts-wrapper { + display: none; + } &:nth-child(odd) { background-color: $gw-light-grey; diff --git a/app/views/hyrax/collections/_search_form.html.erb b/app/views/hyrax/collections/_search_form.html.erb index 68d4f4b9..6a764ece 100644 --- a/app/views/hyrax/collections/_search_form.html.erb +++ b/app/views/hyrax/collections/_search_form.html.erb @@ -3,7 +3,7 @@
    <%= text_field_tag :cq, params[:cq], class: "collection-query form-control", placeholder: t('hyrax.collections.search_form.placeholder'), size: '30', type: "search", id: "collection_search" %>
    -
    diff --git a/app/views/hyrax/homepage/_home_categories_featured.html.erb b/app/views/hyrax/homepage/_home_categories_featured.html.erb index f26db246..5472b51d 100644 --- a/app/views/hyrax/homepage/_home_categories_featured.html.erb +++ b/app/views/hyrax/homepage/_home_categories_featured.html.erb @@ -4,12 +4,12 @@

    Browse by Category

    From 687b52a5da6a9f5f3f33ba4c871f77e7ea4f1e7f Mon Sep 17 00:00:00 2001 From: Max Turer Date: Fri, 1 Mar 2024 19:01:37 +0000 Subject: [PATCH 05/15] missing bracket no longer missing --- app/assets/stylesheets/scholarspace/components/_search.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scholarspace/components/_search.scss b/app/assets/stylesheets/scholarspace/components/_search.scss index aa82da8c..1498278e 100644 --- a/app/assets/stylesheets/scholarspace/components/_search.scss +++ b/app/assets/stylesheets/scholarspace/components/_search.scss @@ -282,4 +282,5 @@ margin: 0 0.3em; } } - } \ No newline at end of file + } +} \ No newline at end of file From 205b9cc8a1a788360873a20c8ecea1cb6be5a32a Mon Sep 17 00:00:00 2001 From: Max Turer Date: Mon, 4 Mar 2024 17:10:46 +0000 Subject: [PATCH 06/15] fixed search style syntax --- app/assets/stylesheets/scholarspace/components/_search.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/scholarspace/components/_search.scss b/app/assets/stylesheets/scholarspace/components/_search.scss index 1498278e..caaee5d6 100644 --- a/app/assets/stylesheets/scholarspace/components/_search.scss +++ b/app/assets/stylesheets/scholarspace/components/_search.scss @@ -155,6 +155,7 @@ .collection-counts-wrapper { display: none; } + } &:nth-child(odd) { background-color: $gw-light-grey; @@ -282,5 +283,4 @@ margin: 0 0.3em; } } - } -} \ No newline at end of file + } \ No newline at end of file From 97a794ad0c373aca28967262a4621b1deb88e39a Mon Sep 17 00:00:00 2001 From: Max Turer Date: Mon, 4 Mar 2024 17:34:21 +0000 Subject: [PATCH 07/15] responsiveness update to about page header text --- .../stylesheets/scholarspace/components/_static-page.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/scholarspace/components/_static-page.scss b/app/assets/stylesheets/scholarspace/components/_static-page.scss index 9f2943b7..e6a3b12f 100644 --- a/app/assets/stylesheets/scholarspace/components/_static-page.scss +++ b/app/assets/stylesheets/scholarspace/components/_static-page.scss @@ -43,10 +43,10 @@ font-weight: bold; @media (min-width: $mobile-breakpoint) { - font-size: 6vw; + font-size: 5.7vw; } - @media (min-width: 1786) { + @media (min-width: 1666) { font-size: 5.8em; } } From c090645edef64736bf77f597e210f2a4a0c45a7d Mon Sep 17 00:00:00 2001 From: Max Turer Date: Mon, 4 Mar 2024 17:48:35 +0000 Subject: [PATCH 08/15] replaced overwritten homepage controller with decorator --- app/controllers/hyrax/homepage_controller.rb | 51 ------------------- .../hyrax/homepage_controller_decorator.rb | 17 +++++++ 2 files changed, 17 insertions(+), 51 deletions(-) delete mode 100644 app/controllers/hyrax/homepage_controller.rb create mode 100644 app/controllers/hyrax/homepage_controller_decorator.rb diff --git a/app/controllers/hyrax/homepage_controller.rb b/app/controllers/hyrax/homepage_controller.rb deleted file mode 100644 index d34cc20d..00000000 --- a/app/controllers/hyrax/homepage_controller.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true -class Hyrax::HomepageController < ApplicationController - # Adds Hydra behaviors into the application controller - include Blacklight::SearchContext - include Blacklight::SearchHelper - include Blacklight::AccessControls::Catalog - - class_attribute :presenter_class - self.presenter_class = Hyrax::HomepagePresenter - layout 'homepage' - helper Hyrax::ContentBlockHelper - - def index - @presenter = presenter_class.new(current_ability, collections) - @featured_researcher = ContentBlock.for(:researcher) - @marketing_text = ContentBlock.for(:marketing) - @featured_work_list = FeaturedWorkList.new - @announcement_text = ContentBlock.for(:announcement) - recent - end - - private - - # Return 5 collections - def collections(rows: 5) - Hyrax::CollectionsService.new(self).search_results do |builder| - builder.rows(rows) - end - rescue Blacklight::Exceptions::ECONNREFUSED, Blacklight::Exceptions::InvalidRequest - [] - end - - def recent - # grab any recent documents - (_, @recent_documents) = search_service.search_results do |builder| - builder.rows(3) - builder.merge(sort: sort_field) - end - rescue Blacklight::Exceptions::ECONNREFUSED, Blacklight::Exceptions::InvalidRequest - @recent_documents = [] - end - - def search_service - Hyrax::SearchService.new(config: blacklight_config, user_params: { q: '' }, scope: self, search_builder_class: Hyrax::HomepageSearchBuilder) - end - - def sort_field - "date_uploaded_dtsi desc" - end - end - \ No newline at end of file diff --git a/app/controllers/hyrax/homepage_controller_decorator.rb b/app/controllers/hyrax/homepage_controller_decorator.rb new file mode 100644 index 00000000..30ee063c --- /dev/null +++ b/app/controllers/hyrax/homepage_controller_decorator.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# OVERRIDE Hyrax v3.6.0 to display 3 rather than 4 recent uploads +module Hyrax + module HomepageControllerDecorator + def recent + # grab any recent documents + (_, @recent_documents) = search_service.search_results do |builder| + builder.rows(3) + builder.merge(sort: sort_field) + end + rescue Blacklight::Exceptions::ECONNREFUSED, Blacklight::Exceptions::InvalidRequest + @recent_documents = [] + end + end +end + +Hyrax::HomepageController.prepend Hyrax::HomepageControllerDecorator \ No newline at end of file From 440ca048ddbb416d1fa4f0e34e643d5db0ce5814 Mon Sep 17 00:00:00 2001 From: Max Turer Date: Mon, 4 Mar 2024 19:42:17 +0000 Subject: [PATCH 09/15] js loads on return to page --- app/assets/javascripts/tooltip.js | 41 ------------------- .../_home_categories_featured.html.erb | 39 +++++++++++++++++- 2 files changed, 38 insertions(+), 42 deletions(-) delete mode 100644 app/assets/javascripts/tooltip.js diff --git a/app/assets/javascripts/tooltip.js b/app/assets/javascripts/tooltip.js deleted file mode 100644 index 14359696..00000000 --- a/app/assets/javascripts/tooltip.js +++ /dev/null @@ -1,41 +0,0 @@ -if (window.location.href.replaceAll(window.location.origin, '').replaceAll('/','').length === 0 || -window.location.href.replaceAll(window.location.origin, '').replaceAll('/','') == '?locale=en') { - - window.onload = init; - function init() { - arrow = document.getElementById('arrow-left'); - text = document.getElementById('tooltip-box'); - - etds = document.getElementById('etds'); - journals = document.getElementById('journals'); - articles = document.getElementById('articles'); - posters = document.getElementById('posters'); - presentations = document.getElementById('presentations'); - materials = document.getElementById('materials'); - - etds.addEventListener("mouseover", (event) => { - arrow.style.marginTop = '0'; - text.innerHTML = 'Browse theses and dissertations by GW students'; - }); - journals.addEventListener("mouseover", (event) => { - arrow.style.marginTop = '2.7em'; - text.innerHTML = 'Browse journals published by GW student organizations and other GW-affiliated organizations'; - }); - articles.addEventListener("mouseover", (event) => { - arrow.style.marginTop = '5.5em'; - text.innerHTML = 'Browse individual articles authored by GW faculty, staff, students, and published by GW-affiliated orgnaizations'; - }); - posters.addEventListener("mouseover", (event) => { - arrow.style.marginTop = '8.2em'; - text.innerHTML = 'Browse posters created by GW faculty, staff, and students for various research purposes'; - }); - presentations.addEventListener("mouseover", (event) => { - arrow.style.marginTop = '10.9em'; - text.innerHTML = 'Browse presentations given by GW faculty, staff, and students for conferences and other meetings'; - }); - materials.addEventListener("mouseover", (event) => { - arrow.style.marginTop = '13.6em'; - text.innerHTML = 'Browse digitized and born-digital content from the specialized collections of GW Libraries & Academic Innovation'; - }); - } -} \ No newline at end of file diff --git a/app/views/hyrax/homepage/_home_categories_featured.html.erb b/app/views/hyrax/homepage/_home_categories_featured.html.erb index 5472b51d..6c515810 100644 --- a/app/views/hyrax/homepage/_home_categories_featured.html.erb +++ b/app/views/hyrax/homepage/_home_categories_featured.html.erb @@ -24,4 +24,41 @@
    -
    \ No newline at end of file + + +<%= javascript_tag do %> + arrow = document.getElementById('arrow-left'); + text = document.getElementById('tooltip-box'); + + etds = document.getElementById('etds'); + journals = document.getElementById('journals'); + articles = document.getElementById('articles'); + posters = document.getElementById('posters'); + presentations = document.getElementById('presentations'); + materials = document.getElementById('materials'); + + etds.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '0'; + text.innerHTML = 'Browse theses and dissertations by GW students'; + }); + journals.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '2.7em'; + text.innerHTML = 'Browse journals published by GW student organizations and other GW-affiliated organizations'; + }); + articles.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '5.5em'; + text.innerHTML = 'Browse individual articles authored by GW faculty, staff, students, and published by GW-affiliated orgnaizations'; + }); + posters.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '8.2em'; + text.innerHTML = 'Browse posters created by GW faculty, staff, and students for various research purposes'; + }); + presentations.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '10.9em'; + text.innerHTML = 'Browse presentations given by GW faculty, staff, and students for conferences and other meetings'; + }); + materials.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '13.6em'; + text.innerHTML = 'Browse digitized and born-digital content from the specialized collections of GW Libraries & Academic Innovation'; + }); +<% end %> \ No newline at end of file From 38673c7d8d1cecbe368e204157c7bcc7fc24931d Mon Sep 17 00:00:00 2001 From: Max Turer Date: Mon, 4 Mar 2024 20:28:26 +0000 Subject: [PATCH 10/15] spec content block HTML edit --- spec/fixtures/content_blocks/share_page.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/fixtures/content_blocks/share_page.html b/spec/fixtures/content_blocks/share_page.html index 0c798318..9e6dcd64 100644 --- a/spec/fixtures/content_blocks/share_page.html +++ b/spec/fixtures/content_blocks/share_page.html @@ -9,7 +9,7 @@

    Share Your Work

    Deposit an Electronic Thesis or Dissertation

    To deposit your ETD, please start by visiting:

    -

    The Library's ETD Page

    +

    The Office of Graduate and Postdoctoral Affairs' ETD Page

    The University uses the ProQuest ETD Administrator to facilitate the submission/approval process of GW electronic theses and dissertations. By submitting to the ProQuest ETD Administrator, the final and approved version of your thesis or dissertation will be deposited to ProQuest's Dissertation and Theses Online Database and the University's institutional repository, GW ScholarSpace.

    @@ -17,7 +17,7 @@

    Deposit an Electronic Thesis or Dissertation

    Deposit any other scholarship or research

    To deposit any other type of work, please use:

    -

    The GW ScholarSpace Deposit Form

    +

    The GW ScholarSpace Deposit Form

    From 78bf651ca7b09e0f967795dd7193bd8a0a1db916 Mon Sep 17 00:00:00 2001 From: Max Turer Date: Mon, 4 Mar 2024 20:30:02 +0000 Subject: [PATCH 11/15] acronym replacement at Dan's sugestion --- spec/fixtures/content_blocks/share_page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/fixtures/content_blocks/share_page.html b/spec/fixtures/content_blocks/share_page.html index 9e6dcd64..ec278aa9 100644 --- a/spec/fixtures/content_blocks/share_page.html +++ b/spec/fixtures/content_blocks/share_page.html @@ -8,7 +8,7 @@

    Share Your Work

    Deposit an Electronic Thesis or Dissertation

    -

    To deposit your ETD, please start by visiting:

    +

    To deposit your Electronic Thesis or Dissertation, please start by visiting:

    The Office of Graduate and Postdoctoral Affairs' ETD Page

    The University uses the ProQuest ETD Administrator to facilitate the submission/approval process of GW electronic theses and dissertations. By submitting to the ProQuest ETD Administrator, the final and approved version of your thesis or dissertation will be deposited to ProQuest's Dissertation and Theses Online Database and the University's institutional repository, GW ScholarSpace.

    From b110adb1e760289ed748dc617f55652051ade49b Mon Sep 17 00:00:00 2001 From: Max Turer Date: Mon, 4 Mar 2024 20:31:20 +0000 Subject: [PATCH 12/15] acronym replacement at Dan's sugestion --- spec/fixtures/content_blocks/share_page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/fixtures/content_blocks/share_page.html b/spec/fixtures/content_blocks/share_page.html index ec278aa9..35c146c9 100644 --- a/spec/fixtures/content_blocks/share_page.html +++ b/spec/fixtures/content_blocks/share_page.html @@ -8,7 +8,7 @@

    Share Your Work

    Deposit an Electronic Thesis or Dissertation

    -

    To deposit your Electronic Thesis or Dissertation, please start by visiting:

    +

    To deposit your Electronic Thesis or Dissertation (ETD), please start by visiting:

    The Office of Graduate and Postdoctoral Affairs' ETD Page

    The University uses the ProQuest ETD Administrator to facilitate the submission/approval process of GW electronic theses and dissertations. By submitting to the ProQuest ETD Administrator, the final and approved version of your thesis or dissertation will be deposited to ProQuest's Dissertation and Theses Online Database and the University's institutional repository, GW ScholarSpace.

    From 1b4e8eb0ee28db8eaa4b61c07120753d941f4ee9 Mon Sep 17 00:00:00 2001 From: Max Turer Date: Mon, 4 Mar 2024 21:24:15 +0000 Subject: [PATCH 13/15] typos and style edits --- .../scholarspace/components/_homepage.scss | 50 +++++++++++++++++-- spec/fixtures/content_blocks/about_page.html | 2 +- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/scholarspace/components/_homepage.scss b/app/assets/stylesheets/scholarspace/components/_homepage.scss index 5306d01e..617067a3 100644 --- a/app/assets/stylesheets/scholarspace/components/_homepage.scss +++ b/app/assets/stylesheets/scholarspace/components/_homepage.scss @@ -211,11 +211,22 @@ width: 12vw; margin: 0.5em 0.5em; display: flex; - align-items: center; + align-items: baseline; + height: 18.5vw; .image-wrapper { position: relative; overflow: hidden; + height: 15.5vw; + width: 12vw; + + .recent-thumbnail { + height: 100%; + display: flex; + width: auto; + background-color: $gw-white; + justify-content: center; + } a { color: $gw-white; @@ -238,8 +249,8 @@ } .recent-title { - width: 100%; - height: 40%; + width: calc(100% + 1px); + height: 50%; position: absolute; top: 50%; transform: translateY(-50%); @@ -261,10 +272,34 @@ @media (max-width: 1300px) { width: 14vw; + + .image-wrapper { + position: relative; + overflow: hidden; + height: 18.1vw; + width: 14vw; + + .recent-title { + height: 60%; + } + } + } @media (max-width: 940px) { width: 26.5vw; + height: 100%; + + .image-wrapper { + position: relative; + overflow: hidden; + height: 35vw; + width: 26.5vw; + + .recent-title { + height: 50%; + } + } } } @@ -274,6 +309,15 @@ .recent-work { width: 100%; margin: 2em 0; + + .image-wrapper { + height: 90.5vw; + width: 70vw; + + .recent-title { + height: 40%; + } + } } } } diff --git a/spec/fixtures/content_blocks/about_page.html b/spec/fixtures/content_blocks/about_page.html index 2253e66e..3ea0358f 100644 --- a/spec/fixtures/content_blocks/about_page.html +++ b/spec/fixtures/content_blocks/about_page.html @@ -18,7 +18,7 @@

    What belongs in GW ScholarSpace?

    Appropriate types of works that may be submitted to GW ScholarSpace include, but are not limited to:

    • Scholarly publications (research & journal articles, books, book reviews, and book chapters)
    • -
    • Electronic theses and dissertations (ETDS)
    • +
    • Electronic theses and dissertations (ETDs)
    • Student work (including capstone projects and honors theses)
    • Conference papers and poster presentations
    • Articles, blog posts, and other non-peer reviewed writing
    • From d67a7a20951589461812ad9079889293898aa0af Mon Sep 17 00:00:00 2001 From: Max Turer Date: Thu, 7 Mar 2024 19:19:20 +0000 Subject: [PATCH 14/15] text line limits and centering in recent documents --- .../scholarspace/components/_homepage.scss | 57 +++++++++++++++---- .../hyrax/homepage/_recent_document.html.erb | 16 ++++-- 2 files changed, 56 insertions(+), 17 deletions(-) diff --git a/app/assets/stylesheets/scholarspace/components/_homepage.scss b/app/assets/stylesheets/scholarspace/components/_homepage.scss index 617067a3..98b240b5 100644 --- a/app/assets/stylesheets/scholarspace/components/_homepage.scss +++ b/app/assets/stylesheets/scholarspace/components/_homepage.scss @@ -201,18 +201,18 @@ height: 100%; #recent_docs { - height: 100%; display: flex; flex-direction: row; justify-content: space-between; - align-items: center; + align-items: baseline; + padding-top: 0.5em; .recent-work { width: 12vw; margin: 0.5em 0.5em; display: flex; align-items: baseline; - height: 18.5vw; + min-height: 18.5vw; .image-wrapper { position: relative; @@ -258,18 +258,49 @@ align-items: center; justify-content: center; background-color: $gw-light-blue; - - h3 { - font-size: 1em; - text-decoration: underline; - &:hover { - color: $gw-hover-buff; + .title-wrapper { + -webkit-box-orient: vertical; + display: -webkit-box; + -webkit-line-clamp: 4; + padding: 0 1em; + overflow: hidden; + max-width: 100%; + text-align: center; + + h3 { + font-size: 1em; + text-decoration: underline; + --max-lines: 4; + --line-height: 1.2; + max-height: calc(var(--max-lines) * 1em * var(--line-height)); + line-height: var(--line-height); + position: relative; + + &:hover { + color: $gw-hover-buff; + } } } } } + .keyword-wrapper { + -webkit-box-orient: vertical; + display: -webkit-box; + -webkit-line-clamp: 2; + overflow: hidden; + max-width: 100%; + + .recent-field { + --max-lines: 2; + --line-height: 1.4; + height: calc(var(--max-lines) * 1em * var(--line-height)); + line-height: var(--line-height); + position: relative; + } + } + @media (max-width: 1300px) { width: 14vw; @@ -305,10 +336,14 @@ @media (max-width: $mobile-max) { flex-direction: column; + width: 80%; + align-items: center; .recent-work { - width: 100%; margin: 2em 0; + display: flex; + flex-direction: column; + align-items: center; .image-wrapper { height: 90.5vw; @@ -453,4 +488,4 @@ } } } -} \ No newline at end of file +} diff --git a/app/views/hyrax/homepage/_recent_document.html.erb b/app/views/hyrax/homepage/_recent_document.html.erb index a3cff852..24dae681 100644 --- a/app/views/hyrax/homepage/_recent_document.html.erb +++ b/app/views/hyrax/homepage/_recent_document.html.erb @@ -7,14 +7,18 @@ <%= render_thumbnail_tag(recent_document, {alt: "#{recent_document} #{ t('hyrax.homepage.admin_sets.thumbnail')}" }, {suppress_link: true}) %>
    -

    - <%= recent_document %> -

    +
    +

    + <%= recent_document %> +

    +
    <% end %>
    -

    - <%= t('hyrax.homepage.recently_uploaded.document.keyword_label') %>: <%= link_to_facet_list(recent_document.keyword, 'keyword', t('hyrax.homepage.recently_uploaded.document.keyword_missing')).html_safe %> -

    +
    +

    + <%= t('hyrax.homepage.recently_uploaded.document.keyword_label') %>: <%= link_to_facet_list(recent_document.keyword, 'keyword', t('hyrax.homepage.recently_uploaded.document.keyword_missing')).html_safe %> +

    +
    From b78d5cac8b0a596430365526675390d53a07cf35 Mon Sep 17 00:00:00 2001 From: Max Turer Date: Thu, 7 Mar 2024 19:30:36 +0000 Subject: [PATCH 15/15] slight padding and width edits to homepage blocks --- app/assets/stylesheets/scholarspace/base/_base.scss | 2 +- .../stylesheets/scholarspace/components/_homepage.scss | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/scholarspace/base/_base.scss b/app/assets/stylesheets/scholarspace/base/_base.scss index c14b4701..9a74f3f1 100644 --- a/app/assets/stylesheets/scholarspace/base/_base.scss +++ b/app/assets/stylesheets/scholarspace/base/_base.scss @@ -158,7 +158,7 @@ html { &.btn-categories { width: 100%; margin: 0.2em 0; - padding: 0.3rem 2rem; + padding: 0.3rem 1rem; border: 2px solid $gw-white; background-color: $gw-white; color: $gw-dark-blue; diff --git a/app/assets/stylesheets/scholarspace/components/_homepage.scss b/app/assets/stylesheets/scholarspace/components/_homepage.scss index 98b240b5..161298d1 100644 --- a/app/assets/stylesheets/scholarspace/components/_homepage.scss +++ b/app/assets/stylesheets/scholarspace/components/_homepage.scss @@ -191,7 +191,7 @@ margin: 0; #categories-container, #categories-tooltip { - padding: 0 0 0 0.5em + padding: 1em 0 0 0.5em; } } } @@ -466,10 +466,6 @@ @media (max-width: 1280px) { flex-direction: column; - #featured-h2 { - width: 100%; - } - .home-collections { margin-bottom: 1em; } @@ -484,6 +480,10 @@ @media (max-width: 1280px) { padding: 1.5em 0; + + #featured-h2 { + width: 100%; + } } } }