Display better error message after admin redirect
This commit is contained in:
parent
e7e31d0f99
commit
234c4a9092
|
@ -0,0 +1,18 @@
|
|||
- if flash[:notice]
|
||||
.alert-message.success{:"data-alert" => true}
|
||||
%a{:class => "close", :href => "#"}
|
||||
×
|
||||
%p
|
||||
= flash[:notice]
|
||||
- if flash[:warning]
|
||||
.alert-message.warning{:"data-alert" => true}
|
||||
%a{:class => "close", :href => "#"}
|
||||
×
|
||||
%p
|
||||
= flash[:warning]
|
||||
- if flash[:error]
|
||||
.alert-message.error{:"data-alert" => true}
|
||||
%a{:class => "close", :href => "#"}
|
||||
×
|
||||
%p
|
||||
= flash[:error]
|
|
@ -1,22 +1,5 @@
|
|||
#loader{:style => "display: none;"}
|
||||
= image_tag "ajax-loader.gif"
|
||||
#info_window
|
||||
- if flash[:notice]
|
||||
.alert-message.success{:"data-alert" => true}
|
||||
%a{:class => "close", :href => "#"}
|
||||
×
|
||||
%p
|
||||
= flash[:notice]
|
||||
- if flash[:warning]
|
||||
.alert-message.warning{:"data-alert" => true}
|
||||
%a{:class => "close", :href => "#"}
|
||||
×
|
||||
%p
|
||||
= flash[:warning]
|
||||
- if flash[:error]
|
||||
.alert-message.error{:"data-alert" => true}
|
||||
%a{:class => "close", :href => "#"}
|
||||
×
|
||||
%p
|
||||
= flash[:error]
|
||||
= render :partial => "layouts/flash", :locals => {:flash => flash}
|
||||
= yield
|
||||
|
|
|
@ -1,19 +1,2 @@
|
|||
- if flash[:notice]
|
||||
.alert-message.success{:"data-alert" => true}
|
||||
%a{:class => "close", :href => "#"}
|
||||
×
|
||||
%p
|
||||
= flash[:notice]
|
||||
- if flash[:warning]
|
||||
.alert-message.warning{:"data-alert" => true}
|
||||
%a{:class => "close", :href => "#"}
|
||||
×
|
||||
%p
|
||||
= flash[:warning]
|
||||
- if flash[:error]
|
||||
.alert-message.error{:"data-alert" => true}
|
||||
%a{:class => "close", :href => "#"}
|
||||
×
|
||||
%p
|
||||
= flash[:error]
|
||||
= render :partial => "layouts/flash", :locals => {:flash => flash}
|
||||
= yield
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
%p.alert-message#tagline
|
||||
= t("defaults.tagline")
|
||||
#content
|
||||
= render :partial => "layouts/flash", :locals => {:flash => flash}
|
||||
- if signed_in?
|
||||
= render :partial => "sidebar/search"
|
||||
- else
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
RailsAdmin.config do |config|
|
||||
config.authenticate_with do
|
||||
redirect_to main_app_root_path unless signed_in? && current_user.admin?
|
||||
redirect_to(main_app.root_path, :flash => {:warning => "You must be signed-in as an administrator to access that page"}) unless signed_in? && current_user.admin?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue