From 2158937f828afd12d4cfbec6158d710a6b2b2629 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Thu, 27 Mar 2014 13:34:38 +1100 Subject: [PATCH] Adding a sidebar tab --- .../controllers/forgot_sidebar_controller.js.coffee | 6 ++++++ .../darkswarm/controllers/sidebar_controller.js.coffee | 2 +- app/assets/stylesheets/darkswarm/sidebar.css.sass | 3 +++ app/views/shared/_forgot_sidebar.html.haml | 5 +++++ app/views/shared/_sidebar.html.haml | 1 + app/views/shared/_signup_sidebar.html.haml | 1 - 6 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/darkswarm/controllers/forgot_sidebar_controller.js.coffee create mode 100644 app/views/shared/_forgot_sidebar.html.haml diff --git a/app/assets/javascripts/darkswarm/controllers/forgot_sidebar_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/forgot_sidebar_controller.js.coffee new file mode 100644 index 0000000000..075b4f0912 --- /dev/null +++ b/app/assets/javascripts/darkswarm/controllers/forgot_sidebar_controller.js.coffee @@ -0,0 +1,6 @@ +window.ForgotSidebarCtrl = Darkswarm.controller "ForgotSidebarCtrl", ($scope, $http, $location) -> + $scope.active = -> + $location.path() == '/forgot' + + $scope.select = -> + $location.path("/forgot") diff --git a/app/assets/javascripts/darkswarm/controllers/sidebar_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/sidebar_controller.js.coffee index aa9fd0595f..6f0b954116 100644 --- a/app/assets/javascripts/darkswarm/controllers/sidebar_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/sidebar_controller.js.coffee @@ -1,3 +1,3 @@ window.SidebarCtrl = Darkswarm.controller "SidebarCtrl", ($scope, $location) -> $scope.active = -> - $location.path() in ["/login", "/signup"] + $location.path() in ["/login", "/signup", "/forgot"] diff --git a/app/assets/stylesheets/darkswarm/sidebar.css.sass b/app/assets/stylesheets/darkswarm/sidebar.css.sass index de067a5afe..47a3d8f3c1 100644 --- a/app/assets/stylesheets/darkswarm/sidebar.css.sass +++ b/app/assets/stylesheets/darkswarm/sidebar.css.sass @@ -17,3 +17,6 @@ @include panel($bg, $padding, $adjust) .content background: white + + .tabs dd a + padding: 0.5em 1em diff --git a/app/views/shared/_forgot_sidebar.html.haml b/app/views/shared/_forgot_sidebar.html.haml new file mode 100644 index 0000000000..8f1f336bbd --- /dev/null +++ b/app/views/shared/_forgot_sidebar.html.haml @@ -0,0 +1,5 @@ +%tab#forgot{"ng-controller" => "ForgotSidebarCtrl", + heading: "Forgot Password?", + active: "active()", + select: "select()"} + Well you're a bit stupid then diff --git a/app/views/shared/_sidebar.html.haml b/app/views/shared/_sidebar.html.haml index aecb895674..d4c96f4a33 100644 --- a/app/views/shared/_sidebar.html.haml +++ b/app/views/shared/_sidebar.html.haml @@ -3,4 +3,5 @@ %tabset = render partial: "shared/login_sidebar" = render partial: "shared/signup_sidebar" + = render partial: "shared/forgot_sidebar" = yield :sidebar diff --git a/app/views/shared/_signup_sidebar.html.haml b/app/views/shared/_signup_sidebar.html.haml index 5296c2a922..5804151ff6 100644 --- a/app/views/shared/_signup_sidebar.html.haml +++ b/app/views/shared/_signup_sidebar.html.haml @@ -1,4 +1,3 @@ -#sign-up-content{"ng-controller" => "SignupSidebarCtrl", "ng-show" => "active()"} %tab#sign-up-content{"ng-controller" => "SignupSidebarCtrl", heading: "Signup", active: "active()",