Improving sprint creation, now the date is the last one used
parent
d5dccd8a04
commit
354d840ef6
|
@ -31,7 +31,12 @@ module = angular.module("taigaBacklog")
|
||||||
CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService) ->
|
CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService) ->
|
||||||
link = ($scope, $el, attrs) ->
|
link = ($scope, $el, attrs) ->
|
||||||
createSprint = true
|
createSprint = true
|
||||||
|
$scope.sprint = {
|
||||||
|
project: null
|
||||||
|
name: null
|
||||||
|
estimated_start: null
|
||||||
|
estimated_finish: null
|
||||||
|
}
|
||||||
# FIXME: form should be initialized once and used in
|
# FIXME: form should be initialized once and used in
|
||||||
# each submit...
|
# each submit...
|
||||||
submit = ->
|
submit = ->
|
||||||
|
@ -70,12 +75,8 @@ CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService) ->
|
||||||
|
|
||||||
$scope.$on "sprintform:create", (event, projectId) ->
|
$scope.$on "sprintform:create", (event, projectId) ->
|
||||||
createSprint = true
|
createSprint = true
|
||||||
$scope.sprint = {
|
$scope.sprint.project = projectId
|
||||||
project: projectId
|
$scope.sprint.name = null
|
||||||
name: null
|
|
||||||
estimated_start: null
|
|
||||||
estimated_finish: null
|
|
||||||
}
|
|
||||||
|
|
||||||
lastSprintNameDom = $el.find(".last-sprint-name")
|
lastSprintNameDom = $el.find(".last-sprint-name")
|
||||||
sprintName = $scope.sprints?[0].name
|
sprintName = $scope.sprints?[0].name
|
||||||
|
|
|
@ -98,6 +98,7 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
||||||
@scope.sprints = sprints
|
@scope.sprints = sprints
|
||||||
@scope.sprintsCounter = sprints.length
|
@scope.sprintsCounter = sprints.length
|
||||||
@scope.sprintsById = groupBy(sprints, (x) -> x.id)
|
@scope.sprintsById = groupBy(sprints, (x) -> x.id)
|
||||||
|
@rootscope.$broadcast("sprints:loaded", sprints)
|
||||||
return sprints
|
return sprints
|
||||||
|
|
||||||
resetFilters: ->
|
resetFilters: ->
|
||||||
|
@ -377,7 +378,7 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
||||||
obj.selected = true if isSelected("statuses", obj.id)
|
obj.selected = true if isSelected("statuses", obj.id)
|
||||||
|
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
return @scope.filters
|
return @scope.filters
|
||||||
|
|
||||||
## Template actions
|
## Template actions
|
||||||
|
|
|
@ -82,14 +82,21 @@ module.directive("tgSprintProgressbar", SprintProgressBarDirective)
|
||||||
DateSelectorDirective =->
|
DateSelectorDirective =->
|
||||||
link = ($scope, $el, $attrs, $model) ->
|
link = ($scope, $el, $attrs, $model) ->
|
||||||
$.selectedDate = null
|
$.selectedDate = null
|
||||||
$.picker = new Pikaday({
|
$el.picker = new Pikaday({
|
||||||
field: $el[0]
|
field: $el[0]
|
||||||
onSelect: (date) =>
|
onSelect: (date) =>
|
||||||
$.selectedDate = date
|
$.selectedDate = date
|
||||||
onOpen: =>
|
onOpen: =>
|
||||||
$.picker.setDate($.selectedDate) if $.selectedDate?
|
$el.picker.setDate($.selectedDate) if $.selectedDate?
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$scope.$on "sprints:loaded", (ctx, sprints) =>
|
||||||
|
if sprints.length > 0
|
||||||
|
estimatedStart = sprints[0].estimated_finish
|
||||||
|
$.selectedDate = estimatedStart
|
||||||
|
$el.val(estimatedStart)
|
||||||
|
$el.picker.setDate(estimatedStart)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
link: link
|
link: link
|
||||||
require: "ngModel"
|
require: "ngModel"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
form.login-form
|
form.login-form
|
||||||
fieldset
|
fieldset
|
||||||
input(type="text", name="username", ng-model="dataLogin.username", data-required="true",
|
input(type="text", name="username", ng-model="dataLogin.username", data-required="true",
|
||||||
placeholder="Username or email")
|
placeholder="Username or email (case sensitive)")
|
||||||
fieldset.login-password
|
fieldset.login-password
|
||||||
input(type="password", name="password", ng-model="dataLogin.password", data-required="true",
|
input(type="password", name="password", ng-model="dataLogin.password", data-required="true",
|
||||||
placeholder="Password")
|
placeholder="Password")
|
||||||
|
|
|
@ -2,7 +2,7 @@ div.login-form-container(tg-login)
|
||||||
form.login-form
|
form.login-form
|
||||||
fieldset
|
fieldset
|
||||||
input(type="text", name="username", ng-model="data.username", data-required="true",
|
input(type="text", name="username", ng-model="data.username", data-required="true",
|
||||||
placeholder="Username or Email")
|
placeholder="Username or Email (case sensitive)")
|
||||||
fieldset.login-password
|
fieldset.login-password
|
||||||
input(type="password", name="password", ng-model="data.password", data-required="true",
|
input(type="password", name="password", ng-model="data.password", data-required="true",
|
||||||
placeholder="Password")
|
placeholder="Password")
|
||||||
|
|
Loading…
Reference in New Issue