Skip to content

Commit

Permalink
GRN2-xx: Fixed minor issues related to deletes (bigbluebutton#506)
Browse files Browse the repository at this point in the history
* Minor fixes to improve quality

* Changed styling on login button
  • Loading branch information
farhatahmad authored and jfederico committed May 7, 2019
1 parent b5aa7ed commit 2e064de
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
11 changes: 8 additions & 3 deletions app/assets/javascripts/admins.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ $(document).on('turbolinks:load', function(){
// show the modal with the correct form action url
$(".delete-user").click(function(data){
var uid = $(data.target).closest("tr").data("user-uid")
$("#delete-confirm").parent().attr("action", "/u/" + uid)
var url = $("body").data("relative-root")
if (!url.endsWith("/")) {
url += "/"
}
url += "u/" + uid
$("#delete-confirm").parent().attr("action", url)
})

// Change the color of the color inputs when the color is changed
Expand Down Expand Up @@ -66,13 +71,13 @@ $(document).on('turbolinks:load', function(){

// Only run on the admins edit user page.
if (controller == "admins" && action == "edit_user") {
$("#users").click(function(data){
$(".setting-btn").click(function(data){
var url = $("body").data("relative-root")
if (!url.endsWith("/")) {
url += "/"
}
url += "admins"

url += "admins?setting=" + data.target.id
window.location.href = url
})
}
Expand Down
1 change: 0 additions & 1 deletion app/controllers/admins_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def index
@search = params[:search] || ""
@order_column = params[:column] && params[:direction] != "none" ? params[:column] : "created_at"
@order_direction = params[:direction] && params[:direction] != "none" ? params[:direction] : "DESC"
puts @order_direction.to_s

if Rails.configuration.loadbalanced_configuration
@pagy, @users = pagy(User.without_role(:super_admin)
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/sessions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def check_email_verified(user)
redirect_to admins_path
elsif user.activated?
# Dont redirect to any of these urls
dont_redirect_to = [root_url, signup_url, unauthorized_url, internal_error_url, not_found_url]
dont_redirect_to = [root_url, signin_url, signup_url, unauthorized_url, internal_error_url, not_found_url]
url = if cookies[:return_to] && !dont_redirect_to.include?(cookies[:return_to])
cookies[:return_to]
else
Expand Down
2 changes: 1 addition & 1 deletion app/views/admins/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<%= render "shared/settings/setting_view", admin_view: true, setting_id: "site_settings", setting_title: t("administrator.site_settings.subtitle") %>
<% end %>
<%= render "shared/modals/delete_account_modal", delete_location: "/" %>
<%= render "shared/modals/delete_account_modal", delete_location: relative_root %>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/shared/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<% elsif allow_greenlight_accounts %>
<%= link_to t("login"), signin_path, :class => "btn btn-outline-primary mx-2 sign-in-button" %>
<% elsif Rails.configuration.loadbalanced_configuration %>
<%= link_to t("login"), omniauth_login_url(:bn_launcher), :class => "btn btn-pill btn-outline-primary mx-2 sign-in-button" %>
<%= link_to t("login"), omniauth_login_url(:bn_launcher), :class => "btn btn-outline-primary mx-2 sign-in-button" %>
<% else %>
<%= link_to t("login"), signin_path, :class => "btn btn-outline-primary mx-2 sign-in-button" %>
<% end %>
Expand Down

0 comments on commit 2e064de

Please sign in to comment.