From 4b8deec047ffd0d9f3963a3aa4da30faf250beed Mon Sep 17 00:00:00 2001 From: Philipp Fischbeck Date: Wed, 10 Dec 2014 16:19:12 +0100 Subject: [PATCH 1/4] Remove twitter-bootstrap-rails gem --- Gemfile | 2 -- Gemfile.lock | 6 ----- app/assets/javascripts/application.js | 1 - app/assets/javascripts/bootstrap.js.coffee | 3 --- .../stylesheets/bootstrap_and_overrides.css | 7 ------ config/locales/en.bootstrap.yml | 23 ------------------- 6 files changed, 42 deletions(-) delete mode 100644 app/assets/javascripts/bootstrap.js.coffee delete mode 100644 app/assets/stylesheets/bootstrap_and_overrides.css delete mode 100644 config/locales/en.bootstrap.yml diff --git a/Gemfile b/Gemfile index bfaffad..54edc1b 100644 --- a/Gemfile +++ b/Gemfile @@ -23,8 +23,6 @@ gem 'jbuilder', '~> 2.0' # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc -gem 'twitter-bootstrap-rails' - gem 'will_paginate', '~> 3.0.6' gem 'will_paginate-bootstrap' diff --git a/Gemfile.lock b/Gemfile.lock index 4676a3b..e5af27d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -97,11 +97,6 @@ GEM tilt (1.4.1) turbolinks (2.5.2) coffee-rails - twitter-bootstrap-rails (3.2.0) - actionpack (~> 4.1) - execjs (~> 2.2) - rails (~> 4.1) - railties (~> 4.1) tzinfo (1.2.2) thread_safe (~> 0.1) tzinfo-data (1.2014.10) @@ -125,7 +120,6 @@ DEPENDENCIES sdoc (~> 0.4.0) sqlite3 turbolinks - twitter-bootstrap-rails tzinfo-data uglifier (>= 1.3.0) will_paginate (~> 3.0.6) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 3885622..d6925fa 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,6 +12,5 @@ // //= require jquery //= require jquery_ujs -//= require twitter/bootstrap //= require turbolinks //= require_tree . diff --git a/app/assets/javascripts/bootstrap.js.coffee b/app/assets/javascripts/bootstrap.js.coffee deleted file mode 100644 index 9440679..0000000 --- a/app/assets/javascripts/bootstrap.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -jQuery -> - $("a[rel~=popover], .has-popover").popover() - $("a[rel~=tooltip], .has-tooltip").tooltip() diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css b/app/assets/stylesheets/bootstrap_and_overrides.css deleted file mode 100644 index 131fcfd..0000000 --- a/app/assets/stylesheets/bootstrap_and_overrides.css +++ /dev/null @@ -1,7 +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 - */ \ No newline at end of file diff --git a/config/locales/en.bootstrap.yml b/config/locales/en.bootstrap.yml deleted file mode 100644 index 8d75119..0000000 --- a/config/locales/en.bootstrap.yml +++ /dev/null @@ -1,23 +0,0 @@ -# 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}" From 5bbf385fdfe18d62d85080fdb73fc798af99c42c Mon Sep 17 00:00:00 2001 From: Philipp Fischbeck Date: Wed, 10 Dec 2014 16:55:17 +0100 Subject: [PATCH 2/4] Use 'bootstrap-sass' gem --- Gemfile | 3 +++ Gemfile.lock | 6 ++++++ app/assets/javascripts/application.js | 1 + .../stylesheets/{application.css => application.css.scss} | 3 +++ app/assets/stylesheets/problems.css.scss | 2 +- config/initializers/assets.rb | 2 +- 6 files changed, 15 insertions(+), 2 deletions(-) rename app/assets/stylesheets/{application.css => application.css.scss} (92%) diff --git a/Gemfile b/Gemfile index 54edc1b..7b65240 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,9 @@ gem 'jbuilder', '~> 2.0' # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc +gem 'bootstrap-sass', '~> 3.3.1' +gem 'autoprefixer-rails' + gem 'will_paginate', '~> 3.0.6' gem 'will_paginate-bootstrap' diff --git a/Gemfile.lock b/Gemfile.lock index e5af27d..a9737f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -28,6 +28,10 @@ GEM thread_safe (~> 0.1) tzinfo (~> 1.1) arel (5.0.1.20140414130214) + autoprefixer-rails (4.0.2.1) + execjs + bootstrap-sass (3.3.1.0) + sass (~> 3.2) builder (3.2.2) coffee-rails (4.0.1) coffee-script (>= 2.2.0) @@ -112,6 +116,8 @@ PLATFORMS x86-mingw32 DEPENDENCIES + autoprefixer-rails + bootstrap-sass (~> 3.3.1) coffee-rails (~> 4.0.0) jbuilder (~> 2.0) jquery-rails diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d6925fa..6ef234e 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -13,4 +13,5 @@ //= require jquery //= require jquery_ujs //= require turbolinks +//= require bootstrap-sprockets //= require_tree . diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css.scss similarity index 92% rename from app/assets/stylesheets/application.css rename to app/assets/stylesheets/application.css.scss index a443db3..4b83bcd 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css.scss @@ -13,3 +13,6 @@ *= require_tree . *= require_self */ + +@import "bootstrap-sprockets"; +@import "bootstrap"; diff --git a/app/assets/stylesheets/problems.css.scss b/app/assets/stylesheets/problems.css.scss index 440f713..7f0de10 100644 --- a/app/assets/stylesheets/problems.css.scss +++ b/app/assets/stylesheets/problems.css.scss @@ -1,3 +1,3 @@ // Place all the styles related to the Problems controller here. -// They will automatically be included in application.css. +// They will automatically be included in application.css.scss. // You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index d2f4ec3..ab212d0 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -4,5 +4,5 @@ Rails.application.config.assets.version = '1.0' # Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# application.js, application.css.scss, and all non-JS/CSS in app/assets folder are already added. # Rails.application.config.assets.precompile += %w( search.js ) From 5bbed9573c52ec7ae1e54756488801ad9cd4111a Mon Sep 17 00:00:00 2001 From: Philipp Fischbeck Date: Wed, 10 Dec 2014 17:14:03 +0100 Subject: [PATCH 3/4] Use bh gem (bootstrap helpers), make use of it for navbar --- Gemfile | 2 ++ Gemfile.lock | 4 ++++ app/views/layouts/application.html.erb | 11 ++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 7b65240..e15701c 100644 --- a/Gemfile +++ b/Gemfile @@ -26,6 +26,8 @@ gem 'sdoc', '~> 0.4.0', group: :doc gem 'bootstrap-sass', '~> 3.3.1' gem 'autoprefixer-rails' +gem 'bh', '~> 1.2' + gem 'will_paginate', '~> 3.0.6' gem 'will_paginate-bootstrap' diff --git a/Gemfile.lock b/Gemfile.lock index a9737f6..2e78cb0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,6 +30,9 @@ GEM arel (5.0.1.20140414130214) autoprefixer-rails (4.0.2.1) execjs + bh (1.2.0) + actionpack + activesupport bootstrap-sass (3.3.1.0) sass (~> 3.2) builder (3.2.2) @@ -117,6 +120,7 @@ PLATFORMS DEPENDENCIES autoprefixer-rails + bh (~> 1.2) bootstrap-sass (~> 3.3.1) coffee-rails (~> 4.0.0) jbuilder (~> 2.0) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 713644b..a24b5e2 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,9 +7,14 @@ <%= csrf_meta_tags %> -<%= nav_bar :brand => 'Projekt Euler', :brand_link => root_path do %> - <%= menu_group do %> - <%= menu_item 'Probleme', problems_path %> +<%= navbar position: :static do %> + <%= vertical do %> + <%= link_to 'Projekt Euler', root_path %> + <% end %> + <%= horizontal do %> + <%= nav class: 'navbar-left' do %> + <%= link_to 'Probleme', problems_path %> + <% end %> <% end %> <% end %>
From dda5395fd98a72a0490b6239e6c7b1154a0ccd53 Mon Sep 17 00:00:00 2001 From: Philipp Fischbeck Date: Wed, 10 Dec 2014 17:27:17 +0100 Subject: [PATCH 4/4] Use bootstrap helper for problem content panel --- app/views/problems/show.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/problems/show.html.erb b/app/views/problems/show.html.erb index bdc91a0..e4a460d 100644 --- a/app/views/problems/show.html.erb +++ b/app/views/problems/show.html.erb @@ -6,10 +6,10 @@

<%= @problem.title %> Problem <%= @problem.id %>

-
-
- <%= sanitize @problem.content %> -
-
+<%= panel do %> +
+ <%= sanitize @problem.content %> +
+<% end %> <%= link_to 'Edit', edit_problem_path(@problem), class: 'btn btn-default' %>