Skip to content

Commit

Permalink
Added a sidebar and some styling
Browse files Browse the repository at this point in the history
  • Loading branch information
mhartl committed Aug 23, 2010
1 parent 5275e7b commit 8753262
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
19 changes: 15 additions & 4 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<h1>
<%= gravatar_for @user %>
<%= @user.name %>
</h1>
<table class="profile" summary="Profile information">
<tr>
<td class="main">
<h1>
<%= gravatar_for @user %>
<%= @user.name %>
</h1>
</td>
<td class="sidebar round">
<strong>Name</strong> <%= @user.name %><br />
<strong>URL</strong> <%= link_to user_path(@user), @user %>
</td>
</tr>
</table>

24 changes: 24 additions & 0 deletions public/stylesheets/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,27 @@ footer {
footer nav {
float: none;
}

/* User show page */

table.profile {
width: 100%;
margin-bottom: 0;
}

td.main {
width: 70%;
padding: 1em;
}

td.sidebar {
width: 30%;
padding: 1em;
vertical-align: top;
background: #ffc;
}

.profile img.gravatar {
border: 1px solid #999;
margin-bottom: -15px;
}
6 changes: 6 additions & 0 deletions spec/controllers/users_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
get :show, :id => @user
response.should have_selector('h1>img', :class => "gravatar")
end

it "should have the right URL" do
get :show, :id => @user
response.should have_selector('td>a', :content => user_path(@user),
:href => user_path(@user))
end
end

describe "GET 'new'" do
Expand Down

0 comments on commit 8753262

Please sign in to comment.