dpc-admin/app/views/users/show.html.erb
<% title @user.name %>
<div class="ds-l-container ds-u-padding-x--0">
<div>
<%= link_to users_path, class: "utility-button" do %>
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<use xlink:href="/admin/assets/solid.svg#arrow-left"></use>
</svg>
Go back
<% end %>
</div>
<section class="ds-u-display--flex ds-u-justify-content--between ds-u-align-items--center">
<h1 class="ds-u-font-size--title ds-u-font-weight--normal ds-u-margin--0"><%= @user.name %></h1>
<div>
<%= link_to "Edit user", edit_user_url(@user), class: "ds-c-button ds-c-button--primary" %>
</div>
</section>
<section class="box box--flex">
<div class="box__content">
<h2 class="box__heading">Tags</h2>
<div class="ds-u-margin-bottom--3" data-test="user-tags">
<% if @user.taggings.count == 0 %>
<p>No tags have been assigned to <%= @user.name %>.</p>
<% else %>
<% @user.taggings.each do |tagging| %>
<%= link_to(tagging_url(tagging), class: "site-pills__item__button dashboard__pills--delete", method: :delete, data: {test: "delete-tag-#{tagging.id}"}) do %>
<span class="site-pills__item site-pills__item--small">
<%= tagging.tag_name %>
</span>
<% end %>
<% end %>
<% end %>
</div>
<div>
<div class="ds-c-label ds-u-margin-top--0">New tag</div>
<div data-test="new-tags">
<% if @tags.count == 0 %>
<p>There are no tags available.</p>
<% else %>
<% @tags.each do |tag| %>
<div class="site-pills__item__button dashboard__pills--add">
<%= form_for Tagging.new, url: taggings_path, html: { method: :post } do |f| %>
<%= f.hidden_field :tag_id, value: tag.id %>
<%= f.hidden_field :taggable_id, value: @user.id %>
<%= f.hidden_field :taggable_type, value: 'User' %>
<%= f.submit tag.name, class: "site-pills__item site-pills__item--small", data: {test: "add-tag-#{tag.id}"} %>
<% end %>
</div>
<% end %>
<% end %>
</div>
</div>
</div>
<div class="box__content">
<h2 class="box__heading">Assigned organization</h2>
<% if @user.organizations.present? %>
<% @user.organizations.each do |org| %>
<div class="ds-u-margin-bottom--1">
<svg class="icon ds-u-margin-right--1 ds-u-color--muted" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<use xlink:href="/admin/assets/solid.svg#clinic-medical"></use>
</svg>
<%= link_to org.name, organization_path(org) %>
</div>
<div class="ds-u-margin-bottom--1">
<svg class="icon ds-u-margin-right--1 ds-u-color--muted" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<use xlink:href="/admin/assets/solid.svg#shapes"></use>
</svg>
<%= org.organization_type.titleize %>
</div>
<div class="">
<svg class="icon ds-u-margin-right--1 ds-u-color--muted" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<use xlink:href="/admin/assets/solid.svg#map-marker-alt"></use>
</svg>
<%= org.address_street %>
</div>
<% if org.address_street_2.present? %>
<div class="ds-u-padding-x--3">
<%= org.address_street_2 %>
<div>
<% end %>
<div class="ds-u-padding-x--3">
<%= org.address_city %>, <%= org.address_state %> <%= org.address_zip %>
</div>
<% end %>
<% else %>
<p class="ds-u-color--muted">You have not assigned an organization to this person yet.</p>
<%= link_to "Assign an organization", edit_user_url, class: "ds-c-button", data: { test: 'assign-org-link' } %>
<% end %>
</div>
</section>
<section class="box">
<div class="box__content">
<h2 class="box__heading">Signup info</h2>
<div class="ds-l-row">
<div class="ds-l-col">
<h3 class="box__subhead">Personal info</h3>
<div class="ds-u-margin-bottom--1">
<svg class="icon ds-u-margin-right--1 ds-u-color--muted" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<use xlink:href="/admin/assets/solid.svg#user-alt"></use>
</svg>
<%= @user.name %>
</div>
<div class="ds-u-margin-bottom--1">
<svg class="icon ds-u-margin-right--1 ds-u-color--muted" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<use xlink:href="/admin/assets/solid.svg#envelope"></use>
</svg>
<%= @user.email %>
</div>
</div>
<div class="ds-l-col">
<h3 class="box__subhead">Requested organization</h3>
<div class="ds-u-margin-bottom--1">
<svg class="icon ds-u-margin-right--1 ds-u-color--muted" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<use xlink:href="/admin/assets/solid.svg#clinic-medical"></use>
</svg>
<%= @user.requested_organization %>
</div>
<% unless @user.requested_organization_type == "health_it_vendor" %>
<div class="ds-u-margin-bottom--1">
<svg class="icon ds-u-margin-right--1 ds-u-color--muted" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<use xlink:href="/admin/assets/solid.svg#users"></use>
</svg>
<%= @user.requested_num_providers %>
</div>
<% end %>
<div class="ds-u-margin-bottom--1">
<svg class="icon ds-u-margin-right--1 ds-u-color--muted" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<use xlink:href="/admin/assets/solid.svg#shapes"></use>
</svg>
<%= @user.requested_organization_type.titleize %>
</div>
<div>
<svg class="icon ds-u-margin-right--1 ds-u-color--muted" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<use xlink:href="/admin/assets/solid.svg#map-marker-alt"></use>
</svg>
<%= @user.address_1 %>
</div>
<% if @user.address_2.length > 1 %>
<div class="ds-u-padding-x--3">
<%= @user.address_2 %>
<div>
<% end %>
<div class="ds-u-padding-x--3">
<%= @user.city %>, <%= @user.state %> <%= @user.zip %>
</div>
</div>
</div>
</div>
</section>
<div class="button__container">
<%= form_for @user, url: user_path(@user), data: { confirm: 'Are you sure you want to delete the user\'s account?' }, html: { method: :delete } do |f| %>
<%= f.submit "Delete user account", class:"ds-c-button ds-c-button--danger", data: { test: "delete-user-account" } %>
<% end %>
</div>
</div>