Commit 9bc8bd9
Changed files (8)
app
assets
app/assets/images/rails.png
Binary file
app/assets/javascripts/application.js
@@ -12,4 +12,5 @@
//
//= require jquery
//= require jquery_ujs
+//= require bootstrap
//= require_tree .
app/assets/stylesheets/cakes.css.scss
@@ -1,3 +1,6 @@
// Place all the styles related to the cakes controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
+@import "bootstrap";
+body { padding-top: 60px; }
+@import "bootstrap-responsive";
app/assets/stylesheets/scaffolds.css.scss
@@ -1,69 +0,0 @@
-body {
- background-color: #fff;
- color: #333;
- font-family: verdana, arial, helvetica, sans-serif;
- font-size: 13px;
- line-height: 18px;
-}
-
-p, ol, ul, td {
- font-family: verdana, arial, helvetica, sans-serif;
- font-size: 13px;
- line-height: 18px;
-}
-
-pre {
- background-color: #eee;
- padding: 10px;
- font-size: 11px;
-}
-
-a {
- color: #000;
- &:visited {
- color: #666;
- }
- &:hover {
- color: #fff;
- background-color: #000;
- }
-}
-
-div {
- &.field, &.actions {
- margin-bottom: 10px;
- }
-}
-
-#notice {
- color: green;
-}
-
-.field_with_errors {
- padding: 2px;
- background-color: red;
- display: table;
-}
-
-#error_explanation {
- width: 450px;
- border: 2px solid red;
- padding: 7px;
- padding-bottom: 0;
- margin-bottom: 20px;
- background-color: #f0f0f0;
- h2 {
- text-align: left;
- font-weight: bold;
- padding: 5px 5px 5px 15px;
- font-size: 12px;
- margin: -7px;
- margin-bottom: 0px;
- background-color: #c00;
- color: #fff;
- }
- ul li {
- font-size: 12px;
- list-style: square;
- }
-}
app/views/layouts/_header.html.erb
@@ -0,0 +1,38 @@
+<div class="navbar navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </a>
+ <a class="brand" href="/">Confection</a>
+ <div class="nav-collapse">
+ <form name="search" method="get" class="navbar-search pull-left" action="" accept-charset="UTF-8">
+ <input type="text" placeholder="Search" class="search-query" name="q">
+ </form>
+ <ul class="nav">
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">Categories<b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a href="/categories/cakes">cakes</a></li>
+ <li><a href="/categories/donuts">donuts</a></li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ <ul class="nav pull-right">
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">Help<b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a href="#">Privacy Policy</a></li>
+ <li class="divider"></li>
+ <li><a href="#">Terms and Conditions</a></li>
+ </ul>
+ </li>
+ <li class="divider-vertical hidden-phone"></li>
+ <li> <a href="">Sign In</a> </li>
+ </ul>
+ </div>
+ </div>
+</div>
app/views/layouts/_messages.html.erb
@@ -0,0 +1,14 @@
+<div class="row">
+ <div class="span12">
+ <% if(flash.any?) -%>
+ <% flash.each do |key, value| -%>
+ <% Array(value).uniq.each do |message| -%>
+ <div class="alert alert-<%= key %>">
+ <a class="close" data-dismiss="alert" href="#">×</a>
+ <%= message %>
+ </div>
+ <% end -%>
+ <% end -%>
+ <% end -%>
+ </div>
+</div>
app/views/layouts/application.html.erb
@@ -1,14 +1,25 @@
<!DOCTYPE html>
-<html>
-<head>
- <title>Confection</title>
- <%= stylesheet_link_tag "application", :media => "all" %>
- <%= javascript_include_tag "application" %>
- <%= csrf_meta_tags %>
-</head>
-<body>
-
-<%= yield %>
-
-</body>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+ <title>Confection</title>
+ <%= stylesheet_link_tag :application %>
+ <%= yield :head %>
+ <%= csrf_meta_tags %>
+ </head>
+ <body>
+ <%= render "layouts/header" %>
+ <div class="container">
+ <%= render "layouts/messages" %>
+ <%= yield %>
+ </div> <!-- /container -->
+ <%= render "layouts/footer" %>
+ <%= javascript_include_tag :application %>
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <%= yield :javascript %>
+ </body>
</html>