Now implemented create/edit userstory from kanban.
parent
2d3df5f55a
commit
2ef0a69679
|
@ -70,7 +70,7 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope) ->
|
||||||
$scope.us = {
|
$scope.us = {
|
||||||
project: $scope.projectId
|
project: $scope.projectId
|
||||||
is_archived: false
|
is_archived: false
|
||||||
status: $scope.project.default_us_status
|
status: statusId or $scope.project.default_us_status
|
||||||
}
|
}
|
||||||
isNew = true
|
isNew = true
|
||||||
# Update texts for creation
|
# Update texts for creation
|
||||||
|
|
|
@ -59,8 +59,8 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
# @scope.$on("sprintform:create:success", @.loadProjectStats)
|
# @scope.$on("sprintform:create:success", @.loadProjectStats)
|
||||||
# @scope.$on("sprintform:remove:success", @.loadSprints)
|
# @scope.$on("sprintform:remove:success", @.loadSprints)
|
||||||
# @scope.$on("sprintform:remove:success", @.loadProjectStats)
|
# @scope.$on("sprintform:remove:success", @.loadProjectStats)
|
||||||
# @scope.$on("usform:new:success", @.loadUserstories)
|
@scope.$on("usform:new:success", @.onNewUserstory)
|
||||||
# @scope.$on("usform:edit:success", @.loadUserstories)
|
@scope.$on("usform:edit:success", @.onUserstoryEdited)
|
||||||
@scope.$on("kanban:us:move", @.moveUs)
|
@scope.$on("kanban:us:move", @.moveUs)
|
||||||
# @scope.$on("sprint:us:moved", @.loadSprints)
|
# @scope.$on("sprint:us:moved", @.loadSprints)
|
||||||
# @scope.$on("sprint:us:moved", @.loadProjectStats)
|
# @scope.$on("sprint:us:moved", @.loadProjectStats)
|
||||||
|
@ -157,25 +157,19 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
return promise
|
return promise
|
||||||
|
|
||||||
## Template actions
|
## Template actions
|
||||||
# editUserStory: (us) ->
|
editUserStory: (us) ->
|
||||||
# @rootscope.$broadcast("usform:edit", us)
|
@rootscope.$broadcast("usform:edit", us)
|
||||||
|
|
||||||
# deleteUserStory: (us) ->
|
addNewUs: (type, statusId) ->
|
||||||
# #TODO: i18n
|
switch type
|
||||||
# title = "Delete User Story"
|
when "standard" then @rootscope.$broadcast("usform:new", statusId)
|
||||||
# subtitle = us.subject
|
when "bulk" then @rootscope.$broadcast("usform:bulk", statusId)
|
||||||
|
|
||||||
# @confirm.ask(title, subtitle).then =>
|
onNewUserstory: (ctx, us) ->
|
||||||
# # We modify the userstories in scope so the user doesn't see the removed US for a while
|
@scope.usByStatus[us.status].splice(0, 0, us)
|
||||||
# @scope.userstories = _.without(@scope.userstories, us);
|
|
||||||
# @filterVisibleUserstories()
|
|
||||||
# @.repo.remove(us).then =>
|
|
||||||
# @.loadBacklog()
|
|
||||||
|
|
||||||
# addNewUs: (type) ->
|
onUserstoryEdited: (ctx, us) ->
|
||||||
# switch type
|
@.loadUserstories()
|
||||||
# when "standard" then @rootscope.$broadcast("usform:new")
|
|
||||||
# when "bulk" then @rootscope.$broadcast("usform:bulk")
|
|
||||||
|
|
||||||
|
|
||||||
module.controller("KanbanController", KanbanController)
|
module.controller("KanbanController", KanbanController)
|
||||||
|
@ -191,11 +185,24 @@ KanbanDirective = ($repo, $rootscope) ->
|
||||||
|
|
||||||
module.directive("tgKanban", ["$tgRepo", "$rootScope", KanbanDirective])
|
module.directive("tgKanban", ["$tgRepo", "$rootScope", KanbanDirective])
|
||||||
|
|
||||||
|
|
||||||
|
#############################################################################
|
||||||
|
## Taskboard Task Directive
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
|
KanbanUserstoryDirective = ->
|
||||||
|
link = ($scope, $el, $attrs) ->
|
||||||
|
$el.disableSelection()
|
||||||
|
return {link:link}
|
||||||
|
|
||||||
|
|
||||||
|
module.directive("tgKanbanUserstory", KanbanUserstoryDirective)
|
||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
## Kanban User Directive
|
## Kanban User Directive
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
|
|
||||||
KanbanUserDirective = ($log) ->
|
KanbanUserDirective = ($log) ->
|
||||||
template = _.template("""
|
template = _.template("""
|
||||||
<figure class="avatar">
|
<figure class="avatar">
|
||||||
|
|
|
@ -41,6 +41,9 @@ KanbanSortableDirective = ($repo, $rs, $rootscope) ->
|
||||||
#########################
|
#########################
|
||||||
|
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
|
$el.css("height", "800px")
|
||||||
|
$el.closest(".kanban-table-body").css("height", "800px")
|
||||||
|
|
||||||
oldParentScope = null
|
oldParentScope = null
|
||||||
newParentScope = null
|
newParentScope = null
|
||||||
itemEl = null
|
itemEl = null
|
||||||
|
|
|
@ -185,6 +185,12 @@ TaskboardDirective = ($rootscope) ->
|
||||||
|
|
||||||
return {link: link}
|
return {link: link}
|
||||||
|
|
||||||
|
module.directive("tgTaskboard", ["$rootScope", TaskboardDirective])
|
||||||
|
|
||||||
|
|
||||||
|
#############################################################################
|
||||||
|
## Taskboard Task Directive
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
TaskboardTaskDirective = ->
|
TaskboardTaskDirective = ->
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
|
@ -198,7 +204,7 @@ module.directive("tgTaskboardTask", TaskboardTaskDirective)
|
||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
## Task Row Size Fixer Directive
|
## Taskboard Task Row Size Fixer Directive
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
TaskboardRowSizeFixer = ->
|
TaskboardRowSizeFixer = ->
|
||||||
|
@ -210,6 +216,12 @@ TaskboardRowSizeFixer = ->
|
||||||
|
|
||||||
return {link: link}
|
return {link: link}
|
||||||
|
|
||||||
|
module.directive("tgTaskboardRowSizeFixer", TaskboardRowSizeFixer)
|
||||||
|
|
||||||
|
|
||||||
|
#############################################################################
|
||||||
|
## Taskboard us points Directive
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
TaskboardUsPointsDirective = ($repo, $confirm) ->
|
TaskboardUsPointsDirective = ($repo, $confirm) ->
|
||||||
# TODO: i18n
|
# TODO: i18n
|
||||||
|
@ -305,6 +317,4 @@ TaskboardUsPointsDirective = ($repo, $confirm) ->
|
||||||
return {link: link}
|
return {link: link}
|
||||||
|
|
||||||
|
|
||||||
module.directive("tgTaskboard", ["$rootScope", TaskboardDirective])
|
|
||||||
module.directive("tgTaskboardRowSizeFixer", TaskboardRowSizeFixer)
|
|
||||||
module.directive("tgTaskboardUsPoints", ["$tgRepo", "$tgConfirm", TaskboardUsPointsDirective])
|
module.directive("tgTaskboardUsPoints", ["$tgRepo", "$tgConfirm", TaskboardUsPointsDirective])
|
||||||
|
|
|
@ -21,3 +21,6 @@ block content
|
||||||
//-include views/modules/burndown
|
//-include views/modules/burndown
|
||||||
//-include views/modules/list-filters-kanban
|
//-include views/modules/list-filters-kanban
|
||||||
include views/modules/kanban-table
|
include views/modules/kanban-table
|
||||||
|
|
||||||
|
div.lightbox.lightbox_add-new-us.hidden(tg-lb-create-edit-userstory)
|
||||||
|
include views/modules/lightbox_add-new-us
|
||||||
|
|
|
@ -3,10 +3,10 @@ div.kanban-tagline
|
||||||
div.kanban-task-inner
|
div.kanban-task-inner
|
||||||
p.task-text
|
p.task-text
|
||||||
span.task-num(tg-bo-ref="us.ref")
|
span.task-num(tg-bo-ref="us.ref")
|
||||||
a.task-name(href="", title="", tg-bo-html="us.subject")
|
a.task-name(href="", title="", tg-bind-html="us.subject")
|
||||||
|
|
||||||
tg-kanban-user-avatar(model="us.assigned_to")
|
tg-kanban-user-avatar(model="us.assigned_to")
|
||||||
|
|
||||||
a.icon.icon-edit(href="", title="Edit", ng-click="ctrl.editTask(task)")
|
a.icon.icon-edit(href="", title="Edit", ng-click="ctrl.editUserStory(us)")
|
||||||
a.icon.icon-drag-h(href="", title="Drag&Drop")
|
a.icon.icon-drag-h(href="", title="Drag&Drop")
|
||||||
a.task-points(href="", title="task points", tg-bo-html="us.total_points") --
|
a.task-points(href="", title="task points", tg-bind-html="us.total_points") --
|
||||||
|
|
|
@ -3,11 +3,13 @@ div.kanban-table
|
||||||
div.kanban-table-inner
|
div.kanban-table-inner
|
||||||
h2.task-colum_name(ng-repeat="s in usStatusList track by s.id")
|
h2.task-colum_name(ng-repeat="s in usStatusList track by s.id")
|
||||||
span(tg-bo-html="s.name")
|
span(tg-bo-html="s.name")
|
||||||
a.icon.icon-plus(href="", title="Add New task")
|
a.icon.icon-plus(href="", title="Add New task",
|
||||||
|
ng-click="ctrl.addNewUs('standard', s.id)")
|
||||||
|
|
||||||
div.kanban-table-body
|
div.kanban-table-body
|
||||||
div.kanban-table-inner
|
div.kanban-table-inner
|
||||||
div.kanban-uses-box.task-column(ng-repeat="status in usStatusList track by status.id",
|
div.kanban-uses-box.task-column(ng-repeat="status in usStatusList track by status.id",
|
||||||
tg-kanban-sortable)
|
tg-kanban-sortable)
|
||||||
div.kanban-task(ng-repeat="us in usByStatus[status.id] track by us.id")
|
div.kanban-task(ng-repeat="us in usByStatus[status.id] track by us.id",
|
||||||
|
tg-kanban-userstory)
|
||||||
include ../components/kanban-task
|
include ../components/kanban-task
|
||||||
|
|
Loading…
Reference in New Issue