Ver código fonte

Replaces Boostrap 3 with Bootstrap 4

Jason Charnes 7 anos atrás
pai
commit
efb8c4a76d

+ 0 - 1
app/assets/stylesheets/application.scss

@@ -2,6 +2,5 @@
 // $light-orange: #ff8c00;
 // $navbar-default-color: $light-orange;
 
-@import "bootstrap-sprockets";
 @import "bootstrap";
 // @import "home";

+ 1 - 0
app/views/home/index.html.erb

@@ -1 +1,2 @@
 <h1>Welcome to Spork!</h1>
+<p class="lead">Use this document as a way to quickly start any new project.<br> All you get is this text and a mostly barebones HTML document.</p>

+ 22 - 29
app/views/shared/_navbar.html.erb

@@ -1,31 +1,24 @@
-<nav class="navbar navbar-default">
-  <div class="container-fluid">
-    <!-- Brand and toggle get grouped for better mobile display -->
-    <div class="navbar-header">
-      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
-        <span class="sr-only">Toggle navigation</span>
-        <span class="icon-bar"></span>
-        <span class="icon-bar"></span>
-        <span class="icon-bar"></span>
-      </button>
-      <a class="navbar-brand" href="#">Spork</a>
-    </div>
+<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
+  <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
+    <span class="navbar-toggler-icon"></span>
+  </button>
+  <a class="navbar-brand" href="#">Navbar</a>
 
-    <!-- Collect the nav links, forms, and other content for toggling -->
-    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
-      <ul class="nav navbar-nav navbar-right">
-        <li><a href="#">Link</a></li>
-        <li class="dropdown">
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
-          <ul class="dropdown-menu">
-            <li><a href="#">Action</a></li>
-            <li><a href="#">Another action</a></li>
-            <li><a href="#">Something else here</a></li>
-            <li role="separator" class="divider"></li>
-            <li><a href="#">Separated link</a></li>
-          </ul>
-        </li>
-      </ul>
-    </div><!-- /.navbar-collapse -->
-  </div><!-- /.container-fluid -->
+  <div class="collapse navbar-collapse" id="navbarSupportedContent">
+    <ul class="navbar-nav mr-auto">
+      <li class="nav-item active">
+        <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
+      </li>
+      <li class="nav-item">
+        <a class="nav-link" href="#">Link</a>
+      </li>
+      <li class="nav-item">
+        <a class="nav-link disabled" href="#">Disabled</a>
+      </li>
+    </ul>
+    <form class="form-inline my-2 my-lg-0">
+      <input class="form-control mr-sm-2" type="text" placeholder="Search">
+      <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
+    </form>
+  </div>
 </nav>

+ 9 - 8
template.rb

@@ -2,10 +2,16 @@ def source_paths
   [File.expand_path(File.dirname(__FILE__))]
 end
 
-def add_users
-  # Gemfile
+def add_gems
   gem 'devise', '~> 4.2.1'
+  gem 'jquery-rails', '~> 4.3.1'
+  gem 'bootstrap', '~> 4.0.0.alpha6'
+  gem 'webpacker', '~> 1.1'
+  gem 'sidekiq', '~> 5.0'
+  gem 'foreman', '~> 0.84.0'
+end
 
+def add_users
   # Install Devise
   rails_command "generate devise:install"
 
@@ -25,9 +31,6 @@ def add_users
 end
 
 def add_bootstrap
-  gem 'jquery-rails', '~> 4.3.1'
-  gem 'bootstrap-sass', '~> 3.3.6'
-
   # Remove Application CSS
   run "rm app/assets/stylesheets/application.css"
 
@@ -44,21 +47,19 @@ def copy_templates
 end
 
 def add_webpack
-  gem 'webpacker', '~> 1.1'
   rails_command 'webpacker:install'
 end
 
 def add_sidekiq
-  gem 'sidekiq', '~> 5.0'
   environment "config.active_job.queue_adapter = :sidekiq"
 end
 
 def add_foreman
-  gem 'foreman', '~> 0.84.0'
   copy_file "Procfile"
 end
 
 # Main setup
+add_gems
 add_users
 add_bootstrap
 copy_templates