YaleSTC/shifts

View on GitHub
app/views/users/show.html.erb

Summary

Maintainability
Test Coverage
<% title "#{@user.proper_name}" %>

<div class='whole'>
  <div class='information'>
    <p><h2>User Info</h2></p>
    <p>
      <strong>Login:</strong>
      <%= @user.login %>
    </p>
    <p>
      <strong>Active:</strong>
      <%= @user.is_active?(@department) %>
    </p>
    <p>
      <strong>First Name:</strong>
      <%= @user.first_name %>
    </p>
    <p>
      <strong>Last Name:</strong>
      <%= @user.last_name %>
    </p>
    <p>
      <strong>Nickname:</strong>
      <%= @user.nick_name %>
    </p>
    <p>
      <strong>Employee ID:</strong>
      <%= @user.employee_id %>
    </p>
    <p>
      <strong>Email:</strong>
      <%= @user.email %>
    </p>
    <p>
      <strong>Roles:</strong><br />
      <ul>
        <% if @user.roles.empty? %>
          <li>none</li>
        <% else %>
          <% @user.roles.each do |role| %>
            <li><%= role.name %></li>
          <% end %>
        <% end %>
      </ul>
    </p>
    <p>
      <strong>Payrate:</strong>
      <%= number_to_currency(@user.payrate(current_department)) %>
  </div>

  <div class='profile'>
  <p>
      <h2>User Profile</h2>
      <%= render partial: 'user_profiles/user_profile_entries' %>
  </p>
  </div>

  <div class='clear'>
  </div>
    <p>
      <%= link_to "Edit", edit_user_path(@user) %> |
      <%= deactivate_link(@user) %> |
      <%#= link_to "Delete", action: :really_destroy, id: @user, confirm: "Are you sure you want to delete this user?  This is strongly discouraged, as it may damage the integrity of your database." %> |
      <%= link_to "View All", department_users_path(@department) %>
    </p>

</div>