Merge branch 'master' of https://github.com/taigaio/taiga-layout
commit
ffe3051329
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $compileProvider, $gmUrlsProvider) ->
|
configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $compileProvider, $gmUrlsProvider) ->
|
||||||
$routeProvider.when("/project/:pslug/backlog", {templateUrl: "/partials/backlog.html"})
|
$routeProvider.when("/project/:pslug/backlog", {templateUrl: "/partials/backlog.html"})
|
||||||
|
$routeProvider.when("/project/:pslug/taskboard/:id", {templateUrl: "/partials/taskboard.html"})
|
||||||
|
|
||||||
$routeProvider.when("/login", {templateUrl: "/partials/login.html"})
|
$routeProvider.when("/login", {templateUrl: "/partials/login.html"})
|
||||||
|
|
||||||
$routeProvider.otherwise({redirectTo: '/login'})
|
$routeProvider.otherwise({redirectTo: '/login'})
|
||||||
|
@ -71,6 +73,7 @@ modules = [
|
||||||
|
|
||||||
# Specific Modules
|
# Specific Modules
|
||||||
"taigaBacklog",
|
"taigaBacklog",
|
||||||
|
"taigaTaskboard",
|
||||||
|
|
||||||
# Vendor modules
|
# Vendor modules
|
||||||
"ngRoute",
|
"ngRoute",
|
||||||
|
|
|
@ -39,12 +39,19 @@ DateRangeDirective = ->
|
||||||
|
|
||||||
|
|
||||||
SprintProgressBarDirective = ->
|
SprintProgressBarDirective = ->
|
||||||
|
renderProgress = ($el, percentage) ->
|
||||||
|
if $el.is(".current-progress")
|
||||||
|
$el.css("width", "#{percentage}%")
|
||||||
|
else
|
||||||
|
$el.find(".current-progress").css("width", "#{percentage}%")
|
||||||
|
$el.find(".number").html("#{percentage} %")
|
||||||
|
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
bindOnce $scope, $attrs.tgSprintProgressbar, (sprint) ->
|
bindOnce $scope, $attrs.tgSprintProgressbar, (sprint) ->
|
||||||
closedPoints = sprint.closed_points
|
closedPoints = sprint.closed_points
|
||||||
totalPoints = sprint.total_points
|
totalPoints = sprint.total_points
|
||||||
percentage = Math.round(100 * (closedPoints/totalPoints))
|
percentage = Math.round(100 * (closedPoints/totalPoints))
|
||||||
$el.css("width", "#{percentage}%")
|
renderProgress($el, percentage)
|
||||||
|
|
||||||
return {link: link}
|
return {link: link}
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
urls = {
|
urls = {
|
||||||
"home": "/",
|
"home": "/",
|
||||||
"profile": "/:user",
|
"profile": "/:user",
|
||||||
"project": "/:user/:project",
|
"project": "/project/:project",
|
||||||
"project-backlog": "/:user/:project/backlog",
|
"project-backlog": "/project/:project/backlog",
|
||||||
"project-taskboard": "/:user/:project/taskboard/:sprint",
|
"project-taskboard": "/project/:project/taskboard/:sprint",
|
||||||
}
|
}
|
||||||
|
|
||||||
init = ($log, $navurls) ->
|
init = ($log, $navurls) ->
|
||||||
|
|
|
@ -107,5 +107,6 @@ module.run([
|
||||||
"$tgSprintsResourcesProvider",
|
"$tgSprintsResourcesProvider",
|
||||||
"$tgUserstoriesResourcesProvider",
|
"$tgUserstoriesResourcesProvider",
|
||||||
"$tgMdRenderResourcesProvider",
|
"$tgMdRenderResourcesProvider",
|
||||||
|
"$tgTasksResourcesProvider",
|
||||||
initResources
|
initResources
|
||||||
])
|
])
|
||||||
|
|
|
@ -24,6 +24,16 @@ taiga = @.taiga
|
||||||
resourceProvider = ($repo, $model) ->
|
resourceProvider = ($repo, $model) ->
|
||||||
service = {}
|
service = {}
|
||||||
|
|
||||||
|
service.get = (projectId, sprintId) ->
|
||||||
|
return $repo.queryOne("milestones", sprintId).then (sprint) ->
|
||||||
|
uses = sprint.user_stories
|
||||||
|
uses = _.map(uses, (u) -> $model.make_model("userstories", u))
|
||||||
|
sprint._attrs.user_stories = uses
|
||||||
|
return sprint
|
||||||
|
|
||||||
|
service.stats = (projectId, sprintId) ->
|
||||||
|
return $repo.queryOneRaw("milestones", "#{sprintId}/stats")
|
||||||
|
|
||||||
service.list = (projectId) ->
|
service.list = (projectId) ->
|
||||||
params = {"project": projectId}
|
params = {"project": projectId}
|
||||||
return $repo.queryMany("milestones", params).then (milestones) =>
|
return $repo.queryMany("milestones", params).then (milestones) =>
|
||||||
|
@ -33,6 +43,7 @@ resourceProvider = ($repo, $model) ->
|
||||||
m._attrs.user_stories = uses
|
m._attrs.user_stories = uses
|
||||||
return milestones
|
return milestones
|
||||||
|
|
||||||
|
|
||||||
return (instance) ->
|
return (instance) ->
|
||||||
instance.sprints = service
|
instance.sprints = service
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
###
|
||||||
|
# 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/resources/tasks.coffee
|
||||||
|
###
|
||||||
|
|
||||||
|
|
||||||
|
taiga = @.taiga
|
||||||
|
|
||||||
|
resourceProvider = ($repo) ->
|
||||||
|
service = {}
|
||||||
|
|
||||||
|
service.list = (projectId, sprintId=null) ->
|
||||||
|
params = {project: projectId}
|
||||||
|
params.milestone = sprintId if sprintId
|
||||||
|
return $repo.queryMany("tasks", params)
|
||||||
|
|
||||||
|
return (instance) ->
|
||||||
|
instance.tasks = service
|
||||||
|
|
||||||
|
|
||||||
|
module = angular.module("taigaResources")
|
||||||
|
module.factory("$tgTasksResourcesProvider", ["$tgRepo", resourceProvider])
|
|
@ -0,0 +1,113 @@
|
||||||
|
###
|
||||||
|
# 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/taskboard.coffee
|
||||||
|
###
|
||||||
|
|
||||||
|
taiga = @.taiga
|
||||||
|
mixOf = @.taiga.mixOf
|
||||||
|
|
||||||
|
class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
|
@.$inject = [
|
||||||
|
"$scope",
|
||||||
|
"$rootScope",
|
||||||
|
"$tgRepo",
|
||||||
|
"$tgConfirm",
|
||||||
|
"$tgResources",
|
||||||
|
"$routeParams",
|
||||||
|
"$q"
|
||||||
|
]
|
||||||
|
|
||||||
|
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q) ->
|
||||||
|
@scope.sprintId = @params.id
|
||||||
|
|
||||||
|
promise = @.loadInitialData()
|
||||||
|
promise.then null, ->
|
||||||
|
console.log "FAIL"
|
||||||
|
|
||||||
|
loadSprintStats: ->
|
||||||
|
return @rs.sprints.stats(@scope.projectId, @scope.sprintId).then (stats) =>
|
||||||
|
console.log "loadSprintStats",
|
||||||
|
@scope.stats = stats
|
||||||
|
return stats
|
||||||
|
|
||||||
|
loadSprint: ->
|
||||||
|
return @rs.sprints.get(@scope.projectId, @scope.sprintId).then (sprint) =>
|
||||||
|
console.log "loadSprint", sprint
|
||||||
|
@scope.sprint = sprint
|
||||||
|
@scope.userstories = sprint.user_stories
|
||||||
|
return sprint
|
||||||
|
|
||||||
|
loadTasks: ->
|
||||||
|
return @rs.tasks.list(@scope.projectId, @scope.sprintId).then (tasks) =>
|
||||||
|
@scope.tasks = tasks
|
||||||
|
@scope.tasksByStatus = _.groupBy(tasks, "status")
|
||||||
|
console.log "loadTasks", @scope.tasksByStatus
|
||||||
|
return tasks
|
||||||
|
|
||||||
|
loadProject: ->
|
||||||
|
return @rs.projects.get(@scope.projectId).then (project) =>
|
||||||
|
@scope.project = project
|
||||||
|
@scope.points = _.sortBy(project.points, "order")
|
||||||
|
@scope.statusList = _.sortBy(project.task_statuses, "id")
|
||||||
|
console.log "loadProject", @scope.statusList
|
||||||
|
return project
|
||||||
|
|
||||||
|
loadTaskboard: ->
|
||||||
|
return @q.all([
|
||||||
|
@.loadSprintStats(),
|
||||||
|
@.loadSprint()
|
||||||
|
# @.loadTasks(),
|
||||||
|
]).then(=> @.loadTasks())
|
||||||
|
|
||||||
|
loadInitialData: ->
|
||||||
|
console.log @params
|
||||||
|
promise = @repo.resolve({pslug: @params.pslug}).then (data) =>
|
||||||
|
@scope.projectId = data.project
|
||||||
|
return data
|
||||||
|
|
||||||
|
return promise.then(=> @.loadProject())
|
||||||
|
.then(=> @.loadUsersAndRoles())
|
||||||
|
.then(=> @.loadTaskboard())
|
||||||
|
#############################################################################
|
||||||
|
## TaskboardDirective
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
|
TaskboardDirective = ->
|
||||||
|
|
||||||
|
#########################
|
||||||
|
## Drag & Drop Link
|
||||||
|
#########################
|
||||||
|
|
||||||
|
linkSortable = ($scope, $el, $attrs, $ctrl) ->
|
||||||
|
console.log "TaskboardDirective:linkSortable"
|
||||||
|
|
||||||
|
link = ($scope, $el, $attrs) ->
|
||||||
|
$ctrl = $el.controller()
|
||||||
|
linkSortable($scope, $el, $attrs, $ctrl)
|
||||||
|
# linkCommon($scope, $el, $attrs, $ctrl)
|
||||||
|
|
||||||
|
$scope.$on "$destroy", ->
|
||||||
|
$el.off()
|
||||||
|
|
||||||
|
return {link: link}
|
||||||
|
|
||||||
|
|
||||||
|
module = angular.module("taigaTaskboard", [])
|
||||||
|
module.controller("TaskboardController", TaskboardController)
|
||||||
|
module.directive("tgTaskboard", TaskboardDirective)
|
|
@ -1,15 +1,15 @@
|
||||||
extends layout
|
extends dummy-layout
|
||||||
|
|
||||||
block head
|
block head
|
||||||
title Taiga Project management web application with scrum in mind!
|
title Taiga Project management web application with scrum in mind!
|
||||||
|
|
||||||
block content
|
block content
|
||||||
div.wrapper
|
div.wrapper(tg-taskboard, ng-controller="TaskboardController as ctrl")
|
||||||
section.main.taskboard
|
section.main.taskboard
|
||||||
h1
|
h1
|
||||||
span ProjectName
|
span(tg-bo-html="project.name")
|
||||||
span.green Sprint Name
|
span.green(tg-bo-html="sprint-name")
|
||||||
span.date 02/10/2014-15/10/2014
|
span.date(tg-date-range="sprint.estimated_start,sprint.estimated_finish")
|
||||||
include views/components/large-summary
|
include views/components/sprint-summary
|
||||||
include views/modules/burndown
|
include views/modules/burndown
|
||||||
include views/modules/taskboard-table
|
include views/modules/taskboard-table
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
div.summary.large-summary
|
div.summary.large-summary
|
||||||
|
div
|
||||||
div.summary-progress-bar
|
div.summary-progress-bar
|
||||||
div.current-progress
|
div.current-progress
|
||||||
div.data
|
div.data
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
div.summary.large-summary
|
||||||
|
div(tg-sprint-progressbar="sprint")
|
||||||
|
div.summary-progress-bar
|
||||||
|
div.current-progress
|
||||||
|
div.data
|
||||||
|
span.number 30%
|
||||||
|
span.description completed
|
||||||
|
ul
|
||||||
|
li
|
||||||
|
span.number 12
|
||||||
|
span.description project<br />points
|
||||||
|
li
|
||||||
|
span.number 23
|
||||||
|
span.description defined<br />points
|
||||||
|
li
|
||||||
|
span.number 12
|
||||||
|
span.description assigned<br />points
|
||||||
|
li
|
||||||
|
span.number 23
|
||||||
|
span.description closed<br />points
|
||||||
|
|
||||||
|
ul
|
||||||
|
li
|
||||||
|
span.icon.icon-bulk
|
||||||
|
span.number 73
|
||||||
|
span.description created<br />tasks
|
||||||
|
li
|
||||||
|
span.number 72
|
||||||
|
span.description closed<br />tasks
|
||||||
|
li
|
||||||
|
span.number 18
|
||||||
|
span.description remaining<br />tasks
|
||||||
|
ul
|
||||||
|
li
|
||||||
|
span.icon.icon-iocaine
|
||||||
|
span.number 10
|
||||||
|
span.description iocanie<br />doses
|
|
@ -1,4 +1,4 @@
|
||||||
div.taskboard-task
|
div.taskboard-task(ng-repeat="t in tasksByStatus[s.id] track by t.id")
|
||||||
div.taskboard-tagline
|
div.taskboard-tagline
|
||||||
- for(var y = 0; y < 3; y++)
|
- for(var y = 0; y < 3; y++)
|
||||||
a.taskboard-tag(href="", title="tasboard-tag")
|
a.taskboard-tag(href="", title="tasboard-tag")
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
div.taskboard-table
|
div.taskboard-table
|
||||||
div.taskboard-table-header
|
div.taskboard-table-header
|
||||||
div.taskboard-table-inner
|
div.taskboard-table-inner
|
||||||
- for(var z = 0; z < 11; z++)
|
h2.task-colum_name "User story"
|
||||||
h2.task-colum_name user stories
|
h2.task-colum_name(ng-repeat="s in statusList track by s.id", tg-bo-html="s.name")
|
||||||
div.taskboard-table-body
|
div.taskboard-table-body
|
||||||
div.taskboard-table-inner
|
div.taskboard-table-inner
|
||||||
div.taskboard_task-list.task-column
|
div.taskboard_task-list.task-column
|
||||||
- for(var x = 0; x < 3; x++)
|
div.task-row(ng-repeat="us in userstories track by us.id")
|
||||||
div.task-row
|
|
||||||
div.tag-list
|
div.tag-list
|
||||||
- for(var y = 0; y < 5; y++)
|
- for(var y = 0; y < 5; y++)
|
||||||
include ../components/tag
|
include ../components/tag
|
||||||
|
@ -25,8 +24,6 @@ div.taskboard-table
|
||||||
li Back
|
li Back
|
||||||
span 4.5
|
span 4.5
|
||||||
include ../components/addnewus
|
include ../components/addnewus
|
||||||
- for(var z = 0; z < 10; z++)
|
div.taskboard_task-playground.task-column(ng-repeat="s in statusList track by s.id")
|
||||||
div.taskboard_task-playground.task-column
|
div.task-row(ng-repeat="us in userstories track by us.id")
|
||||||
- for(var x = 0; x < 3; x++)
|
|
||||||
div.task-row
|
|
||||||
include ../components/taskboard-task
|
include ../components/taskboard-task
|
||||||
|
|
Loading…
Reference in New Issue