diff --git a/Gemfile b/Gemfile index 60a88af46..f52b488e1 100644 --- a/Gemfile +++ b/Gemfile @@ -65,8 +65,8 @@ group :development do gem 'letter_opener' end -gem 'blacklight', '~> 7.29.0' -gem 'blacklight_advanced_search', git: 'https://github.com/projectblacklight/blacklight_advanced_search.git', :branch => 'master' +gem 'blacklight', '~> 7.30.0' +gem 'blacklight_advanced_search', '~> 7.0.0' gem 'blacklight_range_limit', '~> 7.0.0' gem 'chosen-rails' # jquery multiselect plugin for advanced search gem 'bootstrap', '~> 4.0' diff --git a/Gemfile.lock b/Gemfile.lock index 061244f15..0bcb745b2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,15 +16,6 @@ GIT specs: geoblacklight-icons (1.3.1) -GIT - remote: https://github.com/projectblacklight/blacklight_advanced_search.git - revision: 9c04e3770c137d1958f43aa260bc302ab5cfb63b - branch: master - specs: - blacklight_advanced_search (7.0.0) - blacklight (~> 7.0) - parslet - GEM remote: https://rubygems.org/ specs: @@ -101,7 +92,7 @@ GEM awesome_print (1.9.2) bcrypt (3.1.18) bindex (0.8.1) - blacklight (7.29.0) + blacklight (7.30.0) deprecation globalid hashdiff @@ -111,6 +102,9 @@ GEM ostruct (>= 0.3.2) rails (>= 5.1, < 7.1) view_component (~> 2.43) + blacklight_advanced_search (7.0.0) + blacklight (~> 7.0) + parslet blacklight_range_limit (7.0.1) blacklight jquery-rails @@ -495,7 +489,7 @@ GEM sprockets-rails tilt sd_notify (0.1.1) - selenium-webdriver (4.4.0) + selenium-webdriver (4.5.0) childprocess (>= 0.5, < 5.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) @@ -542,7 +536,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.2) - view_component (2.72.0) + view_component (2.74.1) activesupport (>= 5.0.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) @@ -553,7 +547,7 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webdrivers (5.0.0) + webdrivers (5.2.0) nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (~> 4.0) @@ -569,7 +563,7 @@ GEM chronic (>= 0.6.3) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.0) + zeitwerk (2.6.1) PLATFORMS ruby @@ -578,8 +572,8 @@ DEPENDENCIES addressable (~> 2.5.0) appsignal awesome_print - blacklight (~> 7.29.0) - blacklight_advanced_search! + blacklight (~> 7.30.0) + blacklight_advanced_search (~> 7.0.0) blacklight_range_limit (~> 7.0.0) bootsnap (~> 1.9.3) bootstrap (~> 4.0) diff --git a/app/assets/images/markers_default.png b/app/assets/images/markers_default.png new file mode 100644 index 000000000..2c81d15bf Binary files /dev/null and b/app/assets/images/markers_default.png differ diff --git a/app/assets/images/markers_default@2x.png b/app/assets/images/markers_default@2x.png new file mode 100644 index 000000000..35ff61b50 Binary files /dev/null and b/app/assets/images/markers_default@2x.png differ diff --git a/app/assets/images/markers_shadow.png b/app/assets/images/markers_shadow.png new file mode 100644 index 000000000..33cf95504 Binary files /dev/null and b/app/assets/images/markers_shadow.png differ diff --git a/app/assets/images/markers_shadow@2x.png b/app/assets/images/markers_shadow@2x.png new file mode 100644 index 000000000..1116503f6 Binary files /dev/null and b/app/assets/images/markers_shadow@2x.png differ diff --git a/app/assets/javascripts/Leaflet/leaflet.extra-markers/leaflet.extra-markers.js b/app/assets/javascripts/Leaflet/leaflet.extra-markers/leaflet.extra-markers.js new file mode 100644 index 000000000..1bf12a194 --- /dev/null +++ b/app/assets/javascripts/Leaflet/leaflet.extra-markers/leaflet.extra-markers.js @@ -0,0 +1,161 @@ +/*! + * leaflet-extra-markers + * Custom Markers for Leaflet JS based on Awesome Markers + * Leaflet ExtraMarkers + * https://github.com/coryasilva/Leaflet.ExtraMarkers/ + * @author coryasilva + * @version 1.2.1 + */ + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.leaflet = global.leaflet || {}, global.leaflet['extra-markers'] = {}))); +}(this, (function (exports) { 'use strict'; + + var ExtraMarkers = L.ExtraMarkers = {}; + ExtraMarkers.version = L.ExtraMarkers.version = "1.2.1"; + ExtraMarkers.Icon = L.ExtraMarkers.Icon = L.Icon.extend({ + options: { + iconSize: [ 35, 45 ], + iconAnchor: [ 17, 42 ], + popupAnchor: [ 1, -32 ], + shadowAnchor: [ 10, 12 ], + shadowSize: [ 36, 16 ], + className: "", + prefix: "", + extraClasses: "", + shape: "circle", + icon: "", + innerHTML: "", + markerColor: "red", + svgBorderColor: "#fff", + svgOpacity: 1, + iconColor: "#fff", + iconRotate: 0, + number: "", + svg: false, + name: "" + }, + initialize: function(options) { + options = L.Util.setOptions(this, options); + }, + createIcon: function() { + var div = document.createElement("div"), options = this.options; + if (options.icon) { + div.innerHTML = this._createInner(); + } + if (options.innerHTML) { + div.innerHTML = options.innerHTML; + } + if (options.bgPos) { + div.style.backgroundPosition = -options.bgPos.x + "px " + -options.bgPos.y + "px"; + } + if (!options.svg) { + this._setIconStyles(div, options.shape + "-" + options.markerColor); + } else { + this._setIconStyles(div, "svg"); + } + return div; + }, + _getColorHex: function (color) { + var colorMap = { + red: "#a23337", + "orange-dark": "#d73e29", + orange: "#ef9227", + yellow: "#f5bb39", + "blue-dark": "#276273", + cyan: "#32a9dd", + purple: "#440444", + violet: "#90278d", + pink: "#c057a0", + green: "#006838", + white: "#e8e8e8", + black: "#211c1d" + }; + return colorMap[color] || color; + }, + _createSvg: function (shape, markerColor) { + var svgMap = { + circle: '', + square: '', + star: '', + penta: '' + }; + return svgMap[shape]; + }, + _createInner: function() { + var iconStyle = "", iconNumber = "", iconClass = "", result = "", options = this.options; + if (options.iconColor) { + iconStyle = "color: " + options.iconColor + ";"; + } + if (options.iconRotate !== 0) { + iconStyle += "-webkit-transform: rotate(" + options.iconRotate + "deg);"; + iconStyle += "-moz-transform: rotate(" + options.iconRotate + "deg);"; + iconStyle += "-o-transform: rotate(" + options.iconRotate + "deg);"; + iconStyle += "-ms-transform: rotate(" + options.iconRotate + "deg);"; + iconStyle += "transform: rotate(" + options.iconRotate + "deg);"; + } + if (options.number) { + iconNumber = 'number="' + options.number + '" '; + } + if (options.extraClasses.length) { + iconClass += options.extraClasses + " "; + } + if (options.prefix.length) { + iconClass += options.prefix + " "; + } + if (options.icon.length) { + iconClass += options.icon + " "; + } + if (options.svg) { + result += this._createSvg(options.shape, this._getColorHex(options.markerColor)); + } + + result += ''; + + if (options.name.length) { + result += '
' + options.name + '
'; + } + + return result; + }, + _setIconStyles: function(img, name) { + var options = this.options, size = L.point(options[name === "shadow" ? "shadowSize" : "iconSize"]), anchor, leafletName; + if (name === "shadow") { + anchor = L.point(options.shadowAnchor || options.iconAnchor); + leafletName = "shadow"; + } else { + anchor = L.point(options.iconAnchor); + leafletName = "icon"; + } + if (!anchor && size) { + anchor = size.divideBy(2, true); + } + img.className = "leaflet-marker-" + leafletName + " extra-marker extra-marker-" + name + " " + options.className; + if (anchor) { + img.style.marginLeft = -anchor.x + "px"; + img.style.marginTop = -anchor.y + "px"; + } + if (size) { + img.style.width = size.x + "px"; + img.style.height = size.y + "px"; + } + }, + createShadow: function() { + var div = document.createElement("div"); + this._setIconStyles(div, "shadow"); + return div; + } + }); + ExtraMarkers.icon = L.ExtraMarkers.icon = function(options) { + return new L.ExtraMarkers.Icon(options); + }; + + exports.ExtraMarkers = ExtraMarkers; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); + +//# sourceMappingURL=leaflet.extra-markers.js.map diff --git a/app/assets/javascripts/Leaflet/leaflet.extra-markers/leaflet.extra-markers.js.map b/app/assets/javascripts/Leaflet/leaflet.extra-markers/leaflet.extra-markers.js.map new file mode 100644 index 000000000..64808c322 --- /dev/null +++ b/app/assets/javascripts/Leaflet/leaflet.extra-markers/leaflet.extra-markers.js.map @@ -0,0 +1 @@ +{"version":3,"file":null,"sources":["C:/Development/Open Source/Leaflet.ExtraMarkers/src/assets/js/leaflet.extra-markers.js"],"sourcesContent":["export var ExtraMarkers = L.ExtraMarkers = {};\r\nExtraMarkers.version = L.ExtraMarkers.version = \"1.2.1\";\r\nExtraMarkers.Icon = L.ExtraMarkers.Icon = L.Icon.extend({\r\n options: {\r\n iconSize: [ 35, 45 ],\r\n iconAnchor: [ 17, 42 ],\r\n popupAnchor: [ 1, -32 ],\r\n shadowAnchor: [ 10, 12 ],\r\n shadowSize: [ 36, 16 ],\r\n className: \"\",\r\n prefix: \"\",\r\n extraClasses: \"\",\r\n shape: \"circle\",\r\n icon: \"\",\r\n innerHTML: \"\",\r\n markerColor: \"red\",\r\n svgBorderColor: \"#fff\",\r\n svgOpacity: 1,\r\n iconColor: \"#fff\",\r\n iconRotate: 0,\r\n number: \"\",\r\n svg: false,\r\n name: \"\"\r\n },\r\n initialize: function(options) {\r\n options = L.Util.setOptions(this, options);\r\n },\r\n createIcon: function() {\r\n var div = document.createElement(\"div\"), options = this.options;\r\n if (options.icon) {\r\n div.innerHTML = this._createInner();\r\n }\r\n if (options.innerHTML) {\r\n div.innerHTML = options.innerHTML;\r\n }\r\n if (options.bgPos) {\r\n div.style.backgroundPosition = -options.bgPos.x + \"px \" + -options.bgPos.y + \"px\";\r\n }\r\n if (!options.svg) {\r\n this._setIconStyles(div, options.shape + \"-\" + options.markerColor);\r\n } else {\r\n this._setIconStyles(div, \"svg\");\r\n }\r\n return div;\r\n },\r\n _getColorHex: function (color) {\r\n var colorMap = {\r\n red: \"#a23337\",\r\n \"orange-dark\": \"#d73e29\",\r\n orange: \"#ef9227\",\r\n yellow: \"#f5bb39\",\r\n \"blue-dark\": \"#276273\",\r\n cyan: \"#32a9dd\",\r\n purple: \"#440444\",\r\n violet: \"#90278d\",\r\n pink: \"#c057a0\",\r\n green: \"#006838\",\r\n white: \"#e8e8e8\",\r\n black: \"#211c1d\"\r\n };\r\n return colorMap[color] || color;\r\n },\r\n _createSvg: function (shape, markerColor) {\r\n var svgMap = {\r\n circle: '',\r\n square: '',\r\n star: '',\r\n penta: ''\r\n };\r\n return svgMap[shape];\r\n },\r\n _createInner: function() {\r\n var iconStyle = \"\", iconNumber = \"\", iconClass = \"\", result = \"\", options = this.options;\r\n if (options.iconColor) {\r\n iconStyle = \"color: \" + options.iconColor + \";\";\r\n }\r\n if (options.iconRotate !== 0) {\r\n iconStyle += \"-webkit-transform: rotate(\" + options.iconRotate + \"deg);\";\r\n iconStyle += \"-moz-transform: rotate(\" + options.iconRotate + \"deg);\";\r\n iconStyle += \"-o-transform: rotate(\" + options.iconRotate + \"deg);\";\r\n iconStyle += \"-ms-transform: rotate(\" + options.iconRotate + \"deg);\";\r\n iconStyle += \"transform: rotate(\" + options.iconRotate + \"deg);\";\r\n }\r\n if (options.number) {\r\n iconNumber = 'number=\"' + options.number + '\" ';\r\n }\r\n if (options.extraClasses.length) {\r\n iconClass += options.extraClasses + \" \";\r\n }\r\n if (options.prefix.length) {\r\n iconClass += options.prefix + \" \";\r\n }\r\n if (options.icon.length) {\r\n iconClass += options.icon + \" \";\r\n }\r\n if (options.svg) {\r\n result += this._createSvg(options.shape, this._getColorHex(options.markerColor));\r\n }\r\n\r\n result += '';\r\n\r\n if (options.name.length) {\r\n result += '
' + options.name + '
';\r\n }\r\n\r\n return result;\r\n },\r\n _setIconStyles: function(img, name) {\r\n var options = this.options, size = L.point(options[name === \"shadow\" ? \"shadowSize\" : \"iconSize\"]), anchor, leafletName;\r\n if (name === \"shadow\") {\r\n anchor = L.point(options.shadowAnchor || options.iconAnchor);\r\n leafletName = \"shadow\";\r\n } else {\r\n anchor = L.point(options.iconAnchor);\r\n leafletName = \"icon\";\r\n }\r\n if (!anchor && size) {\r\n anchor = size.divideBy(2, true);\r\n }\r\n img.className = \"leaflet-marker-\" + leafletName + \" extra-marker extra-marker-\" + name + \" \" + options.className;\r\n if (anchor) {\r\n img.style.marginLeft = -anchor.x + \"px\";\r\n img.style.marginTop = -anchor.y + \"px\";\r\n }\r\n if (size) {\r\n img.style.width = size.x + \"px\";\r\n img.style.height = size.y + \"px\";\r\n }\r\n },\r\n createShadow: function() {\r\n var div = document.createElement(\"div\");\r\n this._setIconStyles(div, \"shadow\");\r\n return div;\r\n }\r\n});\r\nExtraMarkers.icon = L.ExtraMarkers.icon = function(options) {\r\n return new L.ExtraMarkers.Icon(options);\r\n};"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAO,QAAI,YAAY,GAAG,CAAC,CAAC,YAAY,GAAG,EAAE,CAAC;IAC9C,YAAY,CAAC,OAAO,GAAG,CAAC,CAAC,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;IACxD,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IACxD,IAAI,OAAO,EAAE;IACb,QAAQ,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAC5B,QAAQ,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAC9B,QAAQ,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/B,QAAQ,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAChC,QAAQ,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAC9B,QAAQ,SAAS,EAAE,EAAE;IACrB,QAAQ,MAAM,EAAE,EAAE;IAClB,QAAQ,YAAY,EAAE,EAAE;IACxB,QAAQ,KAAK,EAAE,QAAQ;IACvB,QAAQ,IAAI,EAAE,EAAE;IAChB,QAAQ,SAAS,EAAE,EAAE;IACrB,QAAQ,WAAW,EAAE,KAAK;IAC1B,QAAQ,cAAc,EAAE,MAAM;IAC9B,QAAQ,UAAU,EAAE,CAAC;IACrB,QAAQ,SAAS,EAAE,MAAM;IACzB,QAAQ,UAAU,EAAE,CAAC;IACrB,QAAQ,MAAM,EAAE,EAAE;IAClB,QAAQ,GAAG,EAAE,KAAK;IAClB,QAAQ,IAAI,EAAE,EAAE;IACh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,YAAY,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;IAC5C,YAAY,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;IAC7C,SAAS;IACT,KAAK;IACL,IAAI,YAAY,EAAE,WAAW;IAC7B,QAAQ,IAAI,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAChD,QAAQ,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC3C,QAAQ,OAAO,GAAG,CAAC;IACnB,KAAK;IACL,CAAC,CAAC,CAAC;IACH,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC,YAAY,CAAC,IAAI,GAAG,SAAS,OAAO,EAAE;IAC5D,IAAI,OAAO,IAAI,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;;;;;;;;;;;;"} \ No newline at end of file diff --git a/app/assets/javascripts/Leaflet/leaflet.extramarkers/leaflet.extra-markers.js b/app/assets/javascripts/Leaflet/leaflet.extramarkers/leaflet.extra-markers.js new file mode 100644 index 000000000..1bf12a194 --- /dev/null +++ b/app/assets/javascripts/Leaflet/leaflet.extramarkers/leaflet.extra-markers.js @@ -0,0 +1,161 @@ +/*! + * leaflet-extra-markers + * Custom Markers for Leaflet JS based on Awesome Markers + * Leaflet ExtraMarkers + * https://github.com/coryasilva/Leaflet.ExtraMarkers/ + * @author coryasilva + * @version 1.2.1 + */ + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.leaflet = global.leaflet || {}, global.leaflet['extra-markers'] = {}))); +}(this, (function (exports) { 'use strict'; + + var ExtraMarkers = L.ExtraMarkers = {}; + ExtraMarkers.version = L.ExtraMarkers.version = "1.2.1"; + ExtraMarkers.Icon = L.ExtraMarkers.Icon = L.Icon.extend({ + options: { + iconSize: [ 35, 45 ], + iconAnchor: [ 17, 42 ], + popupAnchor: [ 1, -32 ], + shadowAnchor: [ 10, 12 ], + shadowSize: [ 36, 16 ], + className: "", + prefix: "", + extraClasses: "", + shape: "circle", + icon: "", + innerHTML: "", + markerColor: "red", + svgBorderColor: "#fff", + svgOpacity: 1, + iconColor: "#fff", + iconRotate: 0, + number: "", + svg: false, + name: "" + }, + initialize: function(options) { + options = L.Util.setOptions(this, options); + }, + createIcon: function() { + var div = document.createElement("div"), options = this.options; + if (options.icon) { + div.innerHTML = this._createInner(); + } + if (options.innerHTML) { + div.innerHTML = options.innerHTML; + } + if (options.bgPos) { + div.style.backgroundPosition = -options.bgPos.x + "px " + -options.bgPos.y + "px"; + } + if (!options.svg) { + this._setIconStyles(div, options.shape + "-" + options.markerColor); + } else { + this._setIconStyles(div, "svg"); + } + return div; + }, + _getColorHex: function (color) { + var colorMap = { + red: "#a23337", + "orange-dark": "#d73e29", + orange: "#ef9227", + yellow: "#f5bb39", + "blue-dark": "#276273", + cyan: "#32a9dd", + purple: "#440444", + violet: "#90278d", + pink: "#c057a0", + green: "#006838", + white: "#e8e8e8", + black: "#211c1d" + }; + return colorMap[color] || color; + }, + _createSvg: function (shape, markerColor) { + var svgMap = { + circle: '', + square: '', + star: '', + penta: '' + }; + return svgMap[shape]; + }, + _createInner: function() { + var iconStyle = "", iconNumber = "", iconClass = "", result = "", options = this.options; + if (options.iconColor) { + iconStyle = "color: " + options.iconColor + ";"; + } + if (options.iconRotate !== 0) { + iconStyle += "-webkit-transform: rotate(" + options.iconRotate + "deg);"; + iconStyle += "-moz-transform: rotate(" + options.iconRotate + "deg);"; + iconStyle += "-o-transform: rotate(" + options.iconRotate + "deg);"; + iconStyle += "-ms-transform: rotate(" + options.iconRotate + "deg);"; + iconStyle += "transform: rotate(" + options.iconRotate + "deg);"; + } + if (options.number) { + iconNumber = 'number="' + options.number + '" '; + } + if (options.extraClasses.length) { + iconClass += options.extraClasses + " "; + } + if (options.prefix.length) { + iconClass += options.prefix + " "; + } + if (options.icon.length) { + iconClass += options.icon + " "; + } + if (options.svg) { + result += this._createSvg(options.shape, this._getColorHex(options.markerColor)); + } + + result += ''; + + if (options.name.length) { + result += '
' + options.name + '
'; + } + + return result; + }, + _setIconStyles: function(img, name) { + var options = this.options, size = L.point(options[name === "shadow" ? "shadowSize" : "iconSize"]), anchor, leafletName; + if (name === "shadow") { + anchor = L.point(options.shadowAnchor || options.iconAnchor); + leafletName = "shadow"; + } else { + anchor = L.point(options.iconAnchor); + leafletName = "icon"; + } + if (!anchor && size) { + anchor = size.divideBy(2, true); + } + img.className = "leaflet-marker-" + leafletName + " extra-marker extra-marker-" + name + " " + options.className; + if (anchor) { + img.style.marginLeft = -anchor.x + "px"; + img.style.marginTop = -anchor.y + "px"; + } + if (size) { + img.style.width = size.x + "px"; + img.style.height = size.y + "px"; + } + }, + createShadow: function() { + var div = document.createElement("div"); + this._setIconStyles(div, "shadow"); + return div; + } + }); + ExtraMarkers.icon = L.ExtraMarkers.icon = function(options) { + return new L.ExtraMarkers.Icon(options); + }; + + exports.ExtraMarkers = ExtraMarkers; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); + +//# sourceMappingURL=leaflet.extra-markers.js.map diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index aa042b8e6..a470d5673 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -77,6 +77,7 @@ //= require Leaflet/leaflet.markercluster/leaflet.markercluster.js //= require Leaflet/leaflet.prunecluster/PruneCluster.js //= require Leaflet/leaflet.esri_leaflet_cluster/esri_leaflet_cluster.js +//= require Leaflet/leaflet.extra-markers/leaflet.extra-markers.js //= require oboe/oboe-browser.js //= require screenfull/screenfull.min.js //= require js-cookie/src/js.cookie.js diff --git a/app/assets/javascripts/geoportal/modules/item.js b/app/assets/javascripts/geoportal/modules/item.js index 0301511d5..66f28b536 100644 --- a/app/assets/javascripts/geoportal/modules/item.js +++ b/app/assets/javascripts/geoportal/modules/item.js @@ -7,6 +7,13 @@ Blacklight.onLoad(function() { // get new viewer instance and pass in element viewer = new window['GeoBlacklight']['Viewer'][viewerName](element); + + if($('section.page-sidebar').has('div#static-map').length) { + try { + var geom = $(element).data('map-geom'); + viewer.addGeoJsonOverlay(geom); + } catch (error) { }; + } }); $('.truncate-abstract').each(function(i, element) { diff --git a/app/assets/javascripts/geoportal/modules/results.js b/app/assets/javascripts/geoportal/modules/results.js index 2cfeb4c94..0aaf21a05 100644 --- a/app/assets/javascripts/geoportal/modules/results.js +++ b/app/assets/javascripts/geoportal/modules/results.js @@ -44,42 +44,22 @@ Blacklight.onLoad(function() { } // instantiate new map - geoblacklight = new GeoBlacklight.Viewer.Map(this, { bbox: bbox }); - - var markers = L.markerClusterGroup(); - - // Send Oboe to admin/api for non-web-ui attributes like centroid - // Not usingURL() to maintain legacy IE support - url = document.createElement('a'); - url.href = window.location.href; - url.pathname = '/admin/api.json' - // Oboe - Re-query Solr for JSON results - oboe(url.toString() + '&format=json&per_page=100&rows=100') - .node('data.*', function( doc ){ - if(typeof doc['attributes']['dcat_centroid'] != 'undefined'){ - var latlng = doc['attributes']['dcat_centroid']['attributes']['value'].split(",") - markers.addLayer(L.marker([latlng[0],latlng[1]]).bindPopup("" + doc['attributes']['dct_title_s']['attributes']['value'] + "")); - } - } - ) - .done(function(){ - geoblacklight.map.addLayer(markers); - }) + GeoBlacklight.Home = new GeoBlacklight.Viewer.Map(this, { bbox: bbox }); // set hover listeners on map $('#content') .on('mouseenter', '#documents [data-layer-id]', function() { if($(this).data('bbox') !== "") { var geom = $(this).data('geom') - geoblacklight.addGeoJsonOverlay(geom) + GeoBlacklight.Home.addGeoJsonOverlay(geom) } }) .on('mouseleave', '#documents [data-layer-id]', function() { - geoblacklight.removeBoundsOverlay(); + GeoBlacklight.Home.removeBoundsOverlay(); }); // add geosearch control to map - geoblacklight.map.addControl(L.control.geosearch(opts)); + GeoBlacklight.Home.map.addControl(L.control.geosearch(opts)); // B1G Customizations // fullscreen control @@ -92,9 +72,26 @@ Blacklight.onLoad(function() { var searchControl = new GeoSearchControl({ provider: provider, }); - geoblacklight.map.addControl(searchControl); + GeoBlacklight.Home.map.addControl(searchControl); + + // Set document markers + GeoBlacklight.Home.placeMarkers(); + GeoBlacklight.Home.setHoverListeners(); }); + function setHoverListeners() { + $('[data-map="index"]').each(function(i, element) { + $('#content') + .on('mouseenter', '#documents [data-layer-id]', function() { + var geom = $(this).data('geom') + GeoBlacklight.Home.addGeoJsonOverlay(geom); + }) + .on('mouseleave', '#documents [data-layer-id]', function() { + GeoBlacklight.Home.removeBoundsOverlay(); + }); + }); + } + function updatePage(url) { $.get(url).done(function(data) { var resp = $.parseHTML(data); @@ -109,6 +106,10 @@ Blacklight.onLoad(function() { } else { $('#map').after($doc.find('#map').next()); } + + // Reload markers and listeners + GeoBlacklight.Home.placeMarkers(); + GeoBlacklight.Home.setHoverListeners() }); } }); diff --git a/app/assets/javascripts/geoportal/modules/results_old.js b/app/assets/javascripts/geoportal/modules/results_old.js new file mode 100644 index 000000000..2cfeb4c94 --- /dev/null +++ b/app/assets/javascripts/geoportal/modules/results_old.js @@ -0,0 +1,114 @@ +Blacklight.onLoad(function() { + var historySupported = !!(window.history && window.history.pushState); + + if (historySupported) { + History.Adapter.bind(window, 'statechange', function() { + var state = History.getState(); + updatePage(state.url); + }); + } + + $('[data-map="index"]').each(function() { + var data = $(this).data(), + opts = { baseUrl: data.catalogPath }, + world = L.latLngBounds([[-90, -180], [90, 180]]), + geoblacklight, bbox; + + if (typeof data.mapGeom === 'string') { + bbox = L.geoJSONToBounds(data.mapGeom); + } else { + $('.document [data-geom]').each(function() { + try { + var currentBounds = L.geoJSONToBounds($(this).data().geom); + if (!world.contains(currentBounds)) { + throw "Invalid bounds"; + } + if (typeof bbox === 'undefined') { + bbox = currentBounds; + } else { + bbox.extend(currentBounds); + } + } catch (e) { + bbox = L.bboxToBounds("-180 -90 180 90"); + } + }); + } + + if (!historySupported) { + $.extend(opts, { + dynamic: false, + searcher: function() { + window.location.href = this.getSearchUrl(); + } + }); + } + + // instantiate new map + geoblacklight = new GeoBlacklight.Viewer.Map(this, { bbox: bbox }); + + var markers = L.markerClusterGroup(); + + // Send Oboe to admin/api for non-web-ui attributes like centroid + // Not usingURL() to maintain legacy IE support + url = document.createElement('a'); + url.href = window.location.href; + url.pathname = '/admin/api.json' + // Oboe - Re-query Solr for JSON results + oboe(url.toString() + '&format=json&per_page=100&rows=100') + .node('data.*', function( doc ){ + if(typeof doc['attributes']['dcat_centroid'] != 'undefined'){ + var latlng = doc['attributes']['dcat_centroid']['attributes']['value'].split(",") + markers.addLayer(L.marker([latlng[0],latlng[1]]).bindPopup("" + doc['attributes']['dct_title_s']['attributes']['value'] + "")); + } + } + ) + .done(function(){ + geoblacklight.map.addLayer(markers); + }) + + // set hover listeners on map + $('#content') + .on('mouseenter', '#documents [data-layer-id]', function() { + if($(this).data('bbox') !== "") { + var geom = $(this).data('geom') + geoblacklight.addGeoJsonOverlay(geom) + } + }) + .on('mouseleave', '#documents [data-layer-id]', function() { + geoblacklight.removeBoundsOverlay(); + }); + + // add geosearch control to map + geoblacklight.map.addControl(L.control.geosearch(opts)); + + // B1G Customizations + // fullscreen control + // basemaps control + + // leaflet-geosearch + var GeoSearchControl = window.GeoSearch.GeoSearchControl; + var OpenStreetMapProvider = window.GeoSearch.OpenStreetMapProvider; + var provider = new OpenStreetMapProvider(); + var searchControl = new GeoSearchControl({ + provider: provider, + }); + geoblacklight.map.addControl(searchControl); + }); + + function updatePage(url) { + $.get(url).done(function(data) { + var resp = $.parseHTML(data); + $doc = $(resp); + $('#documents').replaceWith($doc.find('#documents')); + $('#sidebar').replaceWith($doc.find('#sidebar')); + $('#sortAndPerPage').replaceWith($doc.find('#sortAndPerPage')); + $('#appliedParams').replaceWith($doc.find('#appliedParams')); + $('#pagination').replaceWith($doc.find('#pagination')); + if ($('#map').next().length) { + $('#map').next().replaceWith($doc.find('#map').next()); + } else { + $('#map').after($doc.find('#map').next()); + } + }); + } +}); diff --git a/app/assets/javascripts/geoportal/viewers/map.js b/app/assets/javascripts/geoportal/viewers/map.js index 92d98376a..51e997c02 100644 --- a/app/assets/javascripts/geoportal/viewers/map.js +++ b/app/assets/javascripts/geoportal/viewers/map.js @@ -14,6 +14,7 @@ GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({ }, overlay: L.layerGroup(), + markers: L.layerGroup(), load: function() { console.log('MAP: local and customized'); @@ -24,6 +25,7 @@ GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({ this.map = L.map(this.element, { noWrap: true }).fitBounds(this.options.bbox); this.map.addLayer(this.selectBasemap()); this.map.addLayer(this.overlay); + this.map.addLayer(this.markers); if (this.data.map !== 'index') { this.addBoundsOverlay(this.options.bbox); } @@ -112,5 +114,56 @@ GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({ this.map.on('baselayerchange', function (e) { Cookies.set('basemap', e.name) }); + }, + + removeMarkers: function() { + this.markers.clearLayers(); + }, + + setHoverListeners: function() { + $('[data-map="index"]').each(function(i, element) { + $('#content') + .on('mouseenter', '#documents [data-layer-id]', function() { + var geom = $(this).data('geom') + GeoBlacklight.Home.addGeoJsonOverlay(geom); + }) + .on('mouseleave', '#documents [data-layer-id]', function() { + GeoBlacklight.Home.removeBoundsOverlay(); + }); + }); + }, + + placeMarkers: function() { + // Clear existing markers + GeoBlacklight.Home.removeMarkers(); + + $('.document [data-geom]').each(function() { + var _this = $(this), + currentBbox = _this.data().geom, + layerId = _this.data().layerId; + counter = _this.data().counter, + redMarker = L.ExtraMarkers.icon({ + innerHTML: '

' + counter + '

', + markerColor: 'blue', + shape: 'square', + prefix: 'fa' + }); + + if (currentBbox) { + var bounds = L.geoJSONToBounds(currentBbox); + var marker = L.marker(bounds.getCenter(), {icon: redMarker}); + + // Add marker to map + marker.addTo(GeoBlacklight.Home.markers); + + // Set scroll click event on marker + marker.on('click', function() { + console.log("Clicked - " + JSON.stringify(_this.offset())); + $( ".document .selected" ).removeClass( "selected" ); + $('html, body').animate({scrollTop: _this.offset().top - 120}, 200); + $( _this ).addClass( "selected" ); + }); + } + }); } }); diff --git a/app/assets/stylesheets/_geoportal.scss b/app/assets/stylesheets/_geoportal.scss index ac2b1beee..48f0a7b83 100644 --- a/app/assets/stylesheets/_geoportal.scss +++ b/app/assets/stylesheets/_geoportal.scss @@ -7,6 +7,7 @@ $link-color:#005E8E; @import 'Leaflet.fullscreen/leaflet.fullscreen'; @import 'leaflet.markercluster/MarkerCluster'; @import 'leaflet.prunecluster/LeafletStyleSheet'; +@import 'leaflet.extra-markers/leaflet.extra-markers'; /* ------- customize primary buttons -------- */ $mynewcolor:#005E8E; @@ -120,3 +121,9 @@ $mynewcolor:#005E8E; .geoblacklight-vector:before { content: "\f131"; } $font-geoblacklight-icons-vector: "\f131"; + +div.media-body { + p { + padding: 0.25rem 0.75rem; + } +} diff --git a/app/assets/stylesheets/leaflet.extra-markers/leaflet.extra-markers.css.erb b/app/assets/stylesheets/leaflet.extra-markers/leaflet.extra-markers.css.erb new file mode 100644 index 000000000..dd51c9a88 --- /dev/null +++ b/app/assets/stylesheets/leaflet.extra-markers/leaflet.extra-markers.css.erb @@ -0,0 +1,218 @@ +.extra-marker{ + background:url('<%= asset_url('markers_default.png') %>') no-repeat 0 0; + width:35px; + height:46px; + position:absolute; + left:0; + top:0; + display:block; + text-align:center +} +.extra-marker-shadow{ + background:url('<%= asset_url('markers_shadow.png') %>') no-repeat 0 0; + width:36px; + height:16px +} +@media (min--moz-device-pixel-ratio:1.5),(-webkit-min-device-pixel-ratio:1.5),(min-device-pixel-ratio:1.5),(min-resolution:1.5dppx){ + .extra-marker{ + background-image:url('<%= asset_url('markers_default@2x.png') %>'); + background-size:540px 184px + } + .extra-marker-shadow{ + background-image:url('<%= asset_url('markers_shadow@2x.png') %>'); + background-size:35px 16px + } +} +.extra-marker i{ + color:#fff; + margin-top:10px; + display:inline-block; + font-size:14px +} +.extra-marker i.icon{ + margin-right:0; + opacity:1 +} +.extra-marker-circle-red{ + background-position:0 0 +} +.extra-marker-circle-orange-dark{ + background-position:-36px 0 +} +.extra-marker-circle-orange{ + background-position:-72px 0 +} +.extra-marker-circle-yellow{ + background-position:-108px 0 +} +.extra-marker-circle-blue-dark{ + background-position:-144px 0 +} +.extra-marker-circle-blue{ + background-position:-180px 0 +} +.extra-marker-circle-cyan{ + background-position:-216px 0 +} +.extra-marker-circle-purple{ + background-position:-252px 0 +} +.extra-marker-circle-violet{ + background-position:-288px 0 +} +.extra-marker-circle-pink{ + background-position:-324px 0 +} +.extra-marker-circle-green-dark{ + background-position:-360px 0 +} +.extra-marker-circle-green{ + background-position:-396px 0 +} +.extra-marker-circle-green-light{ + background-position:-432px 0 +} +.extra-marker-circle-black{ + background-position:-468px 0 +} +.extra-marker-circle-white{ + background-position:-504px 0 +} +.extra-marker-square-red{ + background-position:0 -46px +} +.extra-marker-square-orange-dark{ + background-position:-36px -46px +} +.extra-marker-square-orange{ + background-position:-72px -46px +} +.extra-marker-square-yellow{ + background-position:-108px -46px +} +.extra-marker-square-blue-dark{ + background-position:-144px -46px +} +.extra-marker-square-blue{ + background-position:-180px -46px +} +.extra-marker-square-cyan{ + background-position:-216px -46px +} +.extra-marker-square-purple{ + background-position:-252px -46px +} +.extra-marker-square-violet{ + background-position:-288px -46px +} +.extra-marker-square-pink{ + background-position:-324px -46px +} +.extra-marker-square-green-dark{ + background-position:-360px -46px +} +.extra-marker-square-green{ + background-position:-396px -46px +} +.extra-marker-square-green-light{ + background-position:-432px -46px +} +.extra-marker-square-black{ + background-position:-468px -46px +} +.extra-marker-square-white{ + background-position:-504px -46px +} +.extra-marker-star-red{ + background-position:0 -92px +} +.extra-marker-star-orange-dark{ + background-position:-36px -92px +} +.extra-marker-star-orange{ + background-position:-72px -92px +} +.extra-marker-star-yellow{ + background-position:-108px -92px +} +.extra-marker-star-blue-dark{ + background-position:-144px -92px +} +.extra-marker-star-blue{ + background-position:-180px -92px +} +.extra-marker-star-cyan{ + background-position:-216px -92px +} +.extra-marker-star-purple{ + background-position:-252px -92px +} +.extra-marker-star-violet{ + background-position:-288px -92px +} +.extra-marker-star-pink{ + background-position:-324px -92px +} +.extra-marker-star-green-dark{ + background-position:-360px -92px +} +.extra-marker-star-green{ + background-position:-396px -92px +} +.extra-marker-star-green-light{ + background-position:-432px -92px +} +.extra-marker-star-black{ + background-position:-468px -92px +} +.extra-marker-star-white{ + background-position:-504px -92px +} +.extra-marker-penta-red{ + background-position:0 -138px +} +.extra-marker-penta-orange-dark{ + background-position:-36px -138px +} +.extra-marker-penta-orange{ + background-position:-72px -138px +} +.extra-marker-penta-yellow{ + background-position:-108px -138px +} +.extra-marker-penta-blue-dark{ + background-position:-144px -138px +} +.extra-marker-penta-blue{ + background-position:-180px -138px +} +.extra-marker-penta-cyan{ + background-position:-216px -138px +} +.extra-marker-penta-purple{ + background-position:-252px -138px +} +.extra-marker-penta-violet{ + background-position:-288px -138px +} +.extra-marker-penta-pink{ + background-position:-324px -138px +} +.extra-marker-penta-green-dark{ + background-position:-360px -138px +} +.extra-marker-penta-green{ + background-position:-396px -138px +} +.extra-marker-penta-green-light{ + background-position:-432px -138px +} +.extra-marker-penta-black{ + background-position:-468px -138px +} +.extra-marker-penta-white{ + background-position:-504px -138px +} +.extra-marker .fa-number:before{ + content:attr(number) +} diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index f11f297a8..1cb33a783 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -36,15 +36,20 @@ class CatalogController < ApplicationController config.advanced_search[:form_solr_parameters]['facet.limit'] ||= -1 config.advanced_search[:form_solr_parameters]['facet.sort'] ||= 'index' + # @See: https://github.com/geobtaa/geoportal/issues/471 + # The 'facet.limit' -1 value is not respected here, catalog_controller.rb configuration facet limits are still passed along to Solr. This manually adjusts the facet count to -1 for schema_provider_s and gbl_resourceType_sm + config.advanced_search[:form_solr_parameters]['f.schema_provider_s.facet.limit'] ||= -1 + config.advanced_search[:form_solr_parameters]['f.gbl_resourceType_sm.facet.limit'] ||= -1 + # GeoBlacklight Defaults # * Adds the "map" split view for catalog#index - config.view.split(partials: ['index']) + # config.view.split(partials: ['index']) config.view.delete_field('list') # Map views config.view.mapview.partials = [:index] - config.view['split'].title = "List view" - config.view['mapview'].title = "Map view" + # config.view['split'].title = "List view" + # config.view['mapview'].title = "Map view" config.raw_endpoint.enabled = true @@ -57,7 +62,7 @@ class CatalogController < ApplicationController 'fq' => ["#{Settings.FIELDS.B1G_PUBLICATION_STATE}:published"] } - config.default_per_page = 20 # Works! + config.default_per_page = 10 # Works! ## Default parameters to send on single-document requests to Solr. These settings are the Blackligt defaults (see SolrHelper#solr_doc_params) or ## parameters included in the Blacklight-jetty document requestHandler. @@ -151,7 +156,7 @@ class CatalogController < ApplicationController # filter_query_builder - Defines the query generated for Solr # filter_class - Defines how to add/remove facet from query # label - Defines the label used in contstraints container - config.add_facet_field Settings.FIELDS.GEOMETRY, item_presenter: Geoblacklight::BboxItemPresenter, filter_class: Geoblacklight::BboxFilterField, filter_query_builder: Geoblacklight::BboxFilterQuery, within_boost: Settings.BBOX_WITHIN_BOOST, overlap_boost: Settings.OVERLAP_RATIO_BOOST, overlap_field: Settings.FIELDS.OVERLAP_FIELD, label: 'Bounding Box' + config.add_facet_field 'solr_bboxtype', item_presenter: Geoblacklight::BboxItemPresenter, filter_class: Geoblacklight::BboxFilterField, filter_query_builder: Geoblacklight::BboxFilterQuery, within_boost: Settings.BBOX_WITHIN_BOOST, overlap_boost: Settings.OVERLAP_RATIO_BOOST, overlap_field: Settings.FIELDS.OVERLAP_FIELD, label: 'Bounding Box' # Item Relationship Facets # * Not displayed to end user (show: false) diff --git a/app/helpers/blacklight/layout_helper_behavior.rb b/app/helpers/blacklight/layout_helper_behavior.rb new file mode 100644 index 000000000..12cbd8669 --- /dev/null +++ b/app/helpers/blacklight/layout_helper_behavior.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Methods added to this helper will be available to all templates in the hosting +# application +module Blacklight + # A module for useful methods used in layout configuration + module LayoutHelperBehavior + ## + # Classes added to a document's show content div + # @return [String] + def show_content_classes + "#{main_content_classes} show-document" + end + + ## + # Attributes to add to the tag (e.g. lang and dir) + # @return [Hash] + def html_tag_attributes + { lang: I18n.locale } + end + + ## + # Classes added to a document's sidebar div + # @return [String] + def show_sidebar_classes + sidebar_classes + end + + ## + # Classes used for sizing the main content of a Blacklight page + # @return [String] + def main_content_classes + 'col-lg-9' + end + + ## + # Classes used for sizing the sidebar content of a Blacklight page + # @return [String] + def sidebar_classes + 'page-sidebar col-lg-3' + end + + ## + # Class used for specifying main layout container classes. Can be + # overwritten to return 'container-fluid' for Bootstrap full-width layout + # @return [String] + def container_classes + controller.action_name == "show" ? 'container' : 'container-fluid' + end + end +end diff --git a/app/views/catalog/_document_mapview.html.erb b/app/views/catalog/_document_mapview.html.erb index 732cbd194..9922ec938 100644 --- a/app/views/catalog/_document_mapview.html.erb +++ b/app/views/catalog/_document_mapview.html.erb @@ -2,5 +2,5 @@
<%= render documents, :as => :document %>
- <%= content_tag :div, '', id: 'map', class: 'col-md-6', data: { map: 'index', 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %> + <%= content_tag :div, '', id: 'map', class: 'col-md-6 sticky-top position-sticky', data: { map: 'index', 'catalog-path'=> search_catalog_path , 'map-bbox' => params[:bbox], basemap: geoblacklight_basemap, leaflet_options: leaflet_options } %> diff --git a/app/views/catalog/_index_mapview_default.html.erb b/app/views/catalog/_index_mapview_default.html.erb index 9041d1aa6..7e8ef681a 100644 --- a/app/views/catalog/_index_mapview_default.html.erb +++ b/app/views/catalog/_index_mapview_default.html.erb @@ -1,5 +1,6 @@ <% # header bar for doc items in index view -%> -<%= content_tag :div, class: 'documentHeader index-split row', data: { layer_id: document.id, geom: document.geometry.geojson } do %> +<% counter = document_counter_with_offset(document_counter) %> +<%= content_tag :div, class: 'documentHeader index-split row', data: { layer_id: document.id, geom: document.geometry.geojson, counter: counter } do %>

<% counter = document_counter_with_offset(document_counter) %> @@ -7,22 +8,24 @@ <%= link_to_document document, counter: counter %>

- - - -<% end %> - -
-
- - <%= geoblacklight_present(:index_fields_display, document) %> - +
+
+
+ <%- if document.sidecar.image.attached? %> + <%- if document.sidecar.image.variable? %> + <%= image_tag document.sidecar.image.variant(resize: "200"), {class: 'mr-3'} %> + <%- else %> + <%= image_tag document.sidecar.image, {class: 'mr-3'} %> + <%- end %> + <%- else %> + + <%= geoblacklight_icon(document[Settings.FIELDS.RESOURCE_CLASS]&.first, classes: 'svg_tooltip') %> + + <%- end %> +
+

<%= geoblacklight_present(:index_fields_display, document) %>

+
+
+
-
+<% end %> diff --git a/app/views/catalog/_index_split_default.html.erb b/app/views/catalog/_index_split_default.html.erb deleted file mode 100644 index b8c7270e2..000000000 --- a/app/views/catalog/_index_split_default.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<% # header bar for doc items in index view -%> -<%= content_tag :div, class: 'documentHeader row', data: { layer_id: document.id, geom: document.geometry.geojson } do %> -
- <% counter = document_counter_with_offset(document_counter) %> - - <%= t('blacklight.search.documents.counter', :counter => counter) if counter %> - -
-
- <%- if document.sidecar.image.attached? %> - <%- if document.sidecar.image.variable? %> - <%= image_tag document.sidecar.image.variant(resize: "200"), {class: 'mr-3'} %> - <%- else %> - <%= image_tag document.sidecar.image, {class: 'mr-3'} %> - <%- end %> - <%- else %> - - <%= geoblacklight_icon(document[Settings.FIELDS.RESOURCE_CLASS]&.first, classes: 'svg_tooltip') %> - - <%- end %> -
-

<%= link_to_document document, counter: counter, title: document[blacklight_config.index.title_field] %> -

-

<%= geoblacklight_present(:index_fields_display, document) %>

-
-
-
-
-<% end %> diff --git a/app/views/shared/_footer_app.html.haml b/app/views/shared/_footer_app.html.haml index 258957882..36830a97d 100644 --- a/app/views/shared/_footer_app.html.haml +++ b/app/views/shared/_footer_app.html.haml @@ -1,6 +1,6 @@ -%div.container +%div.container-fluid %div.row - %div#footer-app.col-xs-12 + %div#footer-app.col-xs-12.col-lg-12 %h3 Big Ten Academic Alliance Geoportal %ul.list-horizontal %li @@ -13,4 +13,3 @@ %a{href:'http://www.btaa.org'} Big Ten Academic Alliance Homepage %li = link_to image_tag('twitter-logo.png', alt: 'Follow @geobtaa on Twitter') + ' Follow @geobtaa', 'https://twitter.com/geobtaa' - diff --git a/app/views/shared/_footer_umn.html.haml b/app/views/shared/_footer_umn.html.haml index bbb8d37de..2209c23ae 100644 --- a/app/views/shared/_footer_umn.html.haml +++ b/app/views/shared/_footer_umn.html.haml @@ -1,6 +1,6 @@ -%div.container +%div.container-fluid %div.row - %div#footer-lib.col-xs-12 + %div#footer-lib.col-xs-12.col-lg-12 %div.pull-left %p The technical infrastructure for this project is provided by the University of Minnesota Libraries Web Development department. diff --git a/app/views/shared/_header_navbar.html.erb b/app/views/shared/_header_navbar.html.erb index 36bb467eb..eabbe3156 100644 --- a/app/views/shared/_header_navbar.html.erb +++ b/app/views/shared/_header_navbar.html.erb @@ -28,7 +28,7 @@ <% if controller_name == 'catalog' && has_search_parameters? %>