Implemented admin navegation with other related fixes.

stable
Andrey Antukh 2014-07-03 12:41:00 +02:00
parent 3f2b72e448
commit e0c6a04686
7 changed files with 99 additions and 28 deletions

View File

@ -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"})

View File

@ -0,0 +1,33 @@
###
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán Merino <bameda@dbarragan.com>
#
# 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 <http://www.gnu.org/licenses/>.
#
# 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)

View File

@ -85,6 +85,12 @@ MainTaigaDirective = ($log, $compile, $rootscope) ->
<span class="item">Video</span>
</a>
</li>
<li id="nav-admin">
<a href="" tg-nav="project-admin-home:project=project.slug" title="Admin">
<span class="icon icon-video"></span>
<span class="item">Admin</span>
</a>
</li>
</ul>
<div class="user">
<div class="user-settings">
@ -166,7 +172,11 @@ urls = {
"project-issues": "/project/:project/issues",
"project-search": "/project/:project/search",
"project-issues-detail": "/project/:project/issues/:ref",
"project-issues-detail-edit": "/project/:project/issues/:ref/edit"
"project-issues-detail-edit": "/project/:project/issues/:ref/edit",
# Admin
"project-admin-home": "/project/:project/admin/project-profile/details",
"project-admin-project-profile-details": "/project/:project/admin/project-profile/details"
}
init = ($log, $navurls) ->

View File

@ -1,15 +1,16 @@
extends layout
extends dummy-layout
block head
title Taiga Project management web application with scrum in mind!
block content
div.wrapper(tg-project-profile, ng-controller="ProjectProfileController as ctrl")
sidebar.menu-secondary.sidebar
div.wrapper(tg-project-profile, ng-controller="ProjectProfileController as ctrl",
ng-init="section='admin'")
sidebar.menu-secondary.sidebar(tg-admin-navigation="project-profile")
include views/modules/admin-menu
sidebar.menu-tertiary.sidebar
include views/modules/admin-submenu
sidebar.menu-tertiary.sidebar(tg-admin-navigation="details")
include views/modules/admin-submenu-project-profile
section.main.project-details
header
@ -35,4 +36,4 @@ block content
input(type="submit", class="hidden")
a.button.button-green(href="")
span Create
span Save

View File

@ -4,18 +4,23 @@ section.admin-menu
nav
ul
li
a(href="") Memberships
span.icon.icon-arrow-right
li
a(href="") Role
span.icon.icon-arrow-right
li
a(href="") Sprints
span.icon.icon-arrow-right
li
a(href="") Project values
span.icon.icon-arrow-right
li
a(href="") Project profiles
span.icon.icon-arrow-right
li#adminmenu-project-profile
a(href="", tg-nav="project-admin-project-profile-details:project=project.slug")
span.title Project profile
span.icon.icon-arrow-right
li#adminmenu-memberships
a(href="")
span.title Memberships
span.icon.icon-arrow-right
li#adminmenu-roles
a(href="")
span.title Roles
span.icon.icon-arrow-right
li#adminmenu-sprints
a(href="")
span.title Sprints
span.icon.icon-arrow-right
li#adminmenu-project-values
a(href="")
span.title Project values
span.icon.icon-arrow-right

View File

@ -0,0 +1,18 @@
section.admin-submenu
header
h1 P... Profile
nav
ul
li#adminmenu-details
a(href="", tg-nav="project-admin-project-profile-details:project=project.slug")
span.title Project Details
span.icon.icon-arrow-right
li#adminmenu-values
a(href="")
span.title Default Values
span.icon.icon-arrow-right
li#adminmenu-features
a(href="")
span.title Features
span.icon.icon-arrow-right

View File

@ -1,3 +1,7 @@
// This menu is deprecated and it is only available
// for correct not integrated pages.
// The compiled version of this is embedded in coffescript
// due to mandatory tricky hacks related to scope resolution.
nav.menu
h1.logo
a(href="", title="Home")
@ -39,7 +43,7 @@ nav.menu
a.avatar(href="", title="User preferences")
img(src="http://thecodeplayer.com/u/uifaces/12.jpg", alt="username")
div.settings
a(href="", title="User preferences") Pilar
a(href="", title="Site preferences")
span.icon.icon-settings
div.settings
a(href="", title="User preferences") Pilar
a(href="", title="Site preferences")
span.icon.icon-settings