1
0
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:
Dan Barber 2011-10-10 18:10:24 +01:00
parent 52ceb30cf8
commit 5ea9ff0f75
8 changed files with 61 additions and 13 deletions

View File

@ -0,0 +1,4 @@
$ ->
$(".flash a.close").click ->
$(this).parent().fadeOut(200)
false

View File

@ -37,6 +37,7 @@ header
a
color: #999
h1
background: #333
font-size: 2em
margin-bottom: 0em
a
@ -52,6 +53,9 @@ header
#login
h1
margin-bottom: 0.5em
position: relative
z-index: 1
@include box-shadow("0 1px 2px rgba(0, 0, 0, 0.3)")
h2
margin-top: 1.2em

View File

@ -1,14 +1,40 @@
@import "../includes/round_corners"
@import "../includes/box_shadow"
.alert, .notice
position: relative
font-size: 1em
border-style: solid
border-width: 2px 0 2px
padding: 0.7em 1.4em
border-width: 0 0 1px
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
border-color: #993300
border-color: #cc6633
background: #ffddcc
color: #662200
a.close
color: #662200
&:hover, &:focus
background-color: #cc6633
color: #ffddcc
.notice
border-color: #339900
border-color: #449911
background: #ddffcc
color: #226600
color: #226600
a.close
color: #226600
&:hover, &:focus
background-color: #449911
color: #ddffcc

View File

@ -6,17 +6,20 @@
header
nav
ul
font-size: 1em
@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
border-style: solid
border-width: 0 0 1px 0
border-color: #999
color: white
margin: 0
margin: 0 0 1em
padding: 0 1em
list-style: none
height: 2.5em
position: relative
z-index: 100
li a
@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)")

View File

@ -60,7 +60,7 @@ class Admin::AdminUsersController < Admin::AdminController
if @admin_user.update_with_password(params[:admin_user])
sign_in(@admin_user, :bypass => true)
redirect_to admin_enterprises_path, :notice => "Password updated!"
redirect_to admin_dashboard_path, :notice => "Password updated!"
else
render :edit_password
end

View File

@ -1,6 +1,6 @@
#user
%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

View File

@ -1,5 +1,10 @@
- if !flash[:notice].blank?
%p.notice= flash[:notice]
%p.flash.notice
= flash[:notice]
= link_to raw("&times;"), "#", :class => :close
- if !flash[:alert].blank?
%p.alert= flash[:alert]
%p.flash.alert
= flash[:alert]
= link_to raw("&times;"), "#", :class => :close

View File

@ -14,6 +14,12 @@ Abidownloads::Application.routes.draw do
namespace :admin do
root :to => "dashboard#index", :as => :dashboard
resources :admin_users
resource :admin_user do
member do
get :edit_password
put :update_password
end
end
end
# The priority is based upon order of creation: