Permalink
Browse files

Refactoring layout code.

  • Loading branch information...
1 parent 41bbcaa commit 5a4ccb9a8b058af6fec5223a27daa78c0d1d13d8 Rian Rainey committed Nov 12, 2012
@@ -1,2 +1,166 @@
// This one line includes the entire Bootstrap CSS Framework. @requires bootstrap-sass gem
-@import "bootstrap";
+@import "bootstrap";
+
+// Variables
+$lightgray: #999;
+
+@mixin box_sizing {
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+
+/* Universal */
+html {
+ overflow-y: scroll;
+}
+body {
+ padding-top: 60px;
+}
+
+section {
+ overflow: auto;
+}
+
+textarea {
+ resize: vertical;
+}
+
+.center {
+ text-align: center;
+ h1 {
+ margin-bottom: 10px;
+ }
+}
+
+/* typography */
+h1, h2, h3, h4, h5, h6 {
+ line-height: 1;
+}
+
+h1 {
+ font-size: 3em;
+ letter-spacing: -2px;
+ margin-bottom: 30px;
+ text-align: center;
+}
+h2 {
+ font-size: 1.7em;
+ letter-spacing: -1px;
+ margin-bottom: 30px;
+ text-align: center;
+ font-weight: normal;
+ color: $lightgray;
+}
+p {
+ font-size: 1.1em;
+ line-height: 1.7em;
+}
+
+/* header */
+#logo {
+ float: left;
+ margin-right: 10px;
+ font-size: 1.7em;
+ color: #fff;
+ text-transform: uppercase;
+ letter-spacing: -1px;
+ padding-top: 9px;
+ font-weight: bold;
+ line-height: 1;
+ &:hover {
+ color: #fff;
+ text-decoration: none;
+ }
+}
+
+/* footer */
+footer {
+ margin-top: 45px;
+ padding-top: 5px;
+ border-top: 1px solid #eaeaea;
+ color: $lightgray;
+ a {
+ color: #555;
+ &:hover {
+ color: #F00;
+ }
+ }
+ small {
+ float: left;
+ }
+ ul {
+ float: right;
+ list-style: none;
+ }
+ li {
+ float: left;
+ margin-left: 10px;
+ }
+}
+
+/* miscellaneous */
+.debug_dump {
+ clear: both;
+ float: left;
+ width: 100%;
+ margin-top: 45px;
+ @include box_sizing;
+}
+
+/* sidebar */
+aside {
+ section {
+ padding: 10px 0;
+ border-top: 1px solid $grayLighter;
+
+ &:first-child {
+ border: 0;
+ padding-top: 0;
+ }
+ span {
+ display: block;
+ margin-bottom: 3px;
+ line-height: 1;
+ }
+ h1 {
+ font-size: 1.6em;
+ text-align: left;
+ letter-spacing: -1px;
+ margin-bottom: 3px;
+ }
+ }
+}
+
+.gravatar {
+ float: left;
+ margin-right: 10px;
+}
+
+/* Forms */
+input, textarea, select, .uneditable-input {
+ border: 1px solid #bbb;
+ width: 100%;
+ padding: 10px;
+ height: auto !important;
+ margin-bottom: 15px;
+ @include box_sizing;
+}
+
+#error_explanation {
+ color: #f00;
+ ul {
+ list-style: none;
+ margin: 0 0 18px 0;
+ }
+}
+.field_with_errors {
+ @extend .control-group;
+ @extend .error;
+}
+
+
+
+
+
@@ -0,0 +1,11 @@
+<footer class ="footer">
+ <small>
+ <%= link_to "Crossfit West Nashville", root_path %>
+ built by <%= link_to "Rian Rainey", "twitter.com/rianrainey" %>
+ </small>
+ <nav>
+ <ul>
+ <li><%= link_to "About", about_path %></li>
+ </ul>
+ </nav>
+</footer>
@@ -0,0 +1,13 @@
+<header class="navbar navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <%= link_to "CrossFit West Nashville", root_path, id: "logo" %>
+ <nav>
+ <ul class="nav pull-right">
+ <li><%= link_to "Home", root_path %></li>
+ <li><%= link_to "About", about_path %></li>
+ </ul>
+ </nav>
+ </div>
+ </div>
+</header>
@@ -8,22 +8,13 @@
<!--[ if lt IE 9]><script src ="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![ endif]-->
</head>
<body>
- <header class="navbar navbar-fixed-top">
- <div class="navbar-inner">
- <div class="container">
- <%= link_to "CrossFit West Nashville", root_path %>
- <nav>
- <ul class="nav pull-right">
- <li><%= link_to "Home", root_path %></li>
- <li><%= link_to "About", about_path %></li>
- </ul>
- </nav>
- </div>
- </div>
- </header>
-
+ <%= render 'layouts/header' %>
<div class="container">
- <%= yield %>
+ <%= yield %>
+
+ <%= render 'layouts/footer' %>
+
+ <%= debug(params) if Rails.env.development? %>
</div>
</body>

0 comments on commit 5a4ccb9

Please sign in to comment.