Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 98 changed files with 2,635 additions and 237 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ gem 'puma', '~> 5.6' # Use Puma as the app server
gem 'rack-test', '0.7.0', group: %i[test] # rack-test >= 0.71 does not work with older Capybara versions (< 2.17). See #214 for more details
gem 'rails-controller-testing', group: %i[test]
gem 'rdf', '~> 3.1.15' # rdf 3.2.0 removed SerializedTransaction which ldp requires
gem 'redcarpet' # for Markdown constant
gem 'redlock', '>= 0.1.2', '< 2.0' # lock redlock per https://github.com/samvera/hyrax/pull/5961
gem 'riiif', '~> 1.1'
gem 'rolify'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,7 @@ GEM
rdf-xsd (3.1.1)
rdf (~> 3.1)
rexml (~> 3.2)
redcarpet (3.6.0)
redic (1.5.3)
hiredis
redis (4.8.1)
Expand Down Expand Up @@ -1351,6 +1352,7 @@ DEPENDENCIES
rails (~> 5.2.5)
rails-controller-testing
rdf (~> 3.1.15)
redcarpet
redlock (>= 0.1.2, < 2.0)
riiif (~> 1.1)
rolify
Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
//= require jquery3
//= require jquery_ujs
//= require jquery.fontselect
//= require cropper.min

//= require dataTables/jquery.dataTables
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
//= require stat_slider
Expand Down
10 changes: 10 additions & 0 deletions app/assets/javascripts/cropper.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/assets/javascripts/fabric.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
*= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
*= require bootstrap-datepicker
*= require single_signon
*= require cropper.min
*= require_self
*/
9 changes: 9 additions & 0 deletions app/assets/stylesheets/cropper.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

132 changes: 132 additions & 0 deletions app/assets/stylesheets/hyku.scss
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,18 @@ nav.navbar.navbar-default.navbar-static-top .container-fluid .row {
}
}

//these styles modify the theming for the citations section
div#collapse-citations {
text-align: left;
word-wrap: break-word;
}

@media (min-width: 576px) {
.citations-button .download-pdf-button {
max-width: 300px;
}
}

body.public-facing {
.btn {
&.btn-primary,
Expand Down Expand Up @@ -486,3 +498,123 @@ body.public-facing {
.mt-20 {
margin-top: 20px;
}

// make sure constraints are on only one line, even with markdown
span.constraint-value p, .facet-values p {
display: inline-block;
margin-bottom: 0;
}

// make the facet counts appear at the end of the facet panel
.facet-content .panel-body .facet-values p {
display: flex;
justify-content: space-between;
}

// button to remove a filter should be red instead of white
.remove.dropdown-toggle .glyphicon.glyphicon-remove {
color: #c4302b;
}

// style the analytics button to match citations button
#stats {
margin-top: 10px;
@media (min-width: 576px) {
max-width: 300px;
}
}

#download-pdf-button {
margin: 10px 0 10px 0;
}

.catalog_startOverLink {
font-size: 1.15em;
font-weight: bold;
}

// collection show page styles

.space-between {
justify-content: space-between;
align-items: center;
}

.hyc-banner {
padding: 15px;
.hyc-bugs .hyc-created-by, .hyc-bugs .hyc-last-updated, .hyc-title {
padding: 0;
}

.hyc-item-count {
margin: 0;
background: rgba(255, 255, 255, 0.75);
padding: 10px;
border-radius: 0.5em;
color: #333;
}

.hyc-bugs div, div {
position: relative;
}
}

// date range limit - blacklight_range_limit gem
form.range_limit.range_date_ssi {
line-height: 1.4;
input.range_begin, input.range_end {
width: auto;
}
}

// these margin classes can be removed when Hyku is eventually updated to Bootstrap 4 upon upgrading to Hyrax 4.
// These correspond directly to bootstrap 4 classes.

.mb-0 {
margin-bottom: 0;
}

.mt-5 {
margin-top: 3em;
}

.mt-2 {
margin-top: 0.5em;
}

.mb-2 {
margin-bottom: .5em;
}

.mb-5 {
margin-bottom: 3em;
}

.mx-3 {
margin-right: 1em;
margin-left: 1em;
}

.ml-auto {
margin-left: auto;
}

.py-0 {
padding-top: 0;
padding-bottom: 0;
}

.py-4 {
padding-top: 2em;
padding-bottom: 2em;
}

.d-block {
display: block;
}

// hide iiif-print feature flipper

tr[data-feature="use-iiif-print"] {
display: none;
}
6 changes: 6 additions & 0 deletions app/assets/stylesheets/hyrax.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@
@import "blacklight_gallery/osd_viewer";

@import "themes/*";

// for catalog search result snippets
.highlight {
background: yellow;
font-weight: 700;
}
7 changes: 6 additions & 1 deletion app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ def self.modified_field
config.default_solr_params = {
qt: "search",
rows: 10,
qf: "title_tesim description_tesim creator_tesim keyword_tesim all_text_timv"
qf: "title_tesim alternative_title_tesim description_tesim creator_tesim contributor_tesim related_url_tesim learning_resource_type_tesim education_level_tesim audience_tesim degree_name_tesim degree_discipline_tesim degree_grantor_tesim date_tesim table_of_contents_tesim rights_statement_tesim license_tesim rights_holder_tesim publisher_tesim identifier_tesim keyword_tesim subject_tesim language_tesim resource_type_tesim date_created_tesim date_uploaded_tesim date_modified_tesim accessibility_feature_tesim accessibility_hazard_tesim accessibility_summary_tesim format_tesim extent_tesim all_text_timv",
"hl": true,
"hl.simple.pre": "<span class='highlight'>",
"hl.simple.post": "</span>",
"hl.snippets": 30,
"hl.fragsize": 100
}

# Specify which field to use in the tag cloud on the homepage.
Expand Down
16 changes: 16 additions & 0 deletions app/controllers/flipflop/strategies_controller_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

# OVERRIDE Flipflop v2.7.1 to allow for custom `Action` labels

module Flipflop
module StrategiesControllerDecorator
def enable?
values = StrategiesController::ENABLE_VALUES | ADDITIONAL_ENABLE_VALUES
values.include?(params[:commit])
end

ADDITIONAL_ENABLE_VALUES = FeaturesHelper::FEATURE_ACTION_LABELS.map { |_, v| v[:on] }.to_set.freeze
end
end

Flipflop::StrategiesController.prepend(Flipflop::StrategiesControllerDecorator)
5 changes: 4 additions & 1 deletion app/controllers/hyrax/admin/appearances_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def show
end

def update
form_class.new(update_params).update!
form = form_class.new(update_params)
form.banner_image = update_params[:banner_image] if update_params[:banner_image].present?

form.update!

if update_params['default_collection_image']
# Reindex all Collections and AdminSets to apply new default collection image
Expand Down
33 changes: 22 additions & 11 deletions app/controllers/hyrax/homepage_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,13 @@ def search_builder_class

# override hyrax v2.9.0 added @home_text - Adding Themes
def index
@presenter = presenter_class.new(current_ability, collections)
@featured_researcher = ContentBlock.for(:researcher)
@marketing_text = ContentBlock.for(:marketing)
@home_text = ContentBlock.for(:home_text)
@featured_work_list = FeaturedWorkList.new
# OVERRIDE here to add featured collection list
@featured_collection_list = FeaturedCollectionList.new
@announcement_text = ContentBlock.for(:announcement)
load_shared_info
recent
ir_counts if home_page_theme == 'institutional_repository'

# override hyrax v2.9.0 added for facets on homepage - Adding Themes
(@response, @document_list) = search_results(params)

Expand All @@ -65,11 +61,7 @@ def index
def browserconfig; end

def all_collections
@presenter = presenter_class.new(current_ability, collections)
@marketing_text = ContentBlock.for(:marketing)
@announcement_text = ContentBlock.for(:announcement)
@collections = collections(rows: 100_000)
ir_counts if home_page_theme == 'institutional_repository'
load_shared_info
end

# Added from Blacklight 6.23.0 to change url for facets on home page
Expand All @@ -85,6 +77,26 @@ def search_action_url(options = {})

private

# shared methods for index and all_collections routes
def load_shared_info
@presenter = presenter_class.new(current_ability, collections)
@marketing_text = ContentBlock.for(:marketing)
@announcement_text = ContentBlock.for(:announcement)
@collections = collections(rows: 100_000)
# rubocop:disable Style/GuardClause
# TODO: Why not make these helper methods? As is we rely on a theme to set instance
# variables. Which is fragile.
if home_page_theme == 'institutional_repository'
ir_counts
@top_level_collections ||= load_top_level_collections(@collections)
end
# rubocop:enable Style/GuardClause
end

def load_top_level_collections(colls)
colls.select { |c| c['member_of_collection_ids_ssim'].nil? }
end

# Return 6 collections
def collections(rows: 6)
builder = Hyrax::CollectionSearchBuilder.new(self)
Expand Down Expand Up @@ -120,7 +132,6 @@ def inject_theme_views
prepend_view_path(home_theme_view_path)
yield
# rubocop:disable Lint/UselessAssignment, Layout/SpaceAroundOperators, Style/RedundantParentheses
# Do NOT change this line. This is calling the Rails view_paths=(paths) method and not a variable assignment.
view_paths=(original_paths)
# rubocop:enable Lint/UselessAssignment, Layout/SpaceAroundOperators, Style/RedundantParentheses
else
Expand Down
12 changes: 12 additions & 0 deletions app/forms/hyrax/forms/admin/appearance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Appearance
'header_and_footer_background_color' => '#3c3c3c',
'header_and_footer_text_color' => '#dcdcdc',
'navbar_background_color' => '#000000',
'navbar_link_background_color' => '#375f8c',
'navbar_link_background_hover_color' => '#ffffff',
'navbar_link_text_color' => '#eeeeee',
'navbar_link_text_hover_color' => '#eeeeee',
Expand Down Expand Up @@ -80,6 +81,8 @@ def persisted?
true
end

delegate :banner_image=, to: :site

# The alt text for the logo image
def logo_image_text
block_for('logo_image_text')
Expand Down Expand Up @@ -138,6 +141,14 @@ def navbar_background_color_active
darken_color(navbar_background_color, 0.35)
end

def navbar_link_background_color
block_for('navbar_link_background_color')
end

def navbar_link_background_color_active
darken_color(navbar_link_background_color, 0.35)
end

def navbar_link_background_hover_color
block_for('navbar_link_background_hover_color')
end
Expand Down Expand Up @@ -381,6 +392,7 @@ def self.customization_params
facet_panel_background_color
facet_panel_text_color
navbar_background_color
navbar_link_background_color
navbar_link_background_hover_color
navbar_link_text_color
navbar_link_text_hover_color
Expand Down
4 changes: 3 additions & 1 deletion app/forms/hyrax/generic_work_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class GenericWorkForm < Hyrax::Forms::WorkForm
include Hyrax::FormTerms
self.model_class = ::GenericWork
include HydraEditor::Form::Permissions
self.terms += %i[resource_type]
include PdfFormBehavior

self.terms += %i[resource_type bibliographic_citation]
end
end
4 changes: 3 additions & 1 deletion app/forms/hyrax/image_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module Hyrax
class ImageForm < Hyrax::Forms::WorkForm
include Hyrax::FormTerms
self.model_class = ::Image
self.terms += %i[resource_type extent]
include PdfFormBehavior

self.terms += %i[resource_type extent bibliographic_citation]
end
end
18 changes: 18 additions & 0 deletions app/forms/hyrax/pdf_form_behavior.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

module Hyrax
module PdfFormBehavior
extend ActiveSupport::Concern

included do
class_attribute :hidden_terms

self.terms += %i[show_pdf_viewer show_pdf_download_button]
self.hidden_terms = %i[show_pdf_viewer show_pdf_download_button]
end

def hidden?(key)
hidden_terms.include? key.to_sym
end
end
end
Loading

0 comments on commit 6a1e0c5

Please sign in to comment.