forked from External/greenlight
GRN2-xx: Fixed minor issues related to deletes (#506)
* Minor fixes to improve quality * Changed styling on login button
This commit is contained in:
parent
b5aa7edd16
commit
2e064de0a9
|
@ -23,7 +23,12 @@ $(document).on('turbolinks:load', function(){
|
||||||
// show the modal with the correct form action url
|
// show the modal with the correct form action url
|
||||||
$(".delete-user").click(function(data){
|
$(".delete-user").click(function(data){
|
||||||
var uid = $(data.target).closest("tr").data("user-uid")
|
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
|
// Change the color of the color inputs when the color is changed
|
||||||
|
@ -66,13 +71,13 @@ $(document).on('turbolinks:load', function(){
|
||||||
|
|
||||||
// Only run on the admins edit user page.
|
// Only run on the admins edit user page.
|
||||||
if (controller == "admins" && action == "edit_user") {
|
if (controller == "admins" && action == "edit_user") {
|
||||||
$("#users").click(function(data){
|
$(".setting-btn").click(function(data){
|
||||||
var url = $("body").data("relative-root")
|
var url = $("body").data("relative-root")
|
||||||
if (!url.endsWith("/")) {
|
if (!url.endsWith("/")) {
|
||||||
url += "/"
|
url += "/"
|
||||||
}
|
}
|
||||||
url += "admins"
|
|
||||||
|
|
||||||
|
url += "admins?setting=" + data.target.id
|
||||||
window.location.href = url
|
window.location.href = url
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@ class AdminsController < ApplicationController
|
||||||
@search = params[:search] || ""
|
@search = params[:search] || ""
|
||||||
@order_column = params[:column] && params[:direction] != "none" ? params[:column] : "created_at"
|
@order_column = params[:column] && params[:direction] != "none" ? params[:column] : "created_at"
|
||||||
@order_direction = params[:direction] && params[:direction] != "none" ? params[:direction] : "DESC"
|
@order_direction = params[:direction] && params[:direction] != "none" ? params[:direction] : "DESC"
|
||||||
puts @order_direction.to_s
|
|
||||||
|
|
||||||
if Rails.configuration.loadbalanced_configuration
|
if Rails.configuration.loadbalanced_configuration
|
||||||
@pagy, @users = pagy(User.without_role(:super_admin)
|
@pagy, @users = pagy(User.without_role(:super_admin)
|
||||||
|
|
|
@ -36,7 +36,7 @@ module SessionsHelper
|
||||||
redirect_to admins_path
|
redirect_to admins_path
|
||||||
elsif user.activated?
|
elsif user.activated?
|
||||||
# Dont redirect to any of these urls
|
# 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])
|
url = if cookies[:return_to] && !dont_redirect_to.include?(cookies[:return_to])
|
||||||
cookies[:return_to]
|
cookies[:return_to]
|
||||||
else
|
else
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<%= render "shared/settings/setting_view", admin_view: true, setting_id: "site_settings", setting_title: t("administrator.site_settings.subtitle") %>
|
<%= render "shared/settings/setting_view", admin_view: true, setting_id: "site_settings", setting_title: t("administrator.site_settings.subtitle") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render "shared/modals/delete_account_modal", delete_location: "/" %>
|
<%= render "shared/modals/delete_account_modal", delete_location: relative_root %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
<% elsif allow_greenlight_accounts %>
|
<% elsif allow_greenlight_accounts %>
|
||||||
<%= link_to t("login"), signin_path, :class => "btn btn-outline-primary mx-2 sign-in-button" %>
|
<%= link_to t("login"), signin_path, :class => "btn btn-outline-primary mx-2 sign-in-button" %>
|
||||||
<% elsif Rails.configuration.loadbalanced_configuration %>
|
<% 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 %>
|
<% else %>
|
||||||
<%= link_to t("login"), signin_path, :class => "btn btn-outline-primary mx-2 sign-in-button" %>
|
<%= link_to t("login"), signin_path, :class => "btn btn-outline-primary mx-2 sign-in-button" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in New Issue