Skip to content

Commit

Permalink
Merge pull request #743 from WGBH-MLA/i54-dual-booting-ui
Browse files Browse the repository at this point in the history
i54 Get UI working with Dual Boot Conditionals
  • Loading branch information
ShanaLMoore authored Aug 9, 2023
2 parents bf548e8 + 1a79261 commit 38bc4b0
Show file tree
Hide file tree
Showing 18 changed files with 345 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ if ENV['DEPENDENCIES_NEXT'] && !ENV['DEPENDENCIES_NEXT'].empty?
gem 'hyrax', '~> 4.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 6.0'
gem 'bootstrap', '~> 4.0'
gem 'sony_ci_api', github: 'WGBH-MLA/sony_ci_api_rewrite', branch: 'main'
gem 'hydra-role-management', '1.1.0'
gem 'blacklight', '~> 7.29'
gem 'blacklight_advanced_search', '7.0'
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
group :bulkrax do
# our custom changes require us to lock in the version of bulkrax
gem 'bulkrax', git: 'https://github.com/samvera-labs/bulkrax.git', branch: 'gbh-patch'
Expand Down
21 changes: 17 additions & 4 deletions Gemfile_next.lock
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,12 @@ GEM
almond-rails (0.3.0)
rails (>= 4.2)
ast (2.4.2)
autoprefixer-rails (10.4.13.0)
execjs (~> 2)
awesome_nested_set (3.5.0)
activerecord (>= 4.0.0, < 7.1)
aws-eventstream (1.2.0)
aws-partitions (1.799.0)
aws-partitions (1.800.0)
aws-sdk-codedeploy (1.57.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sigv4 (~> 1.1)
Expand Down Expand Up @@ -191,12 +193,16 @@ GEM
blacklight (> 6.0, < 8)
cancancan (>= 1.8)
deprecation (~> 1.0)
blacklight-gallery (4.0.2)
blacklight (~> 7.17)
rails (>= 5.1, < 8)
blacklight-gallery (4.3.0)
blacklight (>= 7.17, < 9)
rails (>= 6.1, < 8)
blacklight_advanced_search (7.0.0)
blacklight (~> 7.0)
parslet
bootstrap (4.6.2)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 1.16.1, < 2)
sassc-rails (>= 2.0.0)
bootstrap-multiselect-rails (0.9.9)
rails (>= 4.0.0)
bootstrap_form (5.1.0)
Expand Down Expand Up @@ -700,6 +706,7 @@ GEM
faker (~> 1.9)
nokogiri (~> 1.10)
sax-machine (~> 1.3)
popper_js (1.16.1)
posix-spawn (0.3.15)
pry (0.14.2)
coderay (~> 1.1)
Expand Down Expand Up @@ -1048,6 +1055,10 @@ GEM
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
twitter-typeahead-rails (0.11.1.pre.corejavascript)
actionpack (>= 3.1)
jquery-rails
railties (>= 3.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.6)
Expand Down Expand Up @@ -1123,6 +1134,7 @@ DEPENDENCIES
bixby
blacklight (~> 7.29)
blacklight_advanced_search (= 7.0)
bootstrap (~> 4.0)
bootstrap-multiselect-rails
bulkrax!
capybara (~> 3.0)
Expand Down Expand Up @@ -1169,6 +1181,7 @@ DEPENDENCIES
solr_wrapper (~> 2.1)
sony_ci_api!
turbolinks (~> 5)
twitter-typeahead-rails (= 0.11.1.pre.corejavascript)
uglifier (>= 1.3.0)
web-console (>= 3.3.0)
webdrivers (~> 4.0)
Expand Down
34 changes: 34 additions & 0 deletions app/assets/javascripts/application_rails_6_1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
// vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require turbolinks
//
// Required by Blacklight
//= require jquery3
//= require 'blacklight_advanced_search'


//= require rails-ujs
//= require popper
//= require twitter/typeahead
//= require bootstrap
//= require jquery-ui
//= require jquery.dataTables
//= require dataTables.bootstrap4
//= require blacklight/blacklight
//= require ./global/blacklight_gallery
//= require video

//= require bulkrax/application
//= require_tree ./global
//= require hyrax
//= require bootstrap-multiselect
22 changes: 22 additions & 0 deletions app/assets/stylesheets/application_rails_6_1.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
* vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree ./global_rails_6_1
*= require dataTables.bootstrap4
*= require 'bulkrax/application'
*= require_self
*= require 'blacklight_advanced_search'
*= require bootstrap-multiselect
*= require video-js
*/
11 changes: 11 additions & 0 deletions app/assets/stylesheets/global_rails_6_1/accordion_icon.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.panel-heading .accordion-toggle:after {
/* symbol for "opening" panels */
font-family: 'Glyphicons Halflings'; /* essential for enabling glyphicon */
content: "\e114"; /* adjust as needed, taken from bootstrap.css */
float: right; /* adjust as needed */
color: grey; /* adjust as needed */
}
.panel-heading .accordion-toggle.collapsed:after {
/* symbol for "collapsed" panels */
content: "\e080"; /* adjust as needed, taken from bootstrap.css */
}
32 changes: 32 additions & 0 deletions app/assets/stylesheets/global_rails_6_1/ams_icons.scss.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Adds to the .work-type-tag definiton originally defined by Hyrax.
// This allows the child span.[work_type]-icon
.work-type-tag {
display: flex;
}

%work-type-icon {
background-repeat: no-repeat;
background-size: contain;
width: 40px;
margin-right: 10px;
}

.asset-icon {
@extend %work-type-icon;
background-image: url("<%= asset_path 'asset.png' %>");
}

.essence-track-icon {
@extend %work-type-icon;
background-image: url("<%= asset_path 'essence_track.png' %>");
}

.digital-instantiation-icon {
@extend %work-type-icon;
background-image: url("<%= asset_path 'digital_instantiation.png' %>");
}

.physical-instantiation-icon {
@extend %work-type-icon;
background-image: url("<%= asset_path 'physical_instantiation.png' %>");
}
16 changes: 16 additions & 0 deletions app/assets/stylesheets/global_rails_6_1/hyrax.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* ...
*= require jquery-ui
*= require select2
*= require_self
*/

@import "bootstrap-default-overrides";
@import 'bootstrap';
@import 'blacklight/blacklight';
@import "font-awesome";
@import "blacklight_gallery/gallery";
@import "blacklight_gallery/masonry";
@import "blacklight_gallery/slideshow";
@import "blacklight_gallery/osd_viewer";
@import "hyrax/blacklight_gallery";
@import 'hyrax/hyrax';
3 changes: 3 additions & 0 deletions app/assets/stylesheets/global_rails_6_1/openseadragon.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*
*= require openseadragon/openseadragon
*/
78 changes: 78 additions & 0 deletions app/assets/stylesheets/global_rails_6_1/search_results.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
div.facets h3 {
font-size: 1.3em;
}

.search-form .form-control {
height: 35px;
}
.search-form a.advanced_search {
margin: 0 !important;
border-left: 0;
}
.search-form .input-group-btn .scope_select {
border-radius: 0;
}

#sort-dropdown .dropdown-toggle, #per_page-dropdown .dropdown-toggle {
color: rgb(57,57,59);
}

.search-result-title a {
color: rgb(57,57,59);
}

.metadata h4 {
display: inline;
font-size: 14px;
font-weight: bold;
margin-left: 10px;
}

.metadata-col {
margin: 5px auto;
}

.metadata .metadata-desc-col p {
margin: 10px 0 0 10px;
}

@media screen and (max-width: 767px){
.metadata h4 {
margin-left: 0;
}

.metadata .metadata-desc-col p {
margin: 0;
}
}

.green {
color: green;
}

.red {
color: red;
}

.aapb-push-button {
vertical-align: middle;
line-height: 20px;
font-size: 14px;
font-weight: 400;
display: inline-block;
color: #333;
background-color: #fff;
border: 1px solid #ccc;
padding-top: 6px;
padding-left: 12px;
padding-right: 12px;
padding-bottom: 6px;
border-radius: 4px;
}

.aapb-push-button:hover {
background-color: #ddd;
border: 1px solid #bbb;
text-decoration: none;
color: #000;
}
34 changes: 34 additions & 0 deletions app/assets/stylesheets/global_rails_6_1/work_form.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
select.multiple_titles_with_types,
select.multiple_descriptions_with_types,
select.multiple_dates_with_types {
width: 30% !important;
}

input.multiple_titles_with_types,
input.multiple_dates_with_types,
textarea.multiple_descriptions_with_types {
width: 65% !important;
margin-right: 5px !important;
}

select.child_contributors
{
width: 22% !important;
}

input.child_contributors
{
width: 22% !important;
margin-left: 5px !important;
}

select.child_annotations
{
width: 16% !important;
}

input.child_annotations
{
width: 16% !important;
margin-left: 3px !important;
}
9 changes: 9 additions & 0 deletions app/assets/stylesheets/global_rails_6_1/work_show.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.canonical-image {
display: block;
padding: 0.5em 0;
width: 100%;
}

.mejs__container {
margin: 0 auto !important;
}
6 changes: 5 additions & 1 deletion app/views/catalog/_search_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
<% end %>

<label for="q" class="sr-only"><%= t('blacklight.search.form.search.label') %></label>
<%= text_field_tag :q, params[:q], placeholder: t('blacklight.search.form.search.placeholder'), class: "search_q q form-control", id: "q", autofocus: should_autofocus_on_search_box?, data: { autocomplete_enabled: autocomplete_enabled?, autocomplete_path: blacklight.suggest_index_path } %>
<% if App.rails_5_1? %>
<%= text_field_tag :q, params[:q], placeholder: t('blacklight.search.form.search.placeholder'), class: "search_q q form-control", id: "q", autofocus: should_autofocus_on_search_box?, data: { autocomplete_enabled: autocomplete_enabled?, autocomplete_path: blacklight.suggest_index_path } %>
<% else %>
<%= text_field_tag :q, params[:q], placeholder: t('blacklight.search.form.search.placeholder'), class: "search_q q form-control", id: "q", autofocus: should_autofocus_on_search_box?, data: { autocomplete_enabled: autocomplete_enabled? } %>
<% end %>

<div class="input-group-btn">
<button type="submit" class="btn btn-primary" id="search-submit-header">
Expand Down
46 changes: 46 additions & 0 deletions app/views/layouts/_head_tag_content.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<%# OVERRIDE Hyrax 4.0 to allow for dual boot %>
<%= csrf_meta_tag %>
<meta charset="utf-8" />
<%# Only display meta tag, which enables creation of the ActionCable
consumer, when realtime notifications are enabled and the user is
signed in %>
<% if Hyrax.config.realtime_notifications? && signed_in? %>
<%= tag :meta, name: 'current-user', data: { user_key: current_user.user_key } %>
<% end %>
<!-- added for use on small devices like phones -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="resourcesync" href="<%= hyrax.capability_list_url %>" />

<!-- Twitter card metadata -->
<%= yield :twitter_meta %>
<!-- Google Scholar metadata -->
<%= yield :gscholar_meta %>

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

<%# OVERRIDE to allow for dual boot start %>
<% if App.rails_5_1? %>
<!-- application css -->
<%= stylesheet_link_tag 'application' %>
<!-- application js -->
<%= javascript_include_tag 'application' %>
<% else %>
<!-- application css -->
<%= stylesheet_link_tag 'application_rails_6_1' %>
<!-- application js -->
<%= javascript_include_tag 'application_rails_6_1' %>
<% end %>
<%# OVERRIDE end %>
<%= render 'shared/appearance_styles' %>
<% if Hyrax.config.analytics? %>
<% if Hyrax.config.analytics_provider == 'google' %>
<%= render partial: 'shared/ga', formats: [:html] %>
<% elsif Hyrax.config.analytics_provider == 'matomo' %>
<%= render partial: 'shared/matomo', formats: [:html] %>
<% end %>
<% end %>

<!-- for extras, e.g., a favicon -->
<%= render partial: '/head_tag_extras', formats: [:html] %>
Loading

0 comments on commit 38bc4b0

Please sign in to comment.