Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add blacklight advances search, blacklight date ranges and order already #1993

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ gem 'addressable', '2.8.1' # remove once https://github.com/postrank-labs/postra
gem 'apartment'
gem 'aws-sdk-sqs', group: %i[aws]
gem 'blacklight', '~> 6.7'
gem 'blacklight_advanced_search'
gem 'blacklight_oai_provider', '~> 6.1', '>= 6.1.1'
gem 'blacklight_range_limit', '6.5.0'
gem 'bolognese', '>= 1.9.10'
gem 'bootstrap-datepicker-rails'
gem 'bulkrax', '~> 5.3'
Expand Down Expand Up @@ -54,6 +56,7 @@ gem 'omniauth-multi-provider'
gem 'omniauth-rails_csrf_protection', '~> 1.0'
gem 'omniauth-saml', '~> 2.1'
gem 'omniauth_openid_connect'
gem 'order_already'
gem 'parser', '~> 2.5.3'
gem 'pg'
gem 'postrank-uri', '>= 1.0.24'
Expand Down
12 changes: 12 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,20 @@ GEM
bootstrap-sass (~> 3.0)
openseadragon (>= 0.2.0)
rails
blacklight_advanced_search (6.4.1)
blacklight (~> 6.0, >= 6.0.1)
parslet
blacklight_iiif_search (1.0.0)
blacklight (~> 6.0)
iiif-presentation
rails (>= 4.2, < 6)
blacklight_oai_provider (6.1.1)
blacklight (~> 6.0)
oai (~> 1.0)
blacklight_range_limit (6.5.0)
blacklight (~> 6.10)
jquery-rails
rails (>= 4.2, < 6)
bolognese (1.11.0)
activesupport (>= 4.2.5)
benchmark_methods (~> 0.7)
Expand Down Expand Up @@ -871,6 +878,8 @@ GEM
openseadragon (0.6.0)
rails (> 3.2.0)
optimist (3.0.1)
order_already (0.3.1)
rails-html-sanitizer (~> 1.4)
orm_adapter (0.5.0)
os (1.1.4)
parallel (1.23.0)
Expand Down Expand Up @@ -1296,7 +1305,9 @@ DEPENDENCIES
apartment
aws-sdk-sqs
blacklight (~> 6.7)
blacklight_advanced_search
blacklight_oai_provider (~> 6.1, >= 6.1.1)
blacklight_range_limit (= 6.5.0)
bolognese (>= 1.9.10)
bootstrap-datepicker-rails
bulkrax (~> 5.3)
Expand Down Expand Up @@ -1338,6 +1349,7 @@ DEPENDENCIES
omniauth-rails_csrf_protection (~> 1.0)
omniauth-saml (~> 2.1)
omniauth_openid_connect
order_already
parser (~> 2.5.3)
pg
postrank-uri (>= 1.0.24)
Expand Down
20 changes: 20 additions & 0 deletions app/assets/javascripts/admin_color_select.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$(document).on("turbolinks:load", function () {
$("div.defaultable-colors a.restore-default-color").click(function (e) {
e.preventDefault();

var defaultTarget = $(e.target).data("default-target");
var input = $("input[name='admin_appearance[" + defaultTarget + "]']");

input.val(input.data("default-value"));
});

$(".panel-footer a.restore-all-default-colors").click(function (e) {
e.preventDefault();

var allColorInputs = $("input[name*='color']");

allColorInputs.each(function () {
$(this).val($(this).data("default-value"));
});
});
});
40 changes: 36 additions & 4 deletions app/assets/javascripts/admin_font_select.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
Blacklight.onLoad(function() {
if($("#admin_appearance_body_font").length > 0){
$("#admin_appearance_body_font").fontselect({lookahead: 20});
$("#admin_appearance_headline_font").fontselect({lookahead: 20});
Blacklight.onLoad(function () {
if ($("#admin_appearance_body_font").length > 0) {
$("#admin_appearance_body_font").fontselect({ lookahead: 20 });
$("#admin_appearance_headline_font").fontselect({ lookahead: 20 });
}
});

$("div.defaultable-fonts a.restore-default-font").click(function (e) {
e.preventDefault();
var defaultTarget = $(e.target).data("default-target");
var input = $("input[name='admin_appearance[" + defaultTarget + "]']");
var defaultValue = input.data("default-value").replace(";", "");
var inputDisplay = $("div[class$='" + defaultTarget + "']").find(
"div.font-select span"
);

input.val(defaultValue);
inputDisplay.css("font-family", defaultValue);
inputDisplay.text(defaultValue);
});

$(".panel-footer a.restore-all-default-fonts").click(function (e) {
e.preventDefault();

var allFontInputs = $("input[name*='font']");

allFontInputs.each(function () {
var thisTarget = $(this).attr("id").replace("admin_appearance_", "");
var defaultValue = $(this).data("default-value").replace(";", "");
var inputDisplay = $("div[class$='" + thisTarget + "']").find(
"div.font-select span"
);

$(this).val(defaultValue);
inputDisplay.css("font-family", defaultValue);
inputDisplay.text(defaultValue);
});
});
11 changes: 11 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
// Required by Blacklight
//= require blacklight/blacklight
//= require admin_font_select
//= require admin_color_select
//= require blacklight_advanced_search

// Moved the Hyku JS *above* the Hyrax JS to resolve #1187 (following
// a pattern found in ScholarSphere)
Expand All @@ -49,3 +51,12 @@
//= require flot_graph
//= require statistics_tab_manager
//= require blacklight_gallery/default

// Required for blacklight range limit
//= require blacklight_range_limit/range_limit_distro_facets
//= require blacklight_range_limit/range_limit_shared
//= require blacklight_range_limit/range_limit_slider
//= require bootstrap-slider
//= require jquery.flot.js

//= require tinymce
Loading
Loading