First and incomplete admin page.

stable
Andrey Antukh 2014-07-03 11:01:31 +02:00
parent 3cb59e7a6d
commit 3f2b72e448
6 changed files with 138 additions and 8 deletions

View File

@ -34,6 +34,11 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide,
$routeProvider.when("/project/:pslug/issues/:issueref/edit",
{templateUrl: "/partials/issues-detail-edit.html"})
# Admin
$routeProvider.when("/project/:pslug/admin/project-profile",
{templateUrl: "/partials/project-profile.html"})
# Auth
$routeProvider.when("/login", {templateUrl: "/partials/login.html"})
$routeProvider.when("/register", {templateUrl: "/partials/register.html"})
@ -85,6 +90,7 @@ modules = [
"taigaTaskboard",
"taigaIssues",
"taigaSearch",
"taigaAdmin",
# Vendor modules
"ngRoute",

View File

@ -0,0 +1,22 @@
###
# 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.coffee
###
module = angular.module("taigaAdmin", [])

View File

@ -0,0 +1,96 @@
###
# 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/project-profile.coffee
###
taiga = @.taiga
mixOf = @.taiga.mixOf
trim = @.taiga.trim
toString = @.taiga.toString
joinStr = @.taiga.joinStr
groupBy = @.taiga.groupBy
bindOnce = @.taiga.bindOnce
module = angular.module("taigaAdmin")
#############################################################################
## Project Profile Controller
#############################################################################
class ProjectProfileController extends mixOf(taiga.Controller, taiga.PageMixin)
@.$inject = [
"$scope",
"$rootScope",
"$tgRepo",
"$tgConfirm",
"$tgResources",
"$routeParams",
"$q",
"$location"
]
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) ->
@scope.project = {}
promise = @.loadInitialData()
promise.then null, ->
console.log "FAIL" #TODO
loadProject: ->
return @rs.projects.get(@scope.projectId).then (project) =>
@scope.project = project
# @scope.issueStatusById = groupBy(project.issue_statuses, (x) -> x.id)
# @scope.severityById = groupBy(project.severities, (x) -> x.id)
# @scope.priorityById = groupBy(project.priorities, (x) -> x.id)
# @scope.membersById = groupBy(project.memberships, (x) -> x.user)
return project
loadInitialData: ->
promise = @repo.resolve({pslug: @params.pslug}).then (data) =>
@scope.projectId = data.project
return data
return promise.then(=> @.loadProject())
module.controller("ProjectProfileController", ProjectProfileController)
#############################################################################
## Project Profile Directive
#############################################################################
ProjectProfileDirective = ($log) ->
link = ($scope, $el, $attrs) ->
$log.info "ProjectProfileDirective:link"
form = $el.find("form").checksley()
$el.on "submit", "form", (event) ->
event.preventDefault()
$log.debug "ProjectProfileDirective:submit"
$el.on "click", "form .a.button-green", (event) ->
event.preventDefault()
$log.debug "ProjectProfileDirective:submit a button"
return {link:link}
module.directive("tgProjectProfile", ["$log", ProjectProfileDirective])

View File

@ -4,9 +4,10 @@ block head
title Taiga Project management web application with scrum in mind!
block content
div.wrapper
div.wrapper(tg-project-profile, ng-controller="ProjectProfileController as ctrl")
sidebar.menu-secondary.sidebar
include views/modules/admin-menu
sidebar.menu-tertiary.sidebar
include views/modules/admin-submenu
@ -16,19 +17,22 @@ block content
form
fieldset
input(type="text", placeholder="Name")
input(type="text", placeholder="Name", ng-model="project.name")
fieldset
input(type="text", placeholder="Slug")
input(type="text", placeholder="Slug", ng-model="project.slug")
fieldset.half
input(type="text", placeholder="Number of sprints")
input(type="text", placeholder="Number of sprints",
ng-model="project.total_milestones")
fieldset.half
input(type="text", placeholder="Number of US points")
input(type="text", placeholder="Number of US points",
ng-model="project.total_story_points")
fieldset
textarea(placeholder="Description")
textarea(placeholder="Description", ng-model="project.description")
input(type="submit", class="hidden")
a.button.button-green(href="")
span Create

View File

@ -1,14 +1,15 @@
section.filters
div.filters-inner
h1
a(href="", title="back to categories") filters
a.title(href="", title="back to categories") filters
a.subfilter(href="", title="cat-name")
span.icon.icon-arrow-right
span status
form
fieldset
input(type="text", placeholder="Filter Filters", ng-model="filtersSearch.$")
input(type="text", placeholder="Filter Filters", ng-model="filters.subject")
a.icon.icon-search(href="", title="search")
//- First step for selecting category
div.filters-step-cat
//- $(.filters-applied) only visible when filters are being applied

View File

@ -43,6 +43,7 @@ paths = {
"app/coffee/modules/backlog/*.coffee",
"app/coffee/modules/taskboard/*.coffee",
"app/coffee/modules/issues/*.coffee",
"app/coffee/modules/admin/*.coffee",
"app/coffee/modules/locales/*.coffee",
"app/coffee/modules/base/*.coffee",
"app/coffee/modules/resources/*.coffee"]