master
 1<%= provide(:search_path, admin_users_path) %>
 2
 3<div class="row">
 4  <div class="col-3">
 5    <%= render partial: "my/shared/my_nav" %>
 6  </div>
 7  <div class="col-9">
 8    <h1><%= link_to @user.name, profile_path(@user) %> <small>(<a href="#edit-user-modal-<%= @user.id %>" role="button" data-toggle="modal">edit</a>)</small></h1>
 9    <%= render partial: 'edit_modal', locals: { user: @user } %>
10    <div class="row">
11      <div class="col">
12        <%= avatar_for(@user) %>
13      </div>
14      <div class="col">
15        <p>name: <%= link_to @user.name, admin_user_path(@user) %></p>
16        <p>email: <%= mail_to @user.email %></p>
17        <p>address: <%= mail_to @user.full_address %></p>
18        <p>city: <%= mail_to @user.city %></p>
19        <p>website: <%= link_to @user.website, @user.website if @user.website %></p>
20        <p>twitter: <%= @user.twitter %></p>
21        <p>facebook: <%= link_to @user.facebook, @user.facebook if @user.facebook %></p>
22        <p>reset password token: <%= @user.reset_password_token %></p>
23        <p>reset password sent at: <%= @user.reset_password_sent_at %></p>
24        <p>created at: <%= @user.created_at %></p>
25        <p>updated at: <%= @user.updated_at %></p>
26      </div>
27    </div>
28
29    <h2>sessions</h2>
30    <table class="table table-striped table-condensed">
31      <thead>
32        <tr>
33          <th>ip</th>
34          <th>user agent</th>
35          <th>accessed at</th>
36          <th>revoked at</th>
37          <th></th>
38        </tr>
39      </thead>
40      <tbody>
41        <%- @user.user_sessions.each do |user_session| %>
42          <tr>
43            <td><%= link_to user_session.user.name, admin_user_path(user_session.user) %></td>
44            <td><%= user_session.ip %></td>
45            <td><%= user_session.user_agent %></td>
46            <td><%= time_ago_in_words(user_session.accessed_at) %></td>
47            <td><%= time_ago_in_words(user_session.revoked_at) if user_session.revoked_at %></td>
48            <td><%= link_to "Revoke", admin_session_path(user_session), method: :delete, class: 'btn btn-danger' %></td>
49          </tr>
50        <% end %>
51      </tbody>
52    </table>
53
54    <h2>cakes</h2>
55    <table class="table table-striped">
56      <thead>
57        <th></th>
58        <th>Name</th>
59        <th>Description</th>
60      </thead>
61      <tbody>
62      <%- @user.creations.each_with_index do |creation, index| %>
63        <% cache creation do %>
64        <tr>
65          <td>
66            <%= link_to cake_path(creation) do %>
67              <%= image_tag creation.primary_image.url_for(:thumb), class: 'thumbnail', style: "width:65px;" %>
68            <% end %>
69          </td>
70          <td><%= creation.name %></td>
71          <td>
72            <%= creation.story %>
73            <%= creation.tags.map(&:name) if creation.tags.any? %>
74          </td>
75        </tr>
76        <% end %>
77      <% end %>
78      </tbody>
79    </table>
80
81    <h2>tutorials</h2>
82    <table class="table table-striped">
83      <thead>
84        <th>Heading</th>
85        <th>Url</th>
86      </thead>
87      <tbody>
88      <%- @user.tutorials.each_with_index do |tutorial, index| %>
89        <tr>
90          <td><%= link_to tutorial.heading, tutorial_path(tutorial) %></td>
91          <td><%= tutorial.description %></td>
92        </tr>
93      <% end %>
94      </tbody>
95    </table>
96  </div>
97</div>