From 43e3f408c1069023236e483ecb9da9117e2385bf Mon Sep 17 00:00:00 2001 From: Stefanni Date: Thu, 4 Apr 2019 12:48:22 -0700 Subject: [PATCH] Upgrade app to Bootstrap 4 (#480) --- Gemfile | 1 + Gemfile.lock | 2 + app/assets/bower.json | 2 +- app/assets/javascripts/application.js | 3 + app/assets/javascripts/maps.js | 2 + app/assets/stylesheets/header.css.scss | 59 +++------ app/assets/stylesheets/style.css.scss | 5 + app/views/author/list.html.erb | 16 +-- app/views/images/_new.html.erb | 16 +-- app/views/layouts/_header.html.erb | 55 ++++---- app/views/layouts/_login.html.erb | 32 ++--- app/views/layouts/_login_form.html.erb | 14 +- app/views/layouts/knitter2.html.erb | 132 ++++++++++++------- app/views/map/_list.html.erb | 3 +- app/views/maps/_edit.html.erb | 1 - app/views/maps/_exports.html.erb | 4 +- app/views/maps/_list.html.erb | 4 +- app/views/maps/_search.html.erb | 14 +- app/views/maps/_sidebar_annotations.html.erb | 4 +- app/views/maps/_sidebar_exports.html.erb | 16 ++- app/views/maps/index.html.erb | 16 +-- app/views/maps/new.html.erb | 6 +- app/views/maps/show.html.erb | 22 +--- app/views/tags/_index.html.erb | 39 +++--- app/views/users/profile.html.erb | 9 +- bower.json | 4 +- 26 files changed, 247 insertions(+), 234 deletions(-) diff --git a/Gemfile b/Gemfile index 6c0d4876b..ac4bee5e7 100644 --- a/Gemfile +++ b/Gemfile @@ -7,6 +7,7 @@ gem 'rake', '~> 12.3.2' gem "will_paginate", "3.1.7" gem "will_paginate-bootstrap" gem "friendly_id" +gem 'popper_js', '~> 1.11', '>= 1.11.1' # dependencies group :dependencies do diff --git a/Gemfile.lock b/Gemfile.lock index 0cfe48f13..c1bb57f05 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -102,6 +102,7 @@ GEM rack rake (>= 0.8.1) polyglot (0.3.5) + popper_js (1.14.5) power_assert (1.1.4) rack (1.4.7) rack-cache (1.8.0) @@ -199,6 +200,7 @@ DEPENDENCIES open_id_authentication paperclip (~> 4.3.7) passenger + popper_js (~> 1.11, >= 1.11.1) rails (~> 3.2) rake (~> 12.3.2) rdiscount (= 2.2.0.1) diff --git a/app/assets/bower.json b/app/assets/bower.json index a97e5995c..605644e21 100644 --- a/app/assets/bower.json +++ b/app/assets/bower.json @@ -10,7 +10,7 @@ "leaflet-illustrate": "manleyjster/Leaflet.Illustrate#master", "leaflet-image-distort": "manleyjster/ImageDistortLeaflet", - "bootstrap": "http://github.com/twbs/bootstrap/archive/v3.2.0.tar.gz", + "bootstrap": "https://github.com/twbs/bootstrap/archive/v4.3.1.zip", "blueimp-file-upload": "9.7.0", "blueimp-tmpl": "2.5.4", diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 068faeff6..fa2ef6103 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -11,6 +11,7 @@ // GO AFTER THE REQUIRES BELOW. // +//= require popper //= require jquery/dist/jquery.js //= require jquery-ujs/src/rails.js @@ -20,6 +21,8 @@ //= require leaflet-providers/leaflet-providers.js //= require leaflet-toolbar/dist/leaflet.toolbar.js //= require leaflet-distortableimage/dist/leaflet.distortableimage.js +//= require leaflet-easybutton/src/easy-button.js +//= require leaflet-google/index.js //= require sparklines/source/sparkline.js //= require annotations-legacy.js //= require glfx-js/dist/glfx.js diff --git a/app/assets/javascripts/maps.js b/app/assets/javascripts/maps.js index 40f6aac8f..295149c75 100644 --- a/app/assets/javascripts/maps.js +++ b/app/assets/javascripts/maps.js @@ -1,7 +1,9 @@ +//= require popper //= require jquery-ui/jquery-ui.min.js //= require knitter //= require exif-js/exif.js //= require mapknitter +//= require seiyria-bootstrap-slider/dist/bootstrap-slider.min.js /* Move navbar links into dropdown if nav is inside the sidebar. */ jQuery(document).ready(function($) { diff --git a/app/assets/stylesheets/header.css.scss b/app/assets/stylesheets/header.css.scss index 49e9631a6..0357ea4c0 100644 --- a/app/assets/stylesheets/header.css.scss +++ b/app/assets/stylesheets/header.css.scss @@ -1,50 +1,23 @@ body { - padding-top: 60px; + padding-top: 70px; } -/* override Bootstrap 3 navbar collapse for medium screen sizes */ -@media (max-width: 1200px) { - .navbar-header { - float: none; - } - - .navbar-left,.navbar-right { - float: none !important; - } - - .navbar-toggle { - display: block; - } - - .navbar-collapse { - border-top: 1px solid transparent; - box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); - } - - .navbar-fixed-top { - top: 0; - border-width: 0 0 1px; - } - - .navbar-collapse.collapse { - display: none !important; - } - - .navbar-nav { - float: none !important; - margin-top: 7.5px; - } +.login-links { + color: rgba(0,0,0,.7); + text-decoration: none; +} - .navbar-nav > li { - float: none; - } +.login-links:visited { + color: rgba(0,0,0,.7); + text-decoration: none; +} - .navbar-nav > li > a { - padding-top: 10px; - padding-bottom: 10px; - } +.login-links:hover { + color: rgba(0,0,0,.7); + text-decoration: underline; +} - .collapse.in{ - display:block !important; - } +.login-links:active { + color: rgba(0,0,0,.7); + text-decoration: underline; } \ No newline at end of file diff --git a/app/assets/stylesheets/style.css.scss b/app/assets/stylesheets/style.css.scss index 437b36704..65a358425 100644 --- a/app/assets/stylesheets/style.css.scss +++ b/app/assets/stylesheets/style.css.scss @@ -25,6 +25,11 @@ It was originally created by Caroline Hadilaksono: http://www.hadilaksono.com font-style: normal; } +.login-form { + width: 200px; + padding-left: 20px; +} + /* Application-wide styles */ h1, h2, h3, h4 { font-family: 'Junction Light', lucida grande,lucida sans console,sans-serif; diff --git a/app/views/author/list.html.erb b/app/views/author/list.html.erb index ebb2808f7..d7af6b3fc 100644 --- a/app/views/author/list.html.erb +++ b/app/views/author/list.html.erb @@ -1,13 +1,13 @@
- <% @maps.each do |map| %> -

<%= map.name.capitalize %> - - by "<%= map.author %>" - <% if map.email != '' %><<%= map.email %>>, <% end %> - -

- <% end %> + <% @maps.each do |map| %> +

<%= map.name.capitalize %> + + by "<%= map.author %>" + <% if map.email != '' %><<%= map.email %>>, <% end %> + +

+ <% end %>
+ \ No newline at end of file diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index a33847a41..fdd1e52ad 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -1,33 +1,36 @@ -