diff --git a/app/assets/javascripts/admin/flash.js.coffee b/app/assets/javascripts/admin/flash.js.coffee new file mode 100644 index 0000000..18cfe29 --- /dev/null +++ b/app/assets/javascripts/admin/flash.js.coffee @@ -0,0 +1,4 @@ +$ -> + $(".flash a.close").click -> + $(this).parent().fadeOut(200) + false \ No newline at end of file diff --git a/app/assets/stylesheets/admin/admin.css.sass b/app/assets/stylesheets/admin/admin.css.sass index 1237f54..48b9fe9 100644 --- a/app/assets/stylesheets/admin/admin.css.sass +++ b/app/assets/stylesheets/admin/admin.css.sass @@ -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 diff --git a/app/assets/stylesheets/admin/flash.css.sass b/app/assets/stylesheets/admin/flash.css.sass index ac24321..db7d3e0 100644 --- a/app/assets/stylesheets/admin/flash.css.sass +++ b/app/assets/stylesheets/admin/flash.css.sass @@ -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 \ No newline at end of file + color: #226600 + a.close + color: #226600 + &:hover, &:focus + background-color: #449911 + color: #ddffcc + \ No newline at end of file diff --git a/app/assets/stylesheets/admin/menu.css.sass b/app/assets/stylesheets/admin/menu.css.sass index 2082bbe..18dbd8d 100644 --- a/app/assets/stylesheets/admin/menu.css.sass +++ b/app/assets/stylesheets/admin/menu.css.sass @@ -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)") diff --git a/app/controllers/admin/admin_users_controller.rb b/app/controllers/admin/admin_users_controller.rb index 96367c1..ec4e7ac 100644 --- a/app/controllers/admin/admin_users_controller.rb +++ b/app/controllers/admin/admin_users_controller.rb @@ -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 diff --git a/app/views/admin/shared/_user.html.haml b/app/views/admin/shared/_user.html.haml index 356ba33..9071c7e 100644 --- a/app/views/admin/shared/_user.html.haml +++ b/app/views/admin/shared/_user.html.haml @@ -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 \ No newline at end of file diff --git a/app/views/shared/_flash_messages.html.haml b/app/views/shared/_flash_messages.html.haml index 63b1f4e..133b4bc 100644 --- a/app/views/shared/_flash_messages.html.haml +++ b/app/views/shared/_flash_messages.html.haml @@ -1,5 +1,10 @@ - if !flash[:notice].blank? - %p.notice= flash[:notice] + %p.flash.notice + = flash[:notice] + = link_to raw("×"), "#", :class => :close - if !flash[:alert].blank? - %p.alert= flash[:alert] \ No newline at end of file + %p.flash.alert + = flash[:alert] + = link_to raw("×"), "#", :class => :close + \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 99cacc6..1f7eae4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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: