Removes views that have been replaced with the Admin Member Detailed view (#16852)
This commit is contained in:
parent
a729571200
commit
c91bdeaeb2
9 changed files with 0 additions and 383 deletions
|
|
@ -1,13 +0,0 @@
|
|||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h2>Activity</h2>
|
||||
<ul>
|
||||
<li><%= @user.comments_count %> comments</li>
|
||||
<li><%= @user.articles_count %> articles</li>
|
||||
<li><%= @user.reactions_count %> reactions</li>
|
||||
<li><%= @user.followers_count %> followers</li>
|
||||
<li><%= @user.following_users_count %> users following</li>
|
||||
<li><%= @user.badge_achievements_count %> badges</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
<div class="crayons-card p-6 grid gap-6">
|
||||
<h2>Credits</h2>
|
||||
|
||||
<div>
|
||||
<h4 class="mt-3"><%= @user.username %></h4>
|
||||
<% current_credits = @user.unspent_credits_count %>
|
||||
<p>Available User Credits: <%= current_credits %></p>
|
||||
<%= form_with scope: :user, url: admin_user_path(@user), method: :patch, local: true, html: { class: "form-inline justify-content-between mb-2" } do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.number_field :add_credits, in: 1...10_000, required: true, class: "form-control mr-3", size: 5 %>
|
||||
<%= f.text_field :new_note, placeholder: "Why are you adding these credits?", size: 50, required: true, class: "form-control" %>
|
||||
</div>
|
||||
<%= f.submit "Add Credits", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<% if current_credits.positive? %>
|
||||
<%= form_with scope: :user, url: admin_user_path(@user), method: :patch, local: true, html: { class: "form-inline justify-content-between mb-2" } do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.number_field :remove_credits, in: 1..current_credits, required: true, class: "form-control mr-3", size: 5 %>
|
||||
<%= f.text_field :new_note, placeholder: "Why are you removing these credits?", size: 50, required: true, class: "form-control" %>
|
||||
</div>
|
||||
<%= f.submit "Remove Credits", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if @organizations.present? %>
|
||||
<div>
|
||||
<h4>Organizations</h4>
|
||||
<%= form_with scope: :user, url: admin_user_path(@user), method: :patch, local: true, html: { class: "form-inline justify-content-between mb-2" } do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.number_field :add_org_credits, in: 1...10_000, required: true, class: "form-control mr-3", size: 5 %>
|
||||
<%= f.text_field :new_note, placeholder: "Why are you adding these credits?", size: 50, required: true, class: "form-control mr-3" %>
|
||||
<%= f.select :organization_id, orgs_with_credits(@organizations), {}, { class: "form-control" } %>
|
||||
</div>
|
||||
<%= f.submit "Add Org Credits", class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<%= form_with scope: :user, url: admin_user_path(@user), method: :patch, local: true, html: { class: "form-inline justify-content-between mb-2" } do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.number_field :remove_org_credits, in: 1...10_000, required: true, class: "form-control mr-3", size: 5 %>
|
||||
<%= f.text_field :new_note, placeholder: "Why are you removing these credits?", size: 50, required: true, class: "form-control mr-3" %>
|
||||
<%= f.select :organization_id, orgs_with_credits(@organizations), {}, { class: "form-control" } %>
|
||||
</div>
|
||||
<%= f.submit "Remove Org Credits", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<div class="crayons-card p-6 grid gap-2">
|
||||
<h2>Current Roles</h2>
|
||||
<p>(View full history in notes below)</p>
|
||||
<div class="crayons-card__body">
|
||||
<ul>
|
||||
<% @user.roles.each do |role| %>
|
||||
<% if role.name == "banned" || role.name == "suspended" || role.name == "super_admin" || @user.id == current_user.id %>
|
||||
<li><%= role_display_name(role) %> <em><%= role.resource_name.to_s %></em></li>
|
||||
<% else %>
|
||||
<li>
|
||||
<%= role_display_name(role) %> <em><%= role.resource_name.to_s %></em>
|
||||
<%= link_to "X", url_for(action: :destroy, user_id: @user.id, role: role.name.to_sym, resource_type: role.resource_type), method: :delete, data: { confirm: "Are you sure?" },
|
||||
class: "crayons-btn crayons-btn--danger crayons-btn--s lh-base fs-xs" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<div class="crayons-card p-6">
|
||||
<div>
|
||||
<h2 class="d-inline">Data Export</h2>
|
||||
<button type="button" data-toggle="collapse" data-target="#data-export-row" class="crayons-btn float-right">Toggle</button>
|
||||
</div>
|
||||
<div class="crayons-card__body collapse" id="data-export-row">
|
||||
<p>
|
||||
You can export a user's data here. Currently we only support exporting a user's posts and comments.
|
||||
</p>
|
||||
<p>
|
||||
You have the option of exporting to your admin account to send to the user, or exporting to the user directly.
|
||||
</p>
|
||||
<p>
|
||||
Exporting the data to your admin account will send it to your contact
|
||||
admin email (<%= ForemInstance.contact_email %>),
|
||||
and exporting to the user will send it to their email (<%= @user.email %>).
|
||||
</p>
|
||||
<div style="display: flex;">
|
||||
<%= button_to "Export to Admin", export_data_admin_user_path(@user.id), data: { confirm: "Are you sure you want to export this user's content to the ADMIN?" }, class: "crayons-btn", params: { send_to_admin: true }, style: "margin-right: 8px;" %>
|
||||
<%= button_to "Export to User", export_data_admin_user_path(@user.id), data: { confirm: "Are you sure you want to export this user's content to the USER?" }, class: "crayons-btn", params: { send_to_admin: false } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<div class="crayons-card p-6">
|
||||
<div>
|
||||
<h2 class="d-inline">Recent Reactions</h2>
|
||||
<button type="button" data-toggle="collapse" data-target="#reactions-row" class="crayons-btn float-right">Toggle</button>
|
||||
</div>
|
||||
<div class="pt-6 collapse" id="reactions-row">
|
||||
<% unless @related_vomit_reactions.empty? %>
|
||||
<% @related_vomit_reactions.each do |reaction| %>
|
||||
<a href="<%= reaction.reactable.path %>" class="list-group-item list-group-item-action px-5 d-flex justify-content-between">
|
||||
<span><%= crayons_icon_tag("twemoji/suspicious", native: true, class: "mr-1", aria_hidden: true) %><%= t("views.reactions.category.#{reaction.category}") %></span>
|
||||
<span><strong><%= reaction.reactable_type %></strong><%= reaction.reactable_type == "User" ? "" : ": #{reaction.reactable.title}" %></span>
|
||||
<em><%= reaction.created_at&.strftime("%b %e '%y") %></em>
|
||||
</a>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p><em>Nothing negative to see here! 👀</em></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
<div class="crayons-card p-6">
|
||||
<h2 class="mb-6">Recent Notes (last 10)</h2>
|
||||
|
||||
<% unless @notes.load.empty? %>
|
||||
<% @notes.each do |note| %>
|
||||
<p>
|
||||
<em>
|
||||
<%= note.created_at.strftime("%d %B %Y %H:%M UTC") %> by <%= User.find(note.author_id).username if note.author_id.present? %>
|
||||
</em> -
|
||||
<% unless note.reason.blank? %>
|
||||
<strong><%= note.reason %>:</strong>
|
||||
<% end %>
|
||||
<%= note.content %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="crayons-notice mb-6" aria-live="polite">No notes yet...</div>
|
||||
<% end %>
|
||||
<%= form_with model: @user, url: admin_user_path(@user), method: :patch, html: { class: "mb-2" }, local: true do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label "Add new note: ", class: "d-block" %>
|
||||
<%= f.text_area :new_note, class: "form-control" %>
|
||||
</div>
|
||||
<%= f.submit "Submit Note", class: "crayons-btn float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<div class="crayons-card p-6">
|
||||
<div>
|
||||
<h2 class="d-inline">Recent Reports</h2>
|
||||
<button type="button" data-toggle="collapse" data-target="#reports-row" class="crayons-btn float-right">Toggle</button>
|
||||
</div>
|
||||
<div class="pt-6 collapse" id="reports-row">
|
||||
<% unless @related_reports.empty? %>
|
||||
<% @related_reports.each do |report| %>
|
||||
<a href="<%= admin_report_path(report.id) %>" class="list-group-item list-group-item-action action px-5 d-flex justify-content-between">
|
||||
<span><%= report.category.capitalize %> (<%= report.status %>)</span>
|
||||
<span><strong><%= report.user_types(@user.id).to_sentence %></strong>: <%= report.message %></span>
|
||||
<em> <%= report.created_at&.strftime("%b %e '%y") %></em>
|
||||
</a>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p><em>Nothing to report here! 👀</em></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
<div class="crayons-card p-6 grid gap-6">
|
||||
<h2>Organization Memberships</h2>
|
||||
|
||||
<div>
|
||||
<h3>Add to New Organization</h3>
|
||||
<%= form_with model: [:admin, OrganizationMembership.new], local: true, html: { class: "form-inline justify-content-between my-3" } do |f| %>
|
||||
<%= f.hidden_field :user_id, value: @user.id %>
|
||||
<div class="form-group">
|
||||
<%= f.label "Organization ID:", class: "mr-3" %>
|
||||
<%= f.text_field :organization_id, class: "form-control mr-3", size: 8 %>
|
||||
<%= f.label "Membership Level:", class: "mr-3" %>
|
||||
<%= f.select(:type_of_user, options_for_select(%w[member admin])) %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.submit "Add to Org", class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% unless @organization_memberships.load.empty? %>
|
||||
<div>
|
||||
<h3>Manage Memberships</h3>
|
||||
<table class='table'>
|
||||
<tbody>
|
||||
<% @organization_memberships.each do |org_membership| %>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<%= org_membership.organization.path %>" target="_blank" rel="noopener">
|
||||
<h3><%= org_membership.organization.name %></h3>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<%= form_with model: [:admin, org_membership], method: :patch, local: true, html: { class: "form-inline justify-content-between" } do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label "Permission Level:", class: "mr-3" %>
|
||||
<%= f.select("type_of_user", options_for_select(%w[member admin], selected: org_membership.type_of_user)) %>
|
||||
</div>
|
||||
<%= f.submit "Update Permissions", class: "btn btn-primary " %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= form_with model: [:admin, org_membership], method: :delete, local: true, html: { class: "d-flex justify-content-end" } do |f| %>
|
||||
<%= f.submit "Remove From Org", class: "btn btn-danger", data: { confirm: "Are you sure you want to remove them from #{org_membership.organization.name}?" } %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
@ -1,165 +0,0 @@
|
|||
<div class="grid gap-6">
|
||||
<div class="crayons-card p-6">
|
||||
<h2>
|
||||
<%= @user.name %><%= link_to "@#{@user.username}", @user.path, class: "ml-2", target: "_blank", rel: "noopener" %>
|
||||
</h2>
|
||||
|
||||
<% if @user.access_locked? %>
|
||||
<div>
|
||||
<%= link_to "Unlock access", unlock_access_admin_user_path(@user), method: :patch, class: "btn btn-success" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<a href="<%= admin_user_path(@user) %>" class="crayons-btn float-right">Admin Profile</a>
|
||||
<p class="font-italic">Member since <%= @user.created_at.strftime("%b %e '%y") %></p>
|
||||
</div>
|
||||
|
||||
<%= render "activity" %>
|
||||
<%= render "current_roles" %>
|
||||
|
||||
<div class="crayons-card p-6">
|
||||
<div>
|
||||
<h2>
|
||||
User Status
|
||||
<% if @user.suspended? %>
|
||||
<span class="badge badge-danger">🚨 Member is Suspended 🚨</span>
|
||||
<% elsif @user.warned? %>
|
||||
<span class="badge badge-warning">Member is Warned</span>
|
||||
<% elsif @user.comment_suspended? %>
|
||||
<span class="badge badge-warning">Member is Comment Suspended</span>
|
||||
<% elsif @user.trusted? %>
|
||||
<span class="badge badge-success">Member is Trusted</span>
|
||||
<% else %>
|
||||
<span class="badge badge-info">Member is in Good Standing</span>
|
||||
<% end %>
|
||||
</h2>
|
||||
</div>
|
||||
<%= form_for(@user, url: user_status_admin_user_path(@user), html: { class: "mt-3" }) do |f| %>
|
||||
<div class="form-group">
|
||||
<%= f.label "Select new user status", class: "mr-3" %>
|
||||
<% options = { "Base Roles" => Constants::Role::BASE_ROLES } %>
|
||||
<% options["Special Roles"] = Constants::Role::SPECIAL_ROLES if current_user.super_admin? %>
|
||||
<%= f.select(:user_status, grouped_options_for_select(options), include_blank: true) %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.label "Reason for action:" %>
|
||||
<%= f.text_area :note_for_current_role, required: true, class: "form-control" %>
|
||||
</div>
|
||||
<%= f.submit "Update User Status", class: "crayons-btn float-right" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= render "notes" %>
|
||||
<%= render "negative_reactions" %>
|
||||
<%= render "reports" %>
|
||||
<%= render "data_export" %>
|
||||
|
||||
<div class="crayons-card p-6">
|
||||
<div>
|
||||
<h2 class="d-inline">Remove Identity</h2>
|
||||
<button type="button" data-toggle="collapse" data-target="#identity-row" class="crayons-btn float-right">Toggle</button>
|
||||
</div>
|
||||
<div class="pt-6 collapse" id="identity-row">
|
||||
<p>Removing a social account identity can solve certain sign in issues, for example:</p>
|
||||
<ul>
|
||||
<li>
|
||||
They created an account on <%= community_name %>, but deleted their original social account and recreated it with the same Twitter/GitHub username.
|
||||
This will be true if their Twitter/GitHub account's UID does not match their identity's UID. You can use the following third party tools to check:
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://tweeterid.com/?username=<%= @user.twitter_username %>" target="_blank" rel="noopener nofollow">Tweeter ID for Twitter (username is in URL for reference)</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://caius.github.io/github_id/#<%= @user.github_username %>" target="_blank" rel="noopener nofollow">Caius's GitHub ID Lookup Tool</a>
|
||||
</li>
|
||||
</ul>
|
||||
Steps to check:
|
||||
<ol>
|
||||
<li>Click one of the links to check their social account's UID.</li>
|
||||
<li>Confirm whether or not it matches with the identity's UID.</li>
|
||||
<li>If it doesn't match, delete the respective identity.</li>
|
||||
<li>Ask the user to reauthorize their social account via <%= app_url(user_settings_path(:account)) %></li>
|
||||
</ol>
|
||||
</li>
|
||||
<% @user.identities.each do |identity| %>
|
||||
<%= form_for(@user, url: remove_identity_admin_user_path(@user), html: { method: :delete, onsubmit: "return confirm('Are you sure? This should only be done as a solution for the listed example(s).)" }) do |f| %>
|
||||
<%= f.hidden_field :identity_id, value: identity.id %>
|
||||
<p><b><%= identity.provider.capitalize %> UID: <%= identity.uid %> - Username: <%= identity.auth_data_dump.present? ? identity.auth_data_dump["info"]["nickname"] : "no auth data dump available! 😞" %></b></p>
|
||||
<%= f.submit "Delete #{identity.provider.capitalize} Identity", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="crayons-card p-6">
|
||||
<div>
|
||||
<h2 class="d-inline">Semi-Destructive Actions</h2>
|
||||
<button type="button" data-toggle="collapse" data-target="#semidestructive-actions" class="crayons-btn float-right">Toggle</button>
|
||||
</div>
|
||||
<div id="semidestructive-actions" class="pt-6 collapse">
|
||||
<h3>Unpublish all posts</h3>
|
||||
<p>This will make all links of the user's posts unreachable. If the user is not suspended, they can still re-publish their posts.</p>
|
||||
<%= form_for(@user, url: unpublish_all_articles_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? All posts will be unavailable to the community.')" }) do |f| %>
|
||||
<button class="btn btn-warning">🔒 Unpublish all posts 🔒</button>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="crayons-card p-6">
|
||||
<div>
|
||||
<h2 class="d-inline">Destructive Actions</h2>
|
||||
<button type="button" data-toggle="collapse" data-target="#destructive-actions" class="crayons-btn float-right">Toggle</button>
|
||||
</div>
|
||||
|
||||
<div id="destructive-actions" class="pt-6 collapse">
|
||||
<div class="mb-6">
|
||||
<h3>Merge User</h3>
|
||||
<p>To merge a duplicate account, make sure you are currently on the page of the user you want to KEEP. Below, add the user id of the account to merge information from, and delete.</p>
|
||||
<%= form_for(@user, url: merge_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Merging will delete all the other users content and combine it with this user')" }) do |f| %>
|
||||
<%= f.label "User to be deleted:" %>
|
||||
<%= f.text_field :merge_user_id, placeholder: "#ID" %>
|
||||
<%= f.submit "Merge Users", class: "btn btn-danger" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<h3>Banish User</h3>
|
||||
<% if @user.comments.where("created_at < ?", 100.days.ago).empty? && @user.created_at < 100.days.ago %>
|
||||
<p>
|
||||
<em>This is extremely destructive. Banishing will delete all the user's existing content and change their username to @spam_###.</em>
|
||||
</p>
|
||||
<p><strong>Do not do this lightly.</strong></p>
|
||||
<%= form_for(@user, url: banish_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Banishing will delete all articles and turn their username into @spam_###')" }) do %>
|
||||
<button class="btn btn-danger">🚫 Banish User for Spam 🚫</button>
|
||||
<% end %>
|
||||
<% elsif current_user.super_admin? || current_user.support_admin? %>
|
||||
<p><strong>This is not a new user.</strong> You are only allowed to take this action because you are a
|
||||
<strong>super admin or a support admin.</strong></p>
|
||||
<p>
|
||||
<em>This is extremely destructive. Banishing will delete all the user's existing content and change their username to @spam_###.</em>
|
||||
</p>
|
||||
<p><strong>Do not do this lightly.</strong></p>
|
||||
<%= form_for(@user, url: banish_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Banishing will delete all articles and turn their username into @spam_###')" }) do %>
|
||||
<button class="btn btn-danger">Banish User for Spam!</button>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p><em>This is not a new user. Only super admins or support admins are allowed to banish this user.</em></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if current_user.super_admin? %>
|
||||
<div>
|
||||
<h3>Fully Delete User</h3>
|
||||
<p>This will
|
||||
<strong>completely destroy the user</strong> and all of their activity from our database. This action is irreversible.
|
||||
</p>
|
||||
<p><strong>Do not do this lightly.</strong></p>
|
||||
<%= form_for(@user, url: full_delete_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible.')" }) do |f| %>
|
||||
<button class="btn btn-danger">☠️ Fully Delete User & All Activity ☠️</button>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Loading…
Add table
Reference in a new issue