Skip to content

Commit

Permalink
rough pass at users#show
Browse files Browse the repository at this point in the history
  • Loading branch information
zr2d2 committed Jun 2, 2012
1 parent 05d902b commit a9ccb51
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 25 deletions.
86 changes: 86 additions & 0 deletions app/views/users/_show_body.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<article>
<div class="default-padding">
<h2>Groups</h2>

<table>
<tr>
<th>Name</th>
<th>Roles</th>
</tr>

<% @user.memberships.each do |membership| %>
<tr>
<td><%= membership.group.name %></td>

<td>
<%= form_for([membership.group, membership]) do |f| %>
<%= f.select :level, Membership::LEVELS %>
<%= f.submit %>
<% end %>
</td>
</tr>
<% end %>
</table>

<br/><br/>

<h2>Screens</h2>

<table>
<tr>
<th>Name</th>
<th>Location</th>
<th>Dimensions</th>
</tr>

<% @user.screens.each do |screen| %>
<tr>
<td><%= screen.name %></td>
<td><%= screen.location %></td>
<td><%= screen.width %> X <%= screen.height %></td>
</tr>
<% end %>
</table>

<br/><br/>

<h2>Submissions</h2>

<table>
<tr>
<th>Name</th>
<th>Type</th>
<th>Airs</th>
</tr>

<% @user.contents.each do |content| %>
<tr>
<td><%= content.name %></td>
<td><%= content.type %></td>
<td><%= content.start_time %> - <%= content.end_time %></td>
</tr>
<% end %>
</table>

<br/><br/>

</div>

</article>

<aside>

<div>
<p>
<b>Email:</b>
<%= @user.email %>
</p>

<p>
<b>Language:</b>
<%= @user.locale %>
</p>
</div>

</aside>
<div class="clear"></div>
4 changes: 4 additions & 0 deletions app/views/users/_show_header.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<h1>
<%= link_to "All Users", users_path %> &gt;
<%= @user.name %>
</h1>
33 changes: 8 additions & 25 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
<p id="notice"><%= notice %></p>

<p>
<b>First name:</b>
<%= @user.first_name %>
</p>

<p>
<b>Last name:</b>
<%= @user.last_name %>
</p>

<p>
<b>Email:</b>
<%= @user.email %>
</p>

<p>
<b>Language:</b>
<%= @user.locale %>
</p>


<%= link_to 'Edit', edit_user_path(@user) %> |
<%= link_to 'Back', users_path %>
<section class="C">
<header id="users-header">
<%= render :partial => "users/show_header" %>
</header>
<div id="users-body" class="C-cont">
<%= render :partial => "users/show_body" %>
</div>
</section>

0 comments on commit a9ccb51

Please sign in to comment.