forked from External/greenlight
GRN2-247: Added Active Pending Banned Deleted tabs to manage users (#816)
* Added Active Pending Banned Deleted tabs to manage users * Removed hard coded strings * Fixed issues with sign in flow * Fixed issues with rooms not deleting
This commit is contained in:
committed by
Jesus Federico
parent
03bde37a2b
commit
49def8f405
@ -13,7 +13,7 @@
|
||||
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
%>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-group mt-n3">
|
||||
<div class="row">
|
||||
<div class="col-12 tags">
|
||||
<span style="<%= "background-color: #{role_colour(@role)};border-color: #{role_colour(@role)};" %>" class="tag custom-role-tag">
|
||||
|
33
app/views/admins/components/_manage_users_tags.html.erb
Normal file
33
app/views/admins/components/_manage_users_tags.html.erb
Normal file
@ -0,0 +1,33 @@
|
||||
<%
|
||||
# BigBlueButton open source conferencing system - http://www.bigbluespan.org/.
|
||||
# Copyright (c) 2018 BigBlueButton Inc. and by respective authors (see below).
|
||||
# This program is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free Software
|
||||
# Foundation; either version 3.0 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
# You should have received a copy of the GNU Lesser General Public License along
|
||||
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
%>
|
||||
|
||||
<div class="form-group mt-n3">
|
||||
<div class="row">
|
||||
<div class="col-12 tags">
|
||||
<span id="active" class="btn btn-sm tag manage-users-tab <%= 'selected' if @tab == 'active' %>">
|
||||
<%= t("roles.active") %>
|
||||
</span>
|
||||
<span id="pending" class="btn btn-sm tag manage-users-tab <%= 'selected' if @tab == 'pending' %>">
|
||||
<%= t("roles.pending") %>
|
||||
</span>
|
||||
<span id="denied" class="btn btn-sm tag manage-users-tab <%= 'selected' if @tab == 'denied' %>">
|
||||
<%= t("roles.banned") %>
|
||||
</span>
|
||||
<span id="deleted" class="btn btn-sm tag manage-users-tab <%= 'selected' if @tab == 'deleted' %>">
|
||||
<%= t("roles.deleted") %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -28,7 +28,9 @@
|
||||
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
%>
|
||||
|
||||
<% unless @role.nil? %>
|
||||
<% if @role.nil? %>
|
||||
<%= render "admins/components/manage_users_tags" %>
|
||||
<% else %>
|
||||
<%= render "admins/components/admins_tags" %>
|
||||
<% end %>
|
||||
|
||||
@ -91,40 +93,43 @@
|
||||
<%= render "admins/components/admins_role", role: user.highest_priority_role %>
|
||||
</td>
|
||||
<td>
|
||||
<% if roles.include?("pending") %>
|
||||
<% if !roles.include?("super_admin") %>
|
||||
<div class="item-action dropdown">
|
||||
<a href="javascript:void(0)" data-toggle="dropdown" class="icon">
|
||||
<i class="fas fa-ellipsis-v px-4"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu">
|
||||
<%= button_to admin_approve_path(user_uid: user.uid), class: "dropdown-item" do %>
|
||||
<i class="dropdown-icon far fa-check-circle"></i> <%= t("administrator.users.settings.approve") %>
|
||||
<% end %>
|
||||
<%= button_to admin_ban_path(user_uid: user.uid), class: "dropdown-item" do %>
|
||||
<i class="dropdown-icon far fa-times-circle"></i> <%= t("administrator.users.settings.decline") %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif !roles.include?("super_admin") %>
|
||||
<div class="item-action dropdown">
|
||||
<a href="javascript:void(0)" data-toggle="dropdown" class="icon">
|
||||
<i class="fas fa-ellipsis-v px-4"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu">
|
||||
<% if roles.include?("denied") %>
|
||||
<% if user.deleted? %>
|
||||
<%= button_to admin_undelete_path(user_uid: user.uid), class: "dropdown-item" do %>
|
||||
<i class="dropdown-icon fas fa-recycle"></i> <%= t("administrator.users.settings.undelete") %>
|
||||
<% end %>
|
||||
<button class="delete-user dropdown-item" data-path="<%= delete_user_path(user_uid: user.uid, permanent: "true") %>" data-toggle="modal" data-target="#deleteAccountModal">
|
||||
<i class="dropdown-icon fas fa-skull-crossbones"></i> <%= t("administrator.users.settings.perm_delete") %>
|
||||
</button>
|
||||
<% elsif roles.include?("denied") %>
|
||||
<%= button_to admin_unban_path(user_uid: user.uid), class: "dropdown-item" do %>
|
||||
<i class="dropdown-icon fas fa-lock-open"></i> <%= t("administrator.users.settings.unban") %>
|
||||
<% end %>
|
||||
<button class= "delete-user dropdown-item" data-path="<%= delete_user_path(user_uid: user.uid) %>" data-delete="temp-delete" data-toggle="modal" data-target="#deleteAccountModal">
|
||||
<i class="dropdown-icon fas fa-user-minus"></i> <%= t("administrator.users.settings.delete") %>
|
||||
</button>
|
||||
<% elsif roles.include?("pending") %>
|
||||
<%= button_to admin_approve_path(user_uid: user.uid), class: "dropdown-item" do %>
|
||||
<i class="dropdown-icon far fa-check-circle"></i> <%= t("administrator.users.settings.approve") %>
|
||||
<% end %>
|
||||
<%= button_to admin_ban_path(user_uid: user.uid), class: "dropdown-item" do %>
|
||||
<i class="dropdown-icon far fa-times-circle"></i> <%= t("administrator.users.settings.decline") %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to admin_edit_user_path(user_uid: user.uid), class: "dropdown-item" do %>
|
||||
<i class="dropdown-icon fas fa-user-edit"></i> <%= t("administrator.users.settings.edit") %>
|
||||
<% end %>
|
||||
<button class= "delete-user dropdown-item" data-toggle="modal" data-target="#deleteAccountModal">
|
||||
<i class="dropdown-icon fas fa-user-minus"></i> <%= t("administrator.users.settings.delete") %>
|
||||
</button>
|
||||
<%= button_to admin_ban_path(user_uid: user.uid), class: "dropdown-item" do %>
|
||||
<i class="dropdown-icon fas fa-lock"></i> <%= t("administrator.users.settings.ban") %>
|
||||
<% end %>
|
||||
<button class= "delete-user dropdown-item" data-path="<%= delete_user_path(user_uid: user.uid) %>" data-delete="temp-delete" data-toggle="modal" data-target="#deleteAccountModal">
|
||||
<i class="dropdown-icon fas fa-user-minus"></i> <%= t("administrator.users.settings.delete") %>
|
||||
</button>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -26,13 +26,17 @@
|
||||
<%= t("modal.delete_account.keep") %>
|
||||
</button>
|
||||
|
||||
<%= button_to delete_location, method: :delete, id: "delete-confirm", class: "btn btn-danger my-1 btn-del-room" do %>
|
||||
<%= button_to delete_location, method: :delete, id: "delete-confirm", class: "btn btn-danger my-1 btn-del-room", disabled:"" do %>
|
||||
<%= t("modal.delete_account.delete") %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<p><%= t("modal.delete_account.warning").html_safe %></p>
|
||||
<label class="custom-control custom-checkbox">
|
||||
<input id="delete-checkbox" type="checkbox" class="custom-control-input">
|
||||
<p id="perm-delete" class="custom-control-label"><%= t("modal.delete_account.warning").html_safe %></p>
|
||||
<p id="delete-warning" class="custom-control-label"><%= t("modal.delete_account.delete_warning").html_safe %></p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<center>
|
||||
<%= t("settings.delete.disclaimer").html_safe %>
|
||||
<br>
|
||||
<a href="" data-toggle="modal" data-target="#deleteAccountModal" class="btn btn-danger mt-6">
|
||||
<a href="" data-toggle="modal" data-path="<%= delete_user_path(user_uid: current_user.uid) %>" data-target="#deleteAccountModal" class="btn btn-danger mt-6 delete-user">
|
||||
<%= t("settings.delete.button") %>
|
||||
</a>
|
||||
</center>
|
||||
|
Reference in New Issue
Block a user