diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index a35ad503..4b330481 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -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", diff --git a/app/coffee/modules/admin.coffee b/app/coffee/modules/admin.coffee new file mode 100644 index 00000000..6087e2e9 --- /dev/null +++ b/app/coffee/modules/admin.coffee @@ -0,0 +1,22 @@ +### +# 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.coffee +### + +module = angular.module("taigaAdmin", []) diff --git a/app/coffee/modules/admin/project-profile.coffee b/app/coffee/modules/admin/project-profile.coffee new file mode 100644 index 00000000..752c9f37 --- /dev/null +++ b/app/coffee/modules/admin/project-profile.coffee @@ -0,0 +1,96 @@ +### +# 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/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]) diff --git a/app/partials/project-details.jade b/app/partials/project-profile.jade similarity index 58% rename from app/partials/project-details.jade rename to app/partials/project-profile.jade index e57a8ba7..589b0297 100644 --- a/app/partials/project-details.jade +++ b/app/partials/project-profile.jade @@ -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 \ No newline at end of file diff --git a/app/partials/views/modules/filters.jade b/app/partials/views/modules/filters.jade index fc9bb976..4795019e 100644 --- a/app/partials/views/modules/filters.jade +++ b/app/partials/views/modules/filters.jade @@ -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 diff --git a/gulpfile.coffee b/gulpfile.coffee index 7df34ca9..093065ce 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -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"]