Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated layouts to be cleaner

  • Loading branch information...
commit 437f248cb3b3f2b6c27a6164d195c94aa6e870bb 1 parent 91450f7
Logan Bailey authored
30 app/views/layouts/application.html.erb
View
@@ -8,17 +8,25 @@
</head>
<body>
-<div class="user-auth-nav" style="float:right">
- <% if user_signed_in? %>
- <%= link_to('Edit registration', edit_user_registration_path) %> |
- <%= link_to('Logout', destroy_user_session_path) %>
- <% else %>
- <%= link_to('Login', new_user_session_path) %> |
- <%= link_to('Register', new_user_registration_path) %>
- <% end %>
+<div id="content-wrapper">
+ <div id="user-auth-nav">
+ <% if user_signed_in? %>
+ <%= link_to 'New Post', new_post_path %> |
+ <%= link_to('Profile', edit_user_registration_path) %> |
+ <%= link_to('Logout', destroy_user_session_path) %>
+ <% else %>
+ <%= link_to('Login', new_user_session_path) %> |
+ <%= link_to('Register', new_user_registration_path) %>
+ <% end %>
+ </div>
+ <h1 id="application-title">Century Blog</h1>
+ <ul id="top-nav">
+ <li><%= link_to "Home", root_path %></li>
+ <li>About</li>
+ </ul>
+ <div id="content">
+ <%= yield %>
+ </div>
</div>
-
-<%= yield %>
-
</body>
</html>
10 app/views/posts/_form.html.erb
View
@@ -10,15 +10,15 @@
</ul>
</div>
<% end %>
-
<div class="field">
- <%= f.label :body %><br />
- <%= f.text_area :body %>
+ <%= f.label :title %><br />
+ <%= f.text_field :title, :size => "50" %>
</div>
<div class="field">
- <%= f.label :title %><br />
- <%= f.text_field :title %>
+ <%= f.label :body %><br />
+ <%= f.text_area :body, :cols => 90, :rows => 10%>
</div>
+
<div class="actions">
<%= f.submit %>
</div>
2  app/views/posts/edit.html.erb
View
@@ -1,4 +1,4 @@
-<h1>Editing post</h1>
+<h1 id="page-title"><%= @post.title %></h1>
<%= render 'form' %>
31 app/views/posts/index.html.erb
View
@@ -1,18 +1,13 @@
-<h1>Rails Blog Tutorial</h1>
-
-<ul id="blog-list">
- <% @posts.each do |post| %>
- <li>
- <h2 class="post-title"><%= link_to post.title, post %></h2>
- <div class="post-body">
- <%= post.body %>
- </div>
- </li>
- <% end %>
-</ul>
-
-<br />
-
-<% if user_signed_in? %>
-<%= link_to 'New Post', new_post_path %>
-<% end %>
+<div id="left-content">
+ <ul id="blog-list">
+ <% @posts.each do |post| %>
+ <li>
+ <span class="post-date"><%= post.created_at%></span>
+ <h2 class="post-title"><%= link_to post.title, post %></h2>
+ <div class="post-body">
+ <%= post.body %>
+ </div>
+ </li>
+ <% end %>
+ </ul>
+</div>
4 app/views/posts/new.html.erb
View
@@ -1,5 +1,3 @@
-<h1>New post</h1>
+<h1 id="page-title">New post</h1>
<%= render 'form' %>
-
-<%= link_to 'Back', posts_path %>
7 app/views/posts/show.html.erb
View
@@ -1,17 +1,16 @@
<p id="notice"><%= notice %></p>
-<h1><%= @post.title %></h1>
+<h1 id="page-title"><%= @post.title %></h1>
<p class="meta">
- Posted by: <%= @post.user.email %> On <%= @post.created_at %>
+ Posted by: <a href='#'><%= @post.user.email %></a> On <%= @post.created_at %>
</p>
<div id="post-body">
<%= @post.body %>
-</div id="post-body">
+</div>
<% if user_signed_in? && @post.user == current_user %>
<%= link_to 'Edit', edit_post_path(@post) %>
<% end %>
-<%= link_to 'Back', posts_path %>
64 public/stylesheets/base.css
View
@@ -0,0 +1,64 @@
+body {
+ background: black;
+ color: white;
+ font-weight: 200;
+}
+#content-wrapper {
+ margin: 0px auto;
+ border: 1px solid black;
+ width: 750px;
+}
+
+#user-auth-nav {
+ padding-right:5px;
+ float:right;
+}
+
+#top-nav {
+ background: #161616;
+ border: 1px solid #2C2C2C;
+ padding: 2px;
+}
+
+#top-nav li {
+ display: inline-block;
+ font-size:12pt;
+ padding: 5px;
+}
+
+#content h1 {
+ font-size: 15pt;
+}
+
+#left-content {
+ width:66%;
+}
+
+#blog-list li{
+ padding-bottom:25px;
+}
+
+#blog-list .post-date {
+ font-style:italic;
+}
+
+#blog-list .post-title a, #page-title{
+ color: #C60;
+ font-weight: lighter;
+ text-decoration: none;
+}
+
+#blog-list .post-body, #post-body {
+ font-family: Helvetica;
+ font-size: 11pt;
+ color: #ccc;
+}
+
+#post-body {
+ line-height: 15pt;
+}
+
+textarea, input {
+ line-height: 15pt;
+ font-size: 10pt;
+}
23 public/stylesheets/scaffold.css
View
@@ -1,23 +1,20 @@
-body { background-color: #fff; color: #333; }
-
body, p, ol, ul, td {
- font-family: verdana, arial, helvetica, sans-serif;
- font-size: 13px;
+ font-family: "Trebuchet MS", Helvetica, sans-serif;
+ font-size: 10pt;
line-height: 18px;
}
-pre {
- background-color: #eee;
- padding: 10px;
- font-size: 11px;
+ul {
+ margin:0px;
+ padding:0px;
}
-a { color: #000; }
-a:visited { color: #666; }
-a:hover { color: #fff; background-color:#000; }
+li {
+ list-style: none;
+}
-div.field, div.actions {
- margin-bottom: 10px;
+a, a:visited, a:active {
+ color: white;
}
#notice {
Please sign in to comment.
Something went wrong with that request. Please try again.