foodsoft/app/views/admin/users/show.html.erb

52 lines
1.7 KiB
Text

<h1><%=h @user.nick %></h1>
<div class="left_column" style="width:100%">
<div class="box_title">
<h2>Übersicht</h2>
</div>
<div class="column_content">
<p>
Mitglied seit <%= distance_of_time_in_words(Time.now, @user.created_on) -%>
</p>
<div style="float:left;margin:5px; margin-right:10px;" class="box">
<p><b>Person</b></p>
<p><b>Nick:</b> <%=h @user.nick %></p>
<p><b>Name:</b> <%=h @user.name %></p>
<p><b>Email:</b> <%=h @user.email %></p>
<p><b>Telefon:</b> <%=h @user.phone %></p>
</div>
<div style="float:left; margin:5px;" class="box">
<p>
<b>Einstellungen</b>
</p>
<table style="width:26em">
<tbody>
<% for setting in User::setting_keys.keys -%>
<tr>
<td><%= User::setting_keys[setting] %></td>
<td><%= @user.settings[setting] == '1' ? 'ja' : 'nein' %></td>
</tr>
<% end -%>
</tbody>
</table>
<p>
<b>Benutzer_in hat Zugriff auf:</b>
</p>
<p>
<%=h format_roles(@user) %>
</p>
</div>
<p style="clear:both">
<%= link_to 'Bearbeiten', edit_admin_user_path(@user) %>
| <%= link_to 'Löschen', [:admin, @user], :confirm => "Willst du #{@user.first_name} wirklich rausschmeißen?", :method => :delete %>
| <%= link_to "Nachricht senden", new_message_path(:message => {:mail_to => @user.id}) %>
</p>
</div>
<div class="box_title"><h2>Gruppenabos</h2></div>
<div class="column_content">
<% for membership in Membership.find_all_by_user_id(@user.id) -%>
<p>
<%= link_to(membership.group.name, [:admin, membership.group]) %>
</p>
<% end -%>
</div>
</div>