Adding delete confirmation on wiki and wiki links
parent
2f3278652b
commit
0369a35228
|
@ -24,6 +24,7 @@ taiga = @.taiga
|
||||||
mixOf = @.taiga.mixOf
|
mixOf = @.taiga.mixOf
|
||||||
groupBy = @.taiga.groupBy
|
groupBy = @.taiga.groupBy
|
||||||
bindOnce = @.taiga.bindOnce
|
bindOnce = @.taiga.bindOnce
|
||||||
|
unslugify = @.taiga.unslugify
|
||||||
|
|
||||||
module = angular.module("taigaWiki")
|
module = angular.module("taigaWiki")
|
||||||
|
|
||||||
|
@ -99,6 +100,13 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig
|
||||||
@location.path("/project/#{@scope.projectSlug}/wiki")
|
@location.path("/project/#{@scope.projectSlug}/wiki")
|
||||||
onError = =>
|
onError = =>
|
||||||
@confirm.notify("error")
|
@confirm.notify("error")
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: i18n
|
||||||
|
title = "Delete Wiki Page"
|
||||||
|
subtitle = unslugify(@scope.wiki.slug)
|
||||||
|
|
||||||
|
@confirm.ask(title, subtitle).then =>
|
||||||
@repo.remove(@scope.wiki).then onSuccess, onError
|
@repo.remove(@scope.wiki).then onSuccess, onError
|
||||||
|
|
||||||
module.controller("WikiDetailController", WikiDetailController)
|
module.controller("WikiDetailController", WikiDetailController)
|
||||||
|
|
|
@ -25,6 +25,7 @@ mixOf = @.taiga.mixOf
|
||||||
groupBy = @.taiga.groupBy
|
groupBy = @.taiga.groupBy
|
||||||
bindOnce = @.taiga.bindOnce
|
bindOnce = @.taiga.bindOnce
|
||||||
slugify = @.taiga.slugify
|
slugify = @.taiga.slugify
|
||||||
|
unslugify = @.taiga.slugify
|
||||||
|
|
||||||
module = angular.module("taigaWiki")
|
module = angular.module("taigaWiki")
|
||||||
|
|
||||||
|
@ -86,6 +87,12 @@ WikiNavDirective = ($tgrepo, $log, $location, $confirm) ->
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
target = angular.element(event.currentTarget)
|
target = angular.element(event.currentTarget)
|
||||||
linkId = target.parents('.wiki-link').data('id')
|
linkId = target.parents('.wiki-link').data('id')
|
||||||
|
|
||||||
|
# TODO: i18n
|
||||||
|
title = "Delete Wiki Link"
|
||||||
|
subtitle = $scope.wikiLinks[linkId].title
|
||||||
|
|
||||||
|
$confirm.ask(title, subtitle).then =>
|
||||||
$tgrepo.remove($scope.wikiLinks[linkId]).then ->
|
$tgrepo.remove($scope.wikiLinks[linkId]).then ->
|
||||||
$ctrl.loadWikiLinks().then ->
|
$ctrl.loadWikiLinks().then ->
|
||||||
render($scope.wikiLinks)
|
render($scope.wikiLinks)
|
||||||
|
|
Loading…
Reference in New Issue