From e0c6a04686a10ca1e8c3a22eb8782e3743c6b96f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 3 Jul 2014 12:41:00 +0200 Subject: [PATCH] Implemented admin navegation with other related fixes. --- app/coffee/app.coffee | 4 +-- app/coffee/modules/admin/nav.coffee | 33 +++++++++++++++++ app/coffee/modules/base.coffee | 12 ++++++- ...rofile.jade => admin-project-profile.jade} | 13 +++---- app/partials/views/modules/admin-menu.jade | 35 +++++++++++-------- .../admin-submenu-project-profile.jade | 18 ++++++++++ app/partials/views/modules/nav.jade | 12 ++++--- 7 files changed, 99 insertions(+), 28 deletions(-) create mode 100644 app/coffee/modules/admin/nav.coffee rename app/partials/{project-profile.jade => admin-project-profile.jade} (77%) create mode 100644 app/partials/views/modules/admin-submenu-project-profile.jade diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index 4b330481..79546507 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -35,8 +35,8 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, {templateUrl: "/partials/issues-detail-edit.html"}) # Admin - $routeProvider.when("/project/:pslug/admin/project-profile", - {templateUrl: "/partials/project-profile.html"}) + $routeProvider.when("/project/:pslug/admin/project-profile/details", + {templateUrl: "/partials/admin-project-profile.html"}) # Auth $routeProvider.when("/login", {templateUrl: "/partials/login.html"}) diff --git a/app/coffee/modules/admin/nav.coffee b/app/coffee/modules/admin/nav.coffee new file mode 100644 index 00000000..69cb4536 --- /dev/null +++ b/app/coffee/modules/admin/nav.coffee @@ -0,0 +1,33 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +# File: modules/admin/nav.coffee +### + +AdminNavigationDirective = -> + link = ($scope, $el, $attrs) -> + section = $attrs.tgAdminNavigation + + console.log "section:", section + $el.find(".active").removeClass("active") + $el.find("#adminmenu-#{section} a").addClass("active") + + return {link:link} + +module = angular.module("taigaAdmin") +module.directive("tgAdminNavigation", AdminNavigationDirective) diff --git a/app/coffee/modules/base.coffee b/app/coffee/modules/base.coffee index eea2f275..ef136959 100644 --- a/app/coffee/modules/base.coffee +++ b/app/coffee/modules/base.coffee @@ -85,6 +85,12 @@ MainTaigaDirective = ($log, $compile, $rootscope) -> Video +