Permalink
Browse files

Add bootstrap

  • Loading branch information...
1 parent b15493a commit 65136521f05d0c5ff552919367b31a5c39812231 @marktabler committed Jun 10, 2013
View
2 Gemfile
@@ -1,5 +1,7 @@
source 'https://rubygems.org'
+gem 'bootstrap-sass'
+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0.rc1'
View
3 Gemfile.lock
@@ -27,6 +27,8 @@ GEM
tzinfo (~> 0.3.37)
arel (4.0.0)
atomic (1.1.9)
+ bootstrap-sass (2.3.1.3)
+ sass (~> 3.2)
builder (3.1.4)
coffee-rails (4.0.0)
coffee-script (>= 2.2.0)
@@ -109,6 +111,7 @@ PLATFORMS
ruby
DEPENDENCIES
+ bootstrap-sass
coffee-rails (~> 4.0.0)
jbuilder (~> 1.0.1)
jquery-rails
View
3 app/assets/stylesheets/bootstrap_and_overrides.css.scss
@@ -0,0 +1,3 @@
+@import "bootstrap";
+body { padding-top: 60px; }
+@import "bootstrap-responsive";
View
8 app/views/layouts/_messages.html.erb
@@ -0,0 +1,8 @@
+<% flash.each do |name, msg| %>
+ <% if msg.is_a?(String) %>
+ <div class="alert alert-<%= name == :notice ? "success" : "error" %>">
+ <a class="close" data-dismiss="alert">&#215;</a>
+ <%= content_tag :div, msg, :id => "flash_#{name}" %>
+ </div>
+ <% end %>
+<% end %>
View
20 app/views/layouts/_nav.html.erb
@@ -1,11 +1,9 @@
-<table>
- <tr>
- <td><%= link_to "View Licenses", licenses_path %></td>
- <td><%= link_to "View Assets", machines_path %></td>
- <% if current_user.admin? %>
- <td><%= link_to "Administer Licenses", licenses_path %></td>
- <td><%= link_to "Administer Assets", machines_path %></td>
- <td><%= link_to "Administer Users", licenses_path %></td>
- <% end %>
- </tr>
-</table>
+<ul class='nav'>
+<li><%= link_to "Log Out #{current_user.name}", logout_path %></li>
+<li><%= link_to "View Licenses", licenses_path %></li>
+<li><%= link_to "View Assets", machines_path %></li>
+<% if current_user.admin? %>
+ <li><%= link_to "Administer Licenses", licenses_path %></li>
+ <li><%= link_to "Administer Assets", machines_path %></li>
+ <li><%= link_to "Administer Users", licenses_path %></li>
+<% end %>
View
53 app/views/layouts/application.html.erb
@@ -1,18 +1,37 @@
-<!DOCTYPE html>
+<!doctype html>
<html>
-<head>
- <title>Norrington</title>
- <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
- <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
- <%= csrf_meta_tags %>
-</head>
-<body>
-<% if current_user %>
- <h3>Signed in as <%= current_user.name %> | <%= link_to 'Sign out', '/logout', method: :delete %></h3>
- <%= render partial: 'layouts/nav' %>
- <br><br>
-<% end %>
-<%= yield %>
-
-</body>
-</html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title><%= content_for?(:title) ? yield(:title) : "Myapp" %></title>
+ <meta name="description" content="">
+ <meta name="author" content="">
+ <%= stylesheet_link_tag "application", :media => "all" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tags %>
+ <%= yield(:head) %>
+ </head>
+ <body>
+ <header class="navbar navbar-fixed-top">
+ <nav class="navbar-inner">
+ <div class="container">
+ <%= render partial: 'layouts/nav' %>
+ </div>
+ </nav>
+ </header>
+ <div id="main" role="main">
+ <div class="container">
+ <div class="content">
+ <div class="row">
+ <div class="span12">
+ <%= render 'layouts/messages' %>
+ <%= yield %>
+ </div>
+ </div>
+ <footer>
+ </footer>
+ </div>
+ </div> <!--! end of .container -->
+ </div> <!--! end of #main -->
+ </body>
+</html>

0 comments on commit 6513652

Please sign in to comment.