-
-
Notifications
You must be signed in to change notification settings - Fork 495
/
_user_info.html.erb
47 lines (44 loc) · 3.03 KB
/
_user_info.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<div id="user-info" class="row">
<div class='col-md-12 text-center' id='user-info-image'>
<div class="pull-right" style="margin-top: 15px;">
<span class="btn-group left-col-dropdown">
<%= link_to content_tag(:small, '', class: 'fas fa-ellipsis-v ticket-ellipsis btn'), '#', class: 'dropdown-toggle', data: { toggle: 'dropdown' }%>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li><%= link_to t(:open_new_discussion, default: 'Open Discussion'), new_admin_topic_path(user_id: @user.id), remote: true, class: '' if tickets? %></li>
<li><%= link_to t(:edit_user, default: 'Edit User'), edit_admin_user_path(@user), remote: false %></li>
<li><%= link_to t(:scrub_user, default: 'Anonymize User'), admin_scrub_user_path(@user), remote: true,
method: :post,
data: { confirm: "Are you sure you want to anonymize #{@user.name}? This will anonymize the user and retain all of their public discussions." } if current_user.is_admin? && @user.can_scrub_and_delete? %></li>
<li><%= link_to t(:delete_user, default: 'Delete User'), admin_user_path(@user), remote: true,
method: :delete,
data: { confirm: "Are you sure you want to delete #{@user.name}? This will remove the user an any tickets or forum topics the user has created." } if current_user.is_admin? && @user.can_scrub_and_delete? %></li>
</ul>
</span>
</div>
<%= link_to avatar_image(@user, size=90), admin_user_path(@user), remote: true %>
</div>
</div>
<div class="row">
<div class='col-md-12' id='user-info-info'>
<div id="user-contact-info" class="user-info">
<div class="tiny-header"><%= best_in_place @user, :name, as: :input, url: admin_user_path(@user) %></div>
<span class="small">
<% if @user.account_number.present? %>
<%= t(:account_number, default: 'Account:') %>
<%= best_in_place @user, :account_number, as: :input, url: admin_user_path(@user) %>
<br/>
<% end %>
<%= best_in_place @user, :company, as: :input, url: admin_user_path(@user) unless @user.company.nil? %><br/>
<%= best_in_place @user, :city, as: :input, url: admin_user_path(@user) %><%= ', ' unless @user.city.nil? %>
<%= best_in_place @user, :state, as: :input, url: admin_user_path(@user) unless @user.state.nil? %>
<%= best_in_place @user, :zip, as: :input, url: admin_user_path(@user) %>
</span>
</div>
<div id="user-contact-info" class="user-info">
<div class="tiny-header"><%= t(:contact_info, default: "Contact") %>:</div>
<%= t(:work_phone, default: "work") %>: <%= best_in_place @user, :work_phone, as: :input, url: admin_user_path(@user) %><br/>
<%= t(:cell_phone, default: "cell") %>: <%= best_in_place @user, :cell_phone, as: :input, url: admin_user_path(@user) %><br/>
<%= best_in_place @user, :email, as: :input, url: admin_user_path(@user) %><br/>
</div>
</div>
</div>