Skip to content

Commit

Permalink
Merge branch 'master' into t488-saml-sso
Browse files Browse the repository at this point in the history
  • Loading branch information
dolsysmith committed Mar 13, 2024
2 parents 07fc81e + e8a3b77 commit 2754e37
Show file tree
Hide file tree
Showing 20 changed files with 223 additions and 54 deletions.
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ gem 'rails', '~> 5.2.8.1'
gem "sqlite3", "~> 1.3.0"
# Use pg as the production database for Active Record
gem 'pg'
# Use sitemap
# See https://github.com/viseztrance/rails-sitemap
gem 'sitemap'
# Use Passenger as the app server
# Update this when we update the Passenger docker container base image version
gem 'passenger', '6.0.17', require: "phusion_passenger/rack_handler"
Expand Down Expand Up @@ -88,6 +85,8 @@ gem "ffi", "~> 1.15"

gem 'json-canonicalization', '0.3.1' # https://github.com/dryruby/json-canonicalization/issues/2

gem 'schoolie', '0.1.3'

gem 'prawn'
# SAML
gem 'omniauth-saml', '2.1.0'
Expand Down
5 changes: 4 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,8 @@ GEM
sassc (2.4.0)
ffi (~> 1.9)
scanf (1.0.0)
schoolie (0.1.3)
actionview (~> 5)
select2-rails (3.5.11)
shacl (0.1.1)
json-ld (~> 3.1, >= 3.1.7)
Expand All @@ -908,7 +910,7 @@ GEM
rdf-xsd (~> 3.1)
sparql (~> 3.1)
sxp (~> 1.1)
sidekiq (6.5.9)
sidekiq (6.5.10)
connection_pool (>= 2.2.5, < 3)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
Expand Down Expand Up @@ -1076,6 +1078,7 @@ DEPENDENCIES
rsolr (>= 1.0, < 3)
rspec-rails
sass-rails (~> 5.0)
schoolie (= 0.1.3)
sidekiq (~> 6)
simplecov
sitemap
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/scholarspace/base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
67 changes: 51 additions & 16 deletions app/assets/stylesheets/scholarspace/components/_homepage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
margin: 0;

#categories-container, #categories-tooltip {
padding: 0 0 0 0.5em
padding: 1em 0 0 0.5em;
}
}
}
Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -431,10 +466,6 @@
@media (max-width: 1280px) {
flex-direction: column;

#featured-h2 {
width: 100%;
}

.home-collections {
margin-bottom: 1em;
}
Expand All @@ -449,8 +480,12 @@

@media (max-width: 1280px) {
padding: 1.5em 0;

#featured-h2 {
width: 100%;
}
}
}
}
}
}
}
3 changes: 1 addition & 2 deletions app/jobs/sitemap_regenerate_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

class SitemapRegenerateJob < ApplicationJob
def perform
Rake::Task['sitemap:generate'].invoke
Rake::Task['sitemap:ping'].invoke
Rake::Task['schoolie:sitemap'].invoke
end
end
2 changes: 1 addition & 1 deletion app/models/gw_etd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class GwEtd < ActiveFedora::Base
# Change this to restrict which works can be added as a child.
# self.valid_child_concerns = []
self.indexer = GwEtdIndexer

validates :title, presence: { message: 'Your work must have a title.' }

property :gw_affiliation, predicate: ::RDF::URI.new('http://scholarspace.library.gwu.edu/ns#gwaffiliation') do |index|
Expand Down
2 changes: 1 addition & 1 deletion app/models/gw_work.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ class GwWork < ActiveFedora::Base
end

include ::Hyrax::BasicMetadata
end
end
6 changes: 6 additions & 0 deletions app/presenters/hyrax/gw_etd_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@ class GwEtdPresenter < GwWorkPresenter
def permanent_url
Scholarspace::Application.config.permanent_url_base + "etd/#{id}"
end

# scholarly? is used to determine whether or not
# the Google Scholar meta tags are rendered
def scholarly?
true
end
end
end
4 changes: 4 additions & 0 deletions app/presenters/hyrax/gw_work_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ class GwWorkPresenter < Hyrax::WorkShowPresenter
def permanent_url
Scholarspace::Application.config.permanent_url_base + "work/#{id}"
end

def scholarly?
false
end
end
end
16 changes: 10 additions & 6 deletions app/views/hyrax/homepage/_recent_document.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
<%= render_thumbnail_tag(recent_document, {alt: "#{recent_document} #{ t('hyrax.homepage.admin_sets.thumbnail')}" }, {suppress_link: true}) %>
</div>
<div class="recent-title">
<h3>
<%= recent_document %>
</h3>
<div class="title-wrapper">
<h3>
<%= recent_document %>
</h3>
</div>
</div>
<% end %>
</div>
<p class="recent-field">
<span class="recent-label"><%= t('hyrax.homepage.recently_uploaded.document.keyword_label') %>:</span> <%= link_to_facet_list(recent_document.keyword, 'keyword', t('hyrax.homepage.recently_uploaded.document.keyword_missing')).html_safe %>
</p>
<div class="keyword-wrapper">
<p class="recent-field">
<span class="recent-label"><%= t('hyrax.homepage.recently_uploaded.document.keyword_label') %>:</span> <%= link_to_facet_list(recent_document.keyword, 'keyword', t('hyrax.homepage.recently_uploaded.document.keyword_missing')).html_safe %>
</p>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions app/views/layouts/_head_tag_content.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ signed in %>

<!-- Twitter card metadata -->
<%= yield :twitter_meta %>
<!-- Google Scholar metadata -->
<%= yield :gscholar_meta %>
<!-- Schoolie for Google Scholar metadata (replaces :gscholar_meta) -->
<%= yield :schoolie_meta %>

<title><%= content_for?(:page_title) ? yield(:page_title) : default_page_title %></title>

Expand Down
2 changes: 2 additions & 0 deletions app/views/shared/_citations.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<%= render 'shared/twitter_citations' %>
<%= render 'shared/schoolie_citations' %>
5 changes: 5 additions & 0 deletions app/views/shared/_schoolie_citations.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<% content_for(:schoolie_meta) do %>
<% if @presenter.scholarly? %>
<%schoolie_tags(@presenter).html_safe%>
<% end %>
<% end %>
15 changes: 15 additions & 0 deletions app/views/shared/_twitter_citations.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<% content_for(:twitter_meta) do %>
<meta name="twitter:card" content="product" />
<meta name="twitter:site" content="<%= t('hyrax.product_twitter_handle') %>" />
<meta name="twitter:creator" content="<%= @presenter.tweeter %>" />
<meta property="og:site_name" content="<%= application_name %>" />
<meta property="og:type" content="object" />
<meta property="og:title" content="<%= @presenter.title.first %>" />
<meta property="og:description" content="<%= @presenter.description.first.truncate(200) rescue @presenter.title.first %>" />
<meta property="og:image" content="<%= @presenter.download_url %>" />
<meta property="og:url" content="<%= polymorphic_url([main_app, @presenter]) %>" />
<meta name="twitter:data1" content="<%= @presenter.keyword.join(', ') %>" />
<meta name="twitter:label1" content="Keywords" />
<meta name="twitter:data2" content="<%= @presenter.rights_statement.first %>" />
<meta name="twitter:label2" content="Rights Statement" />
<% end %>
6 changes: 4 additions & 2 deletions config/authorities/resource_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ terms:
term: Conference Proceeding
- id: Dataset
term: Dataset
- id: Dissertation
term: Dissertation
- id: Image
term: Image
- id: Journal
term: Journal
- id: Map or Cartographic Material
term: Map or Cartographic Material
- id: Master's Thesis
term: Master's Thesis
- id: Meeting Minutes
term: Meeting Minutes
- id: Newsletter
Expand All @@ -39,8 +43,6 @@ terms:
term: Research Paper
- id: Software or Program Code
term: Software or Program Code
- id: Thesis or Dissertation
term: Thesis or Dissertation
- id: Video
term: Video
- id: Working Paper
Expand Down
20 changes: 20 additions & 0 deletions config/etd_degree_map.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Master's Thesis:
- M.A.
- M.S.
- M.P.H.
- LL.M.
- M.F.A.
- M.A.T.
- M.P.S.
- M.B.A.
- M.F.S.
- M.Int.St.
- M.P.H.
- M.P.P.
Dissertation:
- Ph.D.
- Ed.D.
- D.Engr.
- Dr.P.H.
- D.Sc.
- S.J.D.
10 changes: 10 additions & 0 deletions config/schoolie.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
static:
citation_institution: George Washington University
attributes:
citation_title: title
citation_author: creator
citation_type: resource_type
dc.type: resource_type
citation_date: publication_date
citation_keywords: keyword
citation_pdf_url: download_url
16 changes: 0 additions & 16 deletions config/sitemap.rb

This file was deleted.

Loading

0 comments on commit 2754e37

Please sign in to comment.