US navigation
parent
58a19f1425
commit
fccd26c749
|
@ -492,93 +492,6 @@ DeleteButtonDirective = ($log, $repo, $confirm, $location, $template) ->
|
||||||
|
|
||||||
module.directive("tgDeleteButton", ["$log", "$tgRepo", "$tgConfirm", "$tgLocation", "$tgTemplate", DeleteButtonDirective])
|
module.directive("tgDeleteButton", ["$log", "$tgRepo", "$tgConfirm", "$tgLocation", "$tgTemplate", DeleteButtonDirective])
|
||||||
|
|
||||||
|
|
||||||
# #############################################################################
|
|
||||||
# ## Editable subject directive
|
|
||||||
# #############################################################################
|
|
||||||
#
|
|
||||||
# EditableSubjectDirective = ($rootscope, $repo, $confirm, $loading, $modelTransform, $template) ->
|
|
||||||
# template = $template.get("common/components/editable-subject.html")
|
|
||||||
#
|
|
||||||
# link = ($scope, $el, $attrs, $model) ->
|
|
||||||
#
|
|
||||||
# $scope.$on "object:updated", () ->
|
|
||||||
# $el.find('.edit-subject').hide()
|
|
||||||
# $el.find('.view-subject').show()
|
|
||||||
#
|
|
||||||
# isEditable = ->
|
|
||||||
# return $scope.project.my_permissions.indexOf($attrs.requiredPerm) != -1
|
|
||||||
#
|
|
||||||
# save = (subject) ->
|
|
||||||
# currentLoading = $loading()
|
|
||||||
# .target($el.find('.save-container'))
|
|
||||||
# .start()
|
|
||||||
#
|
|
||||||
# transform = $modelTransform.save (item) ->
|
|
||||||
# item.subject = subject
|
|
||||||
#
|
|
||||||
# return item
|
|
||||||
#
|
|
||||||
# transform.then =>
|
|
||||||
# $confirm.notify("success")
|
|
||||||
# $rootscope.$broadcast("object:updated")
|
|
||||||
# $el.find('.edit-subject').hide()
|
|
||||||
# $el.find('.view-subject').show()
|
|
||||||
#
|
|
||||||
# transform.then null, ->
|
|
||||||
# $confirm.notify("error")
|
|
||||||
#
|
|
||||||
# transform.finally ->
|
|
||||||
# currentLoading.finish()
|
|
||||||
#
|
|
||||||
# return transform
|
|
||||||
#
|
|
||||||
# $el.click ->
|
|
||||||
# return if not isEditable()
|
|
||||||
# $el.find('.edit-subject').show()
|
|
||||||
# $el.find('.view-subject').hide()
|
|
||||||
# $el.find('input').focus()
|
|
||||||
#
|
|
||||||
# $el.on "click", ".save", (e) ->
|
|
||||||
# e.preventDefault()
|
|
||||||
#
|
|
||||||
# subject = $scope.item.subject
|
|
||||||
# save(subject)
|
|
||||||
#
|
|
||||||
# $el.on "keyup", "input", (event) ->
|
|
||||||
# if event.keyCode == 13
|
|
||||||
# subject = $scope.item.subject
|
|
||||||
# save(subject)
|
|
||||||
# else if event.keyCode == 27
|
|
||||||
# $scope.$apply () => $model.$modelValue.revert()
|
|
||||||
#
|
|
||||||
# $el.find('.edit-subject').hide()
|
|
||||||
# $el.find('.view-subject').show()
|
|
||||||
#
|
|
||||||
# $el.find('.edit-subject').hide()
|
|
||||||
#
|
|
||||||
# $scope.$watch $attrs.ngModel, (value) ->
|
|
||||||
# return if not value
|
|
||||||
# $scope.item = value
|
|
||||||
#
|
|
||||||
# if not isEditable()
|
|
||||||
# $el.find('.view-subject .edit').remove()
|
|
||||||
#
|
|
||||||
# $scope.$on "$destroy", ->
|
|
||||||
# $el.off()
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# return {
|
|
||||||
# link: link
|
|
||||||
# restrict: "EA"
|
|
||||||
# require: "ngModel"
|
|
||||||
# template: template
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# module.directive("tgEditableSubject", ["$rootScope", "$tgRepo", "$tgConfirm", "$tgLoading", "$tgQueueModelTransformation",
|
|
||||||
# "$tgTemplate", EditableSubjectDirective])
|
|
||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
## Editable description directive
|
## Editable description directive
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
|
@ -166,20 +166,6 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
|
|
||||||
@modelTransform.setObject(@scope, 'us')
|
@modelTransform.setObject(@scope, 'us')
|
||||||
|
|
||||||
if @scope.us.neighbors.previous?.ref?
|
|
||||||
ctx = {
|
|
||||||
project: @scope.project.slug
|
|
||||||
ref: @scope.us.neighbors.previous.ref
|
|
||||||
}
|
|
||||||
@scope.previousUrl = @navUrls.resolve("project-userstories-detail", ctx)
|
|
||||||
|
|
||||||
if @scope.us.neighbors.next?.ref?
|
|
||||||
ctx = {
|
|
||||||
project: @scope.project.slug
|
|
||||||
ref: @scope.us.neighbors.next.ref
|
|
||||||
}
|
|
||||||
@scope.nextUrl = @navUrls.resolve("project-userstories-detail", ctx)
|
|
||||||
|
|
||||||
return us
|
return us
|
||||||
|
|
||||||
loadSprint: ->
|
loadSprint: ->
|
||||||
|
|
|
@ -23,14 +23,31 @@ class StoryHeaderController
|
||||||
@.$inject = [
|
@.$inject = [
|
||||||
"$rootScope",
|
"$rootScope",
|
||||||
"$tgConfirm",
|
"$tgConfirm",
|
||||||
"$tgQueueModelTransformation"
|
"$tgQueueModelTransformation",
|
||||||
|
"$tgNavUrls",
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@rootScope, @confirm, @modelTransform) ->
|
constructor: (@rootScope, @confirm, @modelTransform, @navUrls) ->
|
||||||
@.editMode = false
|
@.editMode = false
|
||||||
@.loadingSubject = false
|
@.loadingSubject = false
|
||||||
@.originalSubject = @.item.subject
|
@.originalSubject = @.item.subject
|
||||||
|
|
||||||
|
console.log @.item
|
||||||
|
|
||||||
|
if @.item.neighbors.previous?.ref?
|
||||||
|
ctx = {
|
||||||
|
project: @.project.slug
|
||||||
|
ref: @.item.neighbors.previous.ref
|
||||||
|
}
|
||||||
|
@.previousUrl = @navUrls.resolve("project-userstories-detail", ctx)
|
||||||
|
|
||||||
|
if @.item.neighbors.next?.ref?
|
||||||
|
ctx = {
|
||||||
|
project: @.project.slug
|
||||||
|
ref: @.item.neighbors.next.ref
|
||||||
|
}
|
||||||
|
@.nextUrl = @navUrls.resolve("project-userstories-detail", ctx)
|
||||||
|
|
||||||
_checkPermissions: () ->
|
_checkPermissions: () ->
|
||||||
@.permissions = {
|
@.permissions = {
|
||||||
canEdit: _.includes(@.project.my_permissions, @.requiredPerm)
|
canEdit: _.includes(@.project.my_permissions, @.requiredPerm)
|
||||||
|
@ -42,7 +59,10 @@ class StoryHeaderController
|
||||||
if !value
|
if !value
|
||||||
@.editMode = false
|
@.editMode = false
|
||||||
|
|
||||||
onCancelEdition: (event) ->
|
onKeyDown: (event) ->
|
||||||
|
if event.which == 13
|
||||||
|
@.saveSubject()
|
||||||
|
|
||||||
if event.which == 27
|
if event.which == 27
|
||||||
@.item.subject = @.originalSubject
|
@.item.subject = @.originalSubject
|
||||||
@.editSubject(false)
|
@.editSubject(false)
|
||||||
|
@ -52,6 +72,7 @@ class StoryHeaderController
|
||||||
@.loadingSubject = false
|
@.loadingSubject = false
|
||||||
@rootScope.$broadcast("object:updated")
|
@rootScope.$broadcast("object:updated")
|
||||||
@confirm.notify('success')
|
@confirm.notify('success')
|
||||||
|
@.originalSubject = @.item.subject
|
||||||
|
|
||||||
onEditSubjectError = () =>
|
onEditSubjectError = () =>
|
||||||
@.loadingSubject = false
|
@.loadingSubject = false
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
maxlength="500"
|
maxlength="500"
|
||||||
autofocus
|
autofocus
|
||||||
required
|
required
|
||||||
ng-keydown="vm.onCancelEdition($event)"
|
ng-keydown="vm.onKeyDown($event)"
|
||||||
)
|
)
|
||||||
button.edit-title-button(
|
button.edit-title-button(
|
||||||
ng-click="vm.saveSubject()"
|
ng-click="vm.saveSubject()"
|
||||||
|
@ -63,14 +63,14 @@
|
||||||
|
|
||||||
.issue-nav
|
.issue-nav
|
||||||
a(
|
a(
|
||||||
ng-show="previousUrl"
|
ng-if="vm.previousUrl"
|
||||||
tg-bo-href="previousUrl"
|
ng-href="{{vm.previousUrl}}"
|
||||||
title="{{'US.PREVIOUS' | translate}}"
|
title="{{'US.PREVIOUS' | translate}}"
|
||||||
)
|
)
|
||||||
tg-svg(svg-icon="icon-arrow-left")
|
tg-svg(svg-icon="icon-arrow-left")
|
||||||
a(
|
a(
|
||||||
ng-show="nextUrl"
|
ng-if="vm.nextUrl"
|
||||||
tg-bo-href="nextUrl"
|
ng-href="{{vm.nextUrl}}"
|
||||||
title="{{'US.NEXT' | translate}}"
|
title="{{'US.NEXT' | translate}}"
|
||||||
)
|
)
|
||||||
tg-svg(svg-icon="icon-arrow-right")
|
tg-svg(svg-icon="icon-arrow-right")
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
background: $mass-white;
|
background: $mass-white;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
|
position: relative;
|
||||||
&:hover {
|
&:hover {
|
||||||
.detail-edit {
|
.detail-edit {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
@ -45,6 +46,7 @@
|
||||||
transition: all .2s linear;
|
transition: all .2s linear;
|
||||||
}
|
}
|
||||||
.detail-title-text {
|
.detail-title-text {
|
||||||
|
line-height: normal;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
.detail-number {
|
.detail-number {
|
||||||
|
|
Loading…
Reference in New Issue