Skip to content

Commit

Permalink
Changed layout
Browse files Browse the repository at this point in the history
  • Loading branch information
devjj committed Apr 18, 2011
1 parent cf450c9 commit bf4ab58
Show file tree
Hide file tree
Showing 7 changed files with 157 additions and 2 deletions.
10 changes: 10 additions & 0 deletions app/views/layouts/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<footer>
<nav class="round">
<ul>
<li><%= link_to "About", '#' %></li>
<li><%= link_to "Contact", '#' %></li>
<li><a href="http://news.railstutorial.org/">News</a></li>
<li><a href="http://www.railstutorial.org/">Rails Tutorial</a></li>
</ul>
</nav>
</footer>
10 changes: 10 additions & 0 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<header>
<%= image_tag("logo.png", :alt => "Sample App", :class => "round") %>
<nav class="round">
<ul>
<li><%= link_to "Home", '#' %></li>
<li><%= link_to "Help", '#' %></li>
<li><%= link_to "Sign in", '#' %></li>
</ul>
</nav>
</header>
12 changes: 12 additions & 0 deletions app/views/layouts/_stylesheets.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %>
<%= stylesheet_link_tag 'blueprint/print', :media => 'print' %>

<!--[if lt IE 8]>
<%= stylesheet_link_tag 'blueprint/ie' %>
<![endif]-->

<%= stylesheet_link_tag 'custom', :media => 'screen' %>
11 changes: 9 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<title>Ruby on Rails Tutorial Sample App | <%= @title %></title>
<title><%= title %></title>
<%= csrf_meta_tag %>
<%= render 'layouts/stylesheets' %>
</head>
<body>
<%= yield %>
<div class="container">
<%= render 'layouts/header' %>
<section class="round">
<%= yield %>
</section>
<%= render 'layouts/footer' %>
</div>
</body>
</html>
2 changes: 2 additions & 0 deletions app/views/pages/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
<a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
sample application.
</p>

<%= link_to "Sign up now!", "#", :class => "signup_button round" %>
Binary file added public/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions public/stylesheets/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
.container {
width: 710px;
}

body {
background: #cff;
}

header {
padding-top: 20px;
}

header img {
padding: 1em;
background: #fff;
}

section {
margin-top: 1em;
font-size: 120%;
padding: 20px;
background: #fff;
}

section h1 {
font-size: 200%;
}

footer {
text-align: center;
margin-top: 10px;
width: 710px;
margin-left: auto;
margin-right: auto;
}

footer nav {
float: none;
}

/* Links */

a {
color: #09c;
text-decoration: none;
}

a:hover {
color: #069;
text-decoration: underline;
}

a:visited {
color: #069;
}

/* Navigation */

nav {
float: right;
}

nav {
background-color: white;
padding: 0 0.7em;
white-space: nowrap;
}

nav ul {
margin: 0;
padding: 0;
}

nav ul li {
list-style-type: none;
display: inline-block;
padding: 0.2em 0;
}

nav ul li a {
padding: 0 5px;
font-weight: bold;
}

nav ul li a:visited {
color: #09c;
}

nav ul li a:hover {
text-decoration: underline;
}

/* Sign up button */

a.signup_button {
margin-left: auto;
margin-right: auto;
display: block;
text-align: center;
width: 190px;
color: #fff;
background: #006400;
font-size: 150%;
font-weight: bold;
padding: 20px;
}

/* Round corners */

.round {
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
}

0 comments on commit bf4ab58

Please sign in to comment.