mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Fixed up Change Password screens. Restyles flash messages and added the
ability to close them.
This commit is contained in:
parent
52ceb30cf8
commit
5ea9ff0f75
4
app/assets/javascripts/admin/flash.js.coffee
Normal file
4
app/assets/javascripts/admin/flash.js.coffee
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
$ ->
|
||||||
|
$(".flash a.close").click ->
|
||||||
|
$(this).parent().fadeOut(200)
|
||||||
|
false
|
||||||
@ -37,6 +37,7 @@ header
|
|||||||
a
|
a
|
||||||
color: #999
|
color: #999
|
||||||
h1
|
h1
|
||||||
|
background: #333
|
||||||
font-size: 2em
|
font-size: 2em
|
||||||
margin-bottom: 0em
|
margin-bottom: 0em
|
||||||
a
|
a
|
||||||
@ -52,6 +53,9 @@ header
|
|||||||
#login
|
#login
|
||||||
h1
|
h1
|
||||||
margin-bottom: 0.5em
|
margin-bottom: 0.5em
|
||||||
|
position: relative
|
||||||
|
z-index: 1
|
||||||
|
@include box-shadow("0 1px 2px rgba(0, 0, 0, 0.3)")
|
||||||
|
|
||||||
h2
|
h2
|
||||||
margin-top: 1.2em
|
margin-top: 1.2em
|
||||||
|
|||||||
@ -1,14 +1,40 @@
|
|||||||
|
@import "../includes/round_corners"
|
||||||
|
@import "../includes/box_shadow"
|
||||||
|
|
||||||
.alert, .notice
|
.alert, .notice
|
||||||
|
position: relative
|
||||||
|
font-size: 1em
|
||||||
border-style: solid
|
border-style: solid
|
||||||
border-width: 2px 0 2px
|
border-width: 0 0 1px
|
||||||
padding: 0.7em 1.4em
|
padding: 0.7em 2em
|
||||||
|
margin: -1em -2em 0
|
||||||
|
a.close
|
||||||
|
font-size: 1em
|
||||||
|
position: absolute
|
||||||
|
font-weight: bold
|
||||||
|
right: 0em
|
||||||
|
top: 0em
|
||||||
|
text-decoration: none
|
||||||
|
padding: 0.7em 1em
|
||||||
|
color: #666
|
||||||
|
|
||||||
.alert
|
.alert
|
||||||
border-color: #993300
|
border-color: #cc6633
|
||||||
background: #ffddcc
|
background: #ffddcc
|
||||||
color: #662200
|
color: #662200
|
||||||
|
a.close
|
||||||
|
color: #662200
|
||||||
|
&:hover, &:focus
|
||||||
|
background-color: #cc6633
|
||||||
|
color: #ffddcc
|
||||||
|
|
||||||
.notice
|
.notice
|
||||||
border-color: #339900
|
border-color: #449911
|
||||||
background: #ddffcc
|
background: #ddffcc
|
||||||
color: #226600
|
color: #226600
|
||||||
|
a.close
|
||||||
|
color: #226600
|
||||||
|
&:hover, &:focus
|
||||||
|
background-color: #449911
|
||||||
|
color: #ddffcc
|
||||||
|
|
||||||
@ -6,17 +6,20 @@
|
|||||||
header
|
header
|
||||||
nav
|
nav
|
||||||
ul
|
ul
|
||||||
|
font-size: 1em
|
||||||
@include v-linear-grad(rgba(0,0,0,0), rgba(0,0,0,0.2))
|
@include v-linear-grad(rgba(0,0,0,0), rgba(0,0,0,0.2))
|
||||||
@include box-shadow("0 1px 0 rgba(0, 0, 0, 0.1), inset 0 -1px 0 rgba(255, 255, 255, 0.5)")
|
@include box-shadow("0 1px 2px rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(255, 255, 255, 0.5)")
|
||||||
background-color: #DDD
|
background-color: #DDD
|
||||||
border-style: solid
|
border-style: solid
|
||||||
border-width: 0 0 1px 0
|
border-width: 0 0 1px 0
|
||||||
border-color: #999
|
border-color: #999
|
||||||
color: white
|
color: white
|
||||||
margin: 0
|
margin: 0 0 1em
|
||||||
padding: 0 1em
|
padding: 0 1em
|
||||||
list-style: none
|
list-style: none
|
||||||
height: 2.5em
|
height: 2.5em
|
||||||
|
position: relative
|
||||||
|
z-index: 100
|
||||||
li a
|
li a
|
||||||
@include v-linear-grad(rgba(0,0,0,0), rgba(0,0,0,0.2))
|
@include v-linear-grad(rgba(0,0,0,0), rgba(0,0,0,0.2))
|
||||||
@include box-shadow("0 1px 0 rgba(0, 0, 0, 0.1), inset 0 -1px 0 rgba(255, 255, 255, 0.5)")
|
@include box-shadow("0 1px 0 rgba(0, 0, 0, 0.1), inset 0 -1px 0 rgba(255, 255, 255, 0.5)")
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class Admin::AdminUsersController < Admin::AdminController
|
|||||||
|
|
||||||
if @admin_user.update_with_password(params[:admin_user])
|
if @admin_user.update_with_password(params[:admin_user])
|
||||||
sign_in(@admin_user, :bypass => true)
|
sign_in(@admin_user, :bypass => true)
|
||||||
redirect_to admin_enterprises_path, :notice => "Password updated!"
|
redirect_to admin_dashboard_path, :notice => "Password updated!"
|
||||||
else
|
else
|
||||||
render :edit_password
|
render :edit_password
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#user
|
#user
|
||||||
%strong= current_admin_user.email
|
%strong= current_admin_user.email
|
||||||
//|
|
|
|
||||||
//= link_to "Change Password", edit_password_admin_admin_user_path
|
= link_to "Change Password", edit_password_admin_admin_user_path
|
||||||
|
|
|
|
||||||
= link_to "Logout", destroy_admin_user_session_path, :method => :delete
|
= link_to "Logout", destroy_admin_user_session_path, :method => :delete
|
||||||
@ -1,5 +1,10 @@
|
|||||||
- if !flash[:notice].blank?
|
- if !flash[:notice].blank?
|
||||||
%p.notice= flash[:notice]
|
%p.flash.notice
|
||||||
|
= flash[:notice]
|
||||||
|
= link_to raw("×"), "#", :class => :close
|
||||||
|
|
||||||
- if !flash[:alert].blank?
|
- if !flash[:alert].blank?
|
||||||
%p.alert= flash[:alert]
|
%p.flash.alert
|
||||||
|
= flash[:alert]
|
||||||
|
= link_to raw("×"), "#", :class => :close
|
||||||
|
|
||||||
@ -14,6 +14,12 @@ Abidownloads::Application.routes.draw do
|
|||||||
namespace :admin do
|
namespace :admin do
|
||||||
root :to => "dashboard#index", :as => :dashboard
|
root :to => "dashboard#index", :as => :dashboard
|
||||||
resources :admin_users
|
resources :admin_users
|
||||||
|
resource :admin_user do
|
||||||
|
member do
|
||||||
|
get :edit_password
|
||||||
|
put :update_password
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# The priority is based upon order of creation:
|
# The priority is based upon order of creation:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user