From 7ee976f0985e1bd3ea5a12e83eaf19ffb1ef9462 Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo Date: Thu, 3 Sep 2015 17:06:29 -0300 Subject: [PATCH] Replaced twitter-bootstrap-rails by railstrap --- Gemfile | 3 ++- Gemfile.lock | 16 +++++----------- app/assets/javascripts/application.js | 2 +- app/assets/javascripts/bootstrap.js.coffee | 10 ++++++++++ app/assets/stylesheets/bootstrap_and_overrides.css | 61 ------------------------------------------------------------- app/assets/stylesheets/bootstrap_and_overrides.css.less | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ config/locales/en.railsstrap.yml | 23 +++++++++++++++++++++++ 7 files changed, 136 insertions(+), 74 deletions(-) delete mode 100644 app/assets/stylesheets/bootstrap_and_overrides.css create mode 100644 app/assets/stylesheets/bootstrap_and_overrides.css.less create mode 100644 config/locales/en.railsstrap.yml diff --git a/Gemfile b/Gemfile index e253242..ae82b45 100644 --- a/Gemfile +++ b/Gemfile @@ -34,7 +34,8 @@ gem 'kalibro_client', '~> 1.3.0' gem "pg", "~> 0.18.1" # Twitter Bootstrap for layout -gem 'twitter-bootstrap-rails', :git => 'https://github.com/seyhunak/twitter-bootstrap-rails.git' +gem 'less-rails', '~> 2.7.0' +gem 'railsstrap', '~> 3.3.4' # Chart generation gem "chart-js-rails", "~> 0.0.6" diff --git a/Gemfile.lock b/Gemfile.lock index d7aa513..3133835 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,13 +1,3 @@ -GIT - remote: https://github.com/seyhunak/twitter-bootstrap-rails.git - revision: a889e2d6e6527b94234b88f0c6b635d29d8e7ae8 - specs: - twitter-bootstrap-rails (3.2.1) - actionpack (>= 3.1) - execjs (>= 2.2.2, >= 2.2) - less-rails (>= 2.5.0) - railties (>= 3.1) - GEM remote: https://rubygems.org/ specs: @@ -235,6 +225,9 @@ GEM rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.2) loofah (~> 2.0) + railsstrap (3.3.4) + actionpack (>= 3.1) + therubyracer railties (4.2.4) actionpack (= 4.2.4) activesupport (= 4.2.4) @@ -357,11 +350,13 @@ DEPENDENCIES js-routes (~> 1.1.0) kalibro_client (~> 1.3.0) konacha + less-rails (~> 2.7.0) mocha pg (~> 0.18.1) poltergeist (~> 1.6.0) rails (= 4.2.4) rails-html-sanitizer (~> 1.0) + railsstrap (~> 3.3.4) rspec-rails (~> 3.3.2) sass-rails (~> 5.0.0) sdoc (~> 0.4.0) @@ -374,7 +369,6 @@ DEPENDENCIES therubyracer thin turbolinks - twitter-bootstrap-rails! uglifier (>= 1.3.0) web-console (~> 2.0.0) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index bda22cf..2a3ae63 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,8 +12,8 @@ // //= require jquery //= require jquery_ujs +//= require bootstrap/dist/js/bootstrap //= require jquery-ui -//= require twitter/bootstrap //= require turbolinks //= require modules //= require repository diff --git a/app/assets/javascripts/bootstrap.js.coffee b/app/assets/javascripts/bootstrap.js.coffee index 9440679..a43bf99 100644 --- a/app/assets/javascripts/bootstrap.js.coffee +++ b/app/assets/javascripts/bootstrap.js.coffee @@ -1,3 +1,13 @@ jQuery -> $("a[rel~=popover], .has-popover").popover() $("a[rel~=tooltip], .has-tooltip").tooltip() + +# # comment this out if you want to add the animation to an element. You may need to handle events for them to work correctly. +# # This is just a generic example, your mileage will vary depending on what you're trying to do. +# $("[data-animation]") -> +# e.preventDefault() +# if $(this).data("animation")? +# $(this).next().removeClass($(this).data("easein")).addClass "animated " + $(this).data("easein") +# else +# $(this).next().addClass "animated " + _easeIn +# return diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css b/app/assets/stylesheets/bootstrap_and_overrides.css deleted file mode 100644 index b5b7b06..0000000 --- a/app/assets/stylesheets/bootstrap_and_overrides.css +++ /dev/null @@ -1,61 +0,0 @@ -/* - =require twitter-bootstrap-static/bootstrap - - Use Font Awesome icons (default) - To use Glyphicons sprites instead of Font Awesome, replace with "require twitter-bootstrap-static/sprites" - =require twitter-bootstrap-static/fontawesome - */ - -footer div { - width: 50%; -} - -.footer-right { - float: right; - text-align: right; -} - -.footer-left { - float: left; -} - -#error_explanation { - background-color: #F2DEDE; - border-color: #EED3D7; - color: #B94A48; - border-radius: 4px 4px 4px 4px; - margin-bottom: 20px; - padding: 8px 35px 8px 14px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); -} - -.field_with_errors .control-label{ - color: #B94A48; -} - -.field_with_errors .form-control{ - border-color: #B94A48; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset; -} - -.popover-title{ - font-weight: bolder; -} - -.jquery-ui-accordion{ - line-height: normal; /*overrides h3 line-height specifically for the accordion ones*/ -} - -.nav-header{ - display: block; - padding: 3px 15px; - font-size: 11px; - font-weight: bold; - line-height: 20px; - color: #999999; - text-transform: uppercase; -} - -dd { - margin-left: 40px !important; -} diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less new file mode 100644 index 0000000..588c82e --- /dev/null +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -0,0 +1,95 @@ +/* + Bootstrap + This line imports bootstrap, modified to use glyphicons from Cloudflare CDN. +*/ +@import "bootstrap"; + +/* + Glyphicons - included by default in bootstrap. + If for any reason you prefer to have them as part of the asset pipeline, uncomment this. + If you choose to use this, open config/initializers/assets.rb (rails 4) and add this line: + Rails.application.config.assets.precompile += %w( *.eot *.woff *.ttf *.svg ) +*/ + +// @import "glyphicons"; + +/* + FontAwesome is hosted via CDN as well. If you prefer to have them included in the asset + pipeline, comment this out and see the next section. +*/ +@import 'fontawesome'; + +/* + Font Awesome + If for some reason you want fontawesome as part of the asset pipeline, comment out + the above refererence and uncomment the following lines. If you choose to use this, open + config/initializers/assets.rb (rails 4) and add this line: + Rails.application.config.assets.precompile += %w( *.eot *.woff *.ttf *.svg ) +*/ + +//@import 'fontawesome-local'; + +//If you want exotic placement features, animations, and more, import this: +@import "railsstrap"; + +/* + Date and Time Picker (https://github.com/toadkicker/railsstrap/wiki/Date-and-Time-Picker) + To enable the date and time picker, uncomment this line: + Don't forget to include the javascript library as well. +*/ + +//@import "datepicker/datepicker"; + +footer div { + width: 50%; +} + +.footer-right { + float: right; + text-align: right; +} + +.footer-left { + float: left; +} + +#error_explanation { + background-color: #F2DEDE; + border-color: #EED3D7; + color: #B94A48; + border-radius: 4px 4px 4px 4px; + margin-bottom: 20px; + padding: 8px 35px 8px 14px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); +} + +.field_with_errors .control-label{ + color: #B94A48; +} + +.field_with_errors .form-control{ + border-color: #B94A48; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset; +} + +.popover-title{ + font-weight: bolder; +} + +.jquery-ui-accordion{ + line-height: normal; /*overrides h3 line-height specifically for the accordion ones*/ +} + +.nav-header{ + display: block; + padding: 3px 15px; + font-size: 11px; + font-weight: bold; + line-height: 20px; + color: #999999; + text-transform: uppercase; +} + +dd { + margin-left: 40px !important; +} diff --git a/config/locales/en.railsstrap.yml b/config/locales/en.railsstrap.yml new file mode 100644 index 0000000..8d75119 --- /dev/null +++ b/config/locales/en.railsstrap.yml @@ -0,0 +1,23 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + breadcrumbs: + application: + root: "Index" + pages: + pages: "Pages" + helpers: + actions: "Actions" + links: + back: "Back" + cancel: "Cancel" + confirm: "Are you sure?" + destroy: "Delete" + new: "New" + edit: "Edit" + titles: + edit: "Edit %{model}" + save: "Save %{model}" + new: "New %{model}" + delete: "Delete %{model}" -- libgit2 0.21.2