Another iteration over backlog.

stable
Andrey Antukh 2014-06-17 18:18:43 +02:00
parent 93d2c041fa
commit 5a614bd3a4
8 changed files with 102 additions and 48 deletions

View File

@ -61,7 +61,6 @@ modules = [
# Vendor modules # Vendor modules
"ngRoute", "ngRoute",
"ngAnimate", "ngAnimate",
"pasvaz.bindonce",
] ]
# Default Value for taiga local config module. # Default Value for taiga local config module.

View File

@ -77,7 +77,7 @@ BacklogDirective = ($compile, $templateCache) ->
$element.append(dom) $element.append(dom)
link = ($scope, $element, $attrs, $ctrl) -> link = ($scope, $element, $attrs, $ctrl) ->
backlogTableDom = $element.find("section.backlog-table") backlogTableDom = $element.find("section.backlog-table-body")
backlogLink($scope, backlogTableDom, $attrs, $ctrl) backlogLink($scope, backlogTableDom, $attrs, $ctrl)
return { return {
@ -92,6 +92,24 @@ BacklogDirective = ($compile, $templateCache) ->
link: link link: link
} }
SprintDirective = ($compile, $templateCache) ->
link = (scope, element, attrs) ->
sprint = scope.$eval(attrs.tgSprint)
if scope.$first
element.addClass("sprint-current")
if sprint.closed
element.addClass("sprint-closed")
# Event Handlers
element.on "click", ".sprint-summary > a", (event) ->
element.find(".sprint-table").toggle()
return {
link: link
}
module = angular.module("taigaBacklog", []) module = angular.module("taigaBacklog", [])
module.directive("tgBacklog", ["$compile", "$templateCache", BacklogDirective]) module.directive("tgBacklog", ["$compile", "$templateCache", BacklogDirective])
module.directive("tgSprint", ["$compile", SprintDirective])

View File

@ -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/base/bindonce.coffee
###
# Html bind once directive
BindHtmlDirective = ->
link = (scope, element, attrs) ->
element.html(scope.$eval(attrs.tgBoHtml))
return {link:link}
# Object reference bind once helper.
BindRefDirective = ->
link = (scope, element, attrs) ->
val = scope.$eval(attrs.tgBoRef)
element.html("##{val} ")
return {link:link}
module = angular.module("taigaBase")
module.directive("tgBoHtml", BindHtmlDirective)
module.directive("tgBoRef", BindRefDirective)

View File

@ -1,5 +1,5 @@
div.row(ng-repeat="us in userstories") div.row(ng-repeat="us in userstories")
div div.user-stories
div.user-story-name div.user-story-name
input(type="checkbox", name="") input(type="checkbox", name="")
a(href="") {{ us.subject }} a(href="") {{ us.subject }}
@ -7,8 +7,8 @@ div.row(ng-repeat="us in userstories")
a.icon.icon-edit(href="", title="Edit") a.icon.icon-edit(href="", title="Edit")
a.icon.icon-delete(href="", title="Delete") a.icon.icon-delete(href="", title="Delete")
div.user-story-tags div.user-story-tags
span.tag Tag name span.tag Tag name
span.tag Tag name span.tag Tag name
div.status Status div.status Status
div.points 12 div.points 12
div.points 54 div.points 54

View File

@ -10,40 +10,40 @@ section.backlog-table-header
div.points.width-1 Front div.points.width-1 Front
div.points.width-1 Total div.points.width-1 Total
section.backlog-table-body section.backlog-table-body
- for (var x = 0; x < 40; x++) // - for (var x = 0; x < 40; x++)
div.row // div.row
div.user-stories // div.user-stories
div.user-story-name // div.user-story-name
input(type="checkbox", name="") // input(type="checkbox", name="")
a(href="") Crear el perfil de usuario Senior en el admin // a(href="") Crear el perfil de usuario Senior en el admin
span.us-settings // span.us-settings
a.icon.icon-edit(href="", title="Edit") // a.icon.icon-edit(href="", title="Edit")
a.icon.icon-delete(href="", title="Delete") // a.icon.icon-delete(href="", title="Delete")
div.user-story-tags // div.user-story-tags
- for(var y = 0; y < 3; y++) // - for(var y = 0; y < 3; y++)
include ../components/tag // include ../components/tag
div.status.width-2 // div.status.width-2
a(href="", title="Status Name") Status Name // a(href="", title="Status Name") Status Name
ul.popover.pop-status // ul.popover.pop-status
li // li
a(href="", title="Status 1") Status 1 // a(href="", title="Status 1") Status 1
li // li
a(href="", title="Status 2") Status 2 // a(href="", title="Status 2") Status 2
li // li
a(href="", title="Status 3") Status 3 // a(href="", title="Status 3") Status 3
div.points // div.points
a(href="", title="") 24 // a(href="", title="") 24
div.points // div.points
a(href="", title="Total Points") 43 // a(href="", title="Total Points") 43
ul.popover.pop-status // ul.popover.pop-status
li // li
a(href="", title="Status 1") Status 1 // a(href="", title="Status 1") Status 1
li // li
a(href="", title="Status 2") Status 2 // a(href="", title="Status 2") Status 2
li // li
a(href="", title="Status 3") Status 3 // a(href="", title="Status 3") Status 3
a.icon.icon-drag-v(href="", title="Drag") // a.icon.icon-drag-v(href="", title="Drag")
hr.doom-line // hr.doom-line
script(type="text/ng-template" id="backlog-row.html") script(type="text/ng-template" id="backlog-row.html")
include ../components/backlog-row include ../components/backlog-row

View File

@ -10,7 +10,7 @@ section.sprints
a.button-green(href="", title="Add New US") a.button-green(href="", title="Add New US")
span.text + New sprint span.text + New sprint
section.sprint(ng-repeat="sprint in sprints track by sprint.id", tg-backlog-sprint) section.sprint(ng-repeat="sprint in sprints track by sprint.id", tg-sprint="sprint")
header header
div.sprint-summary div.sprint-summary
a.icon.icon-arrow-up(href="", title="compact Sprint") a.icon.icon-arrow-up(href="", title="compact Sprint")
@ -26,11 +26,12 @@ section.sprints
div.sprint-progress-bar div.sprint-progress-bar
div.current-progress div.current-progress
div.sprint-table div.sprint-table
- for (var x = 0; x < 10; x++) div.row(ng-repeat="us in sprint.user_stories track by us.id")
div.row div.column-us.width-8
div.column-us.width-8 a.us-name(href="", title="")
a.us-name(href="", title="") #125 Crear el perfil de usuario Senior en el admin span(tg-bo-ref="us.ref")
div.column-points.width-1 45 span(tg-bo-html="us.subject")
div.column-points.width-1(tg-bindonce-html="us.total_points")
a.button.button-gray(href="", title="Current Sprint Taskboard") a.button.button-gray(href="", title="Current Sprint Taskboard")
span Sprint Taskboard span Sprint Taskboard

View File

@ -49,7 +49,6 @@
"i18next": "~1.7.1", "i18next": "~1.7.1",
"jquery": "~2.1.1", "jquery": "~2.1.1",
"select2": "~3.4.5", "select2": "~3.4.5",
"angular-bindonce": "~0.3.1",
"angular-ui-select2": "~0.0.5", "angular-ui-select2": "~0.0.5",
"google-diff-match-patch-js": "~1.0.0", "google-diff-match-patch-js": "~1.0.0",
"underscore.string": "~2.3.3", "underscore.string": "~2.3.3",

View File

@ -51,8 +51,7 @@ vendorJsLibs = [
"app/vendor/angular/angular.js", "app/vendor/angular/angular.js",
"app/vendor/angular-route/angular-route.js", "app/vendor/angular-route/angular-route.js",
"app/vendor/angular-sanitize/angular-sanitize.js", "app/vendor/angular-sanitize/angular-sanitize.js",
"app/vendor/angular-animate/angular-animate.js", "app/vendor/angular-animate/angular-animate.js"
"app/vendor/angular-bindonce/bindonce.js"
] ]