docbrown/app/views/admin/users/show.html.erb
Julianna Tetreault cb93197d43
Fixes "Invite Flow" 404s for Unregistered Users (#10743) [deploy]
* Add conditional to display "<username> is not registered" or Admin User profile in /admin/show.html.erb
  -Displays a "<username> is not registered" message for unregistered users
  -Displays all linked usernames and Admin User info for registered users

* Adds tests around unregistered users Admin User profiles

* Use predicate method in all conditionals in /admin/users/show.html.erb

* Adjusts message alerting admins that a user has not accepted the invite yet
  - Makes the message displayed on the Admin User prof more explicit
  - Makes GETS singular instead of plural in invitations_spec.rb
  - Updates users_spec.rb to test against updated message
2020-10-13 07:53:29 -06:00

50 lines
1.5 KiB
Text

<div class="grid gap-6">
<div class="crayons-card p-6">
<h2 class="d-inline">
<% if @user.registered? %>
<%= @user.name %><%= link_to "@#{@user.username}", @user.path, class: "ml-2", target: "_blank", rel: "noopener" %>
<% else %>
@<%= @user.username %> has not accepted their invitation yet.
<% end %>
</h2>
<% if @user.registered? %>
<a href="<%= edit_admin_user_path(@user) %>" class="btn btn-primary float-right">Manage User</a>
<p class="font-italic">Member since <%= @user.created_at.strftime("%b %e '%y") %></p>
<% end %>
<hr>
<h2>General Info</h2>
<dl>
<dt>ID:</dt>
<dd><%= @user.id %></dd>
<dt>Username:</dt>
<dd><%= @user.username %></dd>
<dt>Name:</dt>
<dd><%= @user.name %></dd>
<dt>Email:</dt>
<dd><%= @user.email %></dd>
<dt>Access Locked:</dt>
<dd><%= @user.access_locked? %></dd>
<dt>Twitter:</dt>
<% if @user.twitter_username %>
<dd><%= link_to @user.twitter_username, "https://twitter.com/#{@user.twitter_username}" %></dd>
<% else %>
<dd>N/A</dd>
<% end %>
<dt>GitHub:</dt>
<% if @user.github_username %>
<dd><%= link_to @user.github_username, "https://github.com/#{@user.github_username}" %></dd>
<% else %>
<dd>N/A</dd>
<% end %>
</dl>
</div>
<% if @user.registered? %>
<%= render "activity" %>
<%= render "credits" %>
<%= render "notes" %>
<%= render "user_organizations" %>
<%= render "email_tools" %>
<% end %>