Skip to content

Commit

Permalink
added a partials _header _shim _footer modified layout 'aplication.ht…
Browse files Browse the repository at this point in the history
…ml.erb' created a custom.css.scss and delete a public/index.html
  • Loading branch information
ljrzarate committed Jul 25, 2012
1 parent 60bc3cc commit 6ceb8ed
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 263 deletions.
105 changes: 104 additions & 1 deletion app/assets/stylesheets/custom.css.scss
Original file line number Diff line number Diff line change
@@ -1 +1,104 @@
@import "bootstrap";
@import "bootstrap";

/* universal */

html {
overflow-y: scroll;
}

body {
padding-top: 60px;
}

section {
overflow: auto;
}

textarea {
resize: vertical;
}

.center {
text-align: center;
}

.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: #999;
}

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;
}

#logo:hover {
color: #fff;
text-decoration: none;
}

/* footer */

footer {
margin-top: 45px;
padding-top: 5px;
border-top: 1px solid #eaeaea;
color: #999;
}

footer a {
color: #555;
}

footer a:hover {
color: #222;
}

footer small {
float: left;
}

footer ul {
float: right;
list-style: none;
}

footer ul li {
float: left;
margin-left: 10px;
}
13 changes: 13 additions & 0 deletions app/views/layouts/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<footer class="footer">
<small>
<a href="http://railstutorial.org/">Rails Tutorial</a>
by Michael Hartl
</small>
<nav>
<ul>
<li><%= link_to "About", '#' %></li>
<li><%= link_to "Contact", '#' %></li>
<li><a href="http://news.railstutorial.org/">News</a></li>
</ul>
</nav>
</footer>
14 changes: 14 additions & 0 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<header class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<%= link_to "sample app", '#', id: "logo" %>
<nav>
<ul class="nav pull-right">
<li><%= link_to "Home", '#' %></li>
<li><%= link_to "Help", '#' %></li>
<li><%= link_to "Sign in", '#' %></li>
</ul>
</nav>
</div>
</div>
</header>
3 changes: 3 additions & 0 deletions app/views/layouts/_shim.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
20 changes: 3 additions & 17 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,13 @@
<%= stylesheet_link_tag "application", media: "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<%= render 'layouts/shim'%>
</head>
<body>
<header class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<%= link_to "sample app", '#', id: "logo" %>
<nav>
<ul class="nav pull-right">
<li><%= link_to "Home", '#' %></li>
<li><%= link_to "Help", '#' %></li>
<li><%= link_to "Sign in", '#' %></li>
</ul>
</nav>
</div>
</div>
</header>
<%= render 'layouts/header'%>
<div class="container">
<%= yield %>
<%= render 'layouts/footer'%>
</div>
</body>
</html>
8 changes: 4 additions & 4 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Sample::Application.routes.draw do
get "static_pages/home"
get "static_pages/help"
get "static_pages/about"
get "static_pages/contact"
root to: "static_pages#home"
match "/help", to: "static_pages#help"
match "/about", to: "static_pages#about"
match "/contact", to: "static_pages#contact"

# The priority is based upon order of creation:
# first created -> highest priority.
Expand Down
Loading

0 comments on commit 6ceb8ed

Please sign in to comment.