Improving sprint creation, now the date is the last one used

stable
Alejandro Alonso 2014-08-25 11:21:32 +02:00
parent d5dccd8a04
commit 354d840ef6
5 changed files with 21 additions and 12 deletions

View File

@ -31,7 +31,12 @@ module = angular.module("taigaBacklog")
CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService) ->
link = ($scope, $el, attrs) ->
createSprint = true
$scope.sprint = {
project: null
name: null
estimated_start: null
estimated_finish: null
}
# FIXME: form should be initialized once and used in
# each submit...
submit = ->
@ -70,12 +75,8 @@ CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService) ->
$scope.$on "sprintform:create", (event, projectId) ->
createSprint = true
$scope.sprint = {
project: projectId
name: null
estimated_start: null
estimated_finish: null
}
$scope.sprint.project = projectId
$scope.sprint.name = null
lastSprintNameDom = $el.find(".last-sprint-name")
sprintName = $scope.sprints?[0].name

View File

@ -98,6 +98,7 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
@scope.sprints = sprints
@scope.sprintsCounter = sprints.length
@scope.sprintsById = groupBy(sprints, (x) -> x.id)
@rootscope.$broadcast("sprints:loaded", sprints)
return sprints
resetFilters: ->

View File

@ -82,14 +82,21 @@ module.directive("tgSprintProgressbar", SprintProgressBarDirective)
DateSelectorDirective =->
link = ($scope, $el, $attrs, $model) ->
$.selectedDate = null
$.picker = new Pikaday({
$el.picker = new Pikaday({
field: $el[0]
onSelect: (date) =>
$.selectedDate = date
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 {
link: link
require: "ngModel"

View File

@ -1,7 +1,7 @@
form.login-form
fieldset
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
input(type="password", name="password", ng-model="dataLogin.password", data-required="true",
placeholder="Password")

View File

@ -2,7 +2,7 @@ div.login-form-container(tg-login)
form.login-form
fieldset
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
input(type="password", name="password", ng-model="data.password", data-required="true",
placeholder="Password")