Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated layouts to be cleaner

  • Loading branch information...
commit 437f248cb3b3f2b6c27a6164d195c94aa6e870bb 1 parent 91450f7
Logan Bailey authored March 03, 2011
30  app/views/layouts/application.html.erb
@@ -8,17 +8,25 @@
8 8
 </head>
9 9
 <body>
10 10
 
11  
-<div class="user-auth-nav" style="float:right">
12  
-  <% if user_signed_in? %>
13  
-  <%= link_to('Edit registration', edit_user_registration_path) %> | 
14  
-  <%= link_to('Logout', destroy_user_session_path) %> 
15  
-  <% else %>
16  
-  <%= link_to('Login', new_user_session_path)  %> | 
17  
-  <%= link_to('Register', new_user_registration_path)  %>
18  
-  <% end %>
  11
+<div id="content-wrapper">
  12
+  <div id="user-auth-nav">
  13
+    <% if user_signed_in? %>
  14
+    <%= link_to 'New Post', new_post_path %> | 
  15
+    <%= link_to('Profile', edit_user_registration_path) %> | 
  16
+    <%= link_to('Logout', destroy_user_session_path) %> 
  17
+    <% else %>
  18
+    <%= link_to('Login', new_user_session_path)  %> | 
  19
+    <%= link_to('Register', new_user_registration_path)  %>
  20
+    <% end %>
  21
+  </div>
  22
+  <h1 id="application-title">Century Blog</h1>
  23
+  <ul id="top-nav">
  24
+    <li><%= link_to "Home", root_path %></li>
  25
+    <li>About</li>
  26
+  </ul>
  27
+  <div id="content">
  28
+    <%= yield %>
  29
+  </div>
19 30
 </div>
20  
-
21  
-<%= yield %>
22  
-
23 31
 </body>
24 32
 </html>
10  app/views/posts/_form.html.erb
@@ -10,15 +10,15 @@
10 10
       </ul>
11 11
     </div>
12 12
   <% end %>
13  
-
14 13
   <div class="field">
15  
-    <%= f.label :body %><br />
16  
-    <%= f.text_area :body %>
  14
+    <%= f.label :title %><br />
  15
+    <%= f.text_field :title, :size => "50" %>
17 16
   </div>
18 17
   <div class="field">
19  
-    <%= f.label :title %><br />
20  
-    <%= f.text_field :title %>
  18
+    <%= f.label :body %><br />
  19
+    <%= f.text_area :body, :cols => 90, :rows => 10%>
21 20
   </div>
  21
+  
22 22
   <div class="actions">
23 23
     <%= f.submit %>
24 24
   </div>
2  app/views/posts/edit.html.erb
... ...
@@ -1,4 +1,4 @@
1  
-<h1>Editing post</h1>
  1
+<h1 id="page-title"><%= @post.title %></h1>
2 2
 
3 3
 <%= render 'form' %>
4 4
 
31  app/views/posts/index.html.erb
... ...
@@ -1,18 +1,13 @@
1  
-<h1>Rails Blog Tutorial</h1>
2  
-
3  
-<ul id="blog-list">
4  
-  <% @posts.each do |post| %>
5  
-  <li>
6  
-    <h2 class="post-title"><%= link_to post.title, post %></h2>
7  
-    <div class="post-body">
8  
-      <%= post.body %>
9  
-    </div>
10  
-  </li>
11  
-  <% end %>
12  
-</ul>
13  
-
14  
-<br />
15  
-
16  
-<% if user_signed_in? %>
17  
-<%= link_to 'New Post', new_post_path %>
18  
-<% end %>
  1
+<div id="left-content">
  2
+  <ul id="blog-list">
  3
+    <% @posts.each do |post| %>
  4
+    <li>
  5
+      <span class="post-date"><%= post.created_at%></span>
  6
+      <h2 class="post-title"><%= link_to post.title, post %></h2>
  7
+      <div class="post-body">
  8
+        <%= post.body %>
  9
+      </div>
  10
+    </li>
  11
+    <% end %>
  12
+  </ul>
  13
+</div>
4  app/views/posts/new.html.erb
... ...
@@ -1,5 +1,3 @@
1  
-<h1>New post</h1>
  1
+<h1 id="page-title">New post</h1>
2 2
 
3 3
 <%= render 'form' %>
4  
-
5  
-<%= link_to 'Back', posts_path %>
7  app/views/posts/show.html.erb
... ...
@@ -1,17 +1,16 @@
1 1
 <p id="notice"><%= notice %></p>
2 2
 
3 3
 
4  
-<h1><%= @post.title %></h1>
  4
+<h1 id="page-title"><%= @post.title %></h1>
5 5
 <p class="meta">
6  
-  Posted by: <%= @post.user.email %> On <%= @post.created_at %>
  6
+  Posted by: <a href='#'><%= @post.user.email %></a> On <%= @post.created_at %>
7 7
 </p>
8 8
 <div id="post-body">
9 9
   <%= @post.body %>
10  
-</div id="post-body">
  10
+</div>
11 11
 
12 12
 
13 13
 
14 14
 <% if user_signed_in? && @post.user == current_user %>
15 15
 <%= link_to 'Edit', edit_post_path(@post) %>
16 16
 <% end %>
17  
-<%= link_to 'Back', posts_path %>
64  public/stylesheets/base.css
... ...
@@ -0,0 +1,64 @@
  1
+body {
  2
+  background: black;
  3
+  color: white;
  4
+  font-weight: 200;
  5
+}
  6
+#content-wrapper {
  7
+  margin: 0px auto;
  8
+  border: 1px solid black;
  9
+  width: 750px;
  10
+}
  11
+
  12
+#user-auth-nav {
  13
+  padding-right:5px;
  14
+  float:right;
  15
+}
  16
+
  17
+#top-nav {
  18
+  background: #161616;
  19
+  border: 1px solid #2C2C2C;
  20
+  padding: 2px;
  21
+}
  22
+
  23
+#top-nav li {
  24
+  display: inline-block;
  25
+  font-size:12pt;
  26
+  padding: 5px;
  27
+}
  28
+
  29
+#content h1 {
  30
+  font-size: 15pt;
  31
+}
  32
+
  33
+#left-content {
  34
+  width:66%;
  35
+}
  36
+
  37
+#blog-list li{
  38
+  padding-bottom:25px;
  39
+}
  40
+
  41
+#blog-list .post-date {
  42
+  font-style:italic;
  43
+}
  44
+
  45
+#blog-list .post-title a, #page-title{
  46
+  color: #C60;
  47
+  font-weight: lighter;
  48
+  text-decoration: none;
  49
+}
  50
+
  51
+#blog-list .post-body, #post-body {
  52
+  font-family: Helvetica;
  53
+  font-size: 11pt;
  54
+  color: #ccc;
  55
+}
  56
+
  57
+#post-body {
  58
+  line-height: 15pt;
  59
+}
  60
+
  61
+textarea, input {
  62
+  line-height: 15pt;
  63
+  font-size: 10pt;
  64
+}
23  public/stylesheets/scaffold.css
... ...
@@ -1,23 +1,20 @@
1  
-body { background-color: #fff; color: #333; }
2  
-
3 1
 body, p, ol, ul, td {
4  
-  font-family: verdana, arial, helvetica, sans-serif;
5  
-  font-size:   13px;
  2
+  font-family: "Trebuchet MS", Helvetica, sans-serif;
  3
+  font-size:   10pt;
6 4
   line-height: 18px;
7 5
 }
8 6
 
9  
-pre {
10  
-  background-color: #eee;
11  
-  padding: 10px;
12  
-  font-size: 11px;
  7
+ul {
  8
+  margin:0px;
  9
+  padding:0px;
13 10
 }
14 11
 
15  
-a { color: #000; }
16  
-a:visited { color: #666; }
17  
-a:hover { color: #fff; background-color:#000; }
  12
+li {
  13
+  list-style: none;
  14
+}
18 15
 
19  
-div.field, div.actions {
20  
-  margin-bottom: 10px;
  16
+a, a:visited, a:active {
  17
+  color: white;
21 18
 }
22 19
 
23 20
 #notice {

0 notes on commit 437f248

Please sign in to comment.
Something went wrong with that request. Please try again.