Sha256: 70e835eb07b11785cbde775441b2acfae791464d0fea7ef877b0b9a6ed350b5e

Contents?: true

Size: 1.99 KB

Versions: 3

Compression:

Stored size: 1.99 KB

Contents

<%
  self.page_title = "#{@user.name}"
  if @user == current_user
    self.page_description = "You are viewing " + link_to( "your own", admin_user_path( @user ) ) + " profile."
  else
    self.page_description = "You are viewing " + link_to( "#{@user.name}", admin_user_path( @user ) ) + "'s profile."
  end
  self.page_description_links = [ ( link_to( "Edit", edit_admin_user_path( @user ) ) if policy(@user).edit? ), link_to( "View all users", admin_users_path ) ].compact.join( link_separator )
%>

<% content_for :sidebar do %>
  <h2>People</h2>
  <% if @user.created_users.count > 0 -%>
    <p><%= @user.name %> has invited <%= @user.created_users.count %> users:</p>
    <ul>
      <% @user.created_users.each do |created_user| %>
        <li><%= link_to created_user.name, admin_user_url( created_user ) %></li>
      <% end %>
    </ul>
  <% else -%>
    <p><%= @user.name %> hasn't invited any users.</p>
  <% end -%>
<% end %>

<div class="content">
  <% if @user.image -%>
    <div style="float: right;">
      <%= editable_dynamic_image_tag(@user.image, size: '150x150', class: 'thumbnail') %>
    </div>
  <% end -%>
  <h2><%= @user.name %></h2>
  <table class="show">
    <tr>
      <th>Email address:</th>
      <td><%= mail_to @user.email %></td>
    </tr>
    <% if @user.creator %>
      <tr>
        <th>Invited by:</th>
        <td><%= link_to @user.creator.name, admin_user_url( @user.creator ) %> <%= time_ago_in_words @user.created_at %> ago.</td>
      </tr>
    <% end %>
    <% if @user.created_at? -%>
      <tr>
        <th>Member since:</th>
        <td>
          <%= @user.created_at.to_formatted_s :long %>
        </td>
      </tr>
    <% end -%>
    <% if @user.last_login_at? -%>
      <tr>
        <th>Last seen:</th>
        <td>
          <% if @user.online? -%>
            Online now
          <% else -%>
            <%= time_ago_in_words @user.last_login_at %> ago, on <%= @user.last_login_at.to_formatted_s :long %>
          <% end -%>
        </td>
      </tr>
    <% end -%>
  </table>
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pages_core-3.4.3 app/views/admin/users/show.html.erb
pages_core-3.5.1 app/views/admin/users/show.html.erb
pages_core-3.4.2 app/views/admin/users/show.html.erb