diff --git a/app/coffee/modules/wiki/main.coffee b/app/coffee/modules/wiki/main.coffee index 2e31bd9c..e078bde7 100644 --- a/app/coffee/modules/wiki/main.coffee +++ b/app/coffee/modules/wiki/main.coffee @@ -24,6 +24,7 @@ taiga = @.taiga mixOf = @.taiga.mixOf groupBy = @.taiga.groupBy bindOnce = @.taiga.bindOnce +unslugify = @.taiga.unslugify module = angular.module("taigaWiki") @@ -99,7 +100,14 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig @location.path("/project/#{@scope.projectSlug}/wiki") onError = => @confirm.notify("error") - @repo.remove(@scope.wiki).then onSuccess, onError + + + # TODO: i18n + title = "Delete Wiki Page" + subtitle = unslugify(@scope.wiki.slug) + + @confirm.ask(title, subtitle).then => + @repo.remove(@scope.wiki).then onSuccess, onError module.controller("WikiDetailController", WikiDetailController) diff --git a/app/coffee/modules/wiki/nav.coffee b/app/coffee/modules/wiki/nav.coffee index 464048cc..208a59e0 100644 --- a/app/coffee/modules/wiki/nav.coffee +++ b/app/coffee/modules/wiki/nav.coffee @@ -25,6 +25,7 @@ mixOf = @.taiga.mixOf groupBy = @.taiga.groupBy bindOnce = @.taiga.bindOnce slugify = @.taiga.slugify +unslugify = @.taiga.slugify module = angular.module("taigaWiki") @@ -86,9 +87,15 @@ WikiNavDirective = ($tgrepo, $log, $location, $confirm) -> event.stopPropagation() target = angular.element(event.currentTarget) linkId = target.parents('.wiki-link').data('id') - $tgrepo.remove($scope.wikiLinks[linkId]).then -> - $ctrl.loadWikiLinks().then -> - render($scope.wikiLinks) + + # TODO: i18n + title = "Delete Wiki Link" + subtitle = $scope.wikiLinks[linkId].title + + $confirm.ask(title, subtitle).then => + $tgrepo.remove($scope.wikiLinks[linkId]).then -> + $ctrl.loadWikiLinks().then -> + render($scope.wikiLinks) $el.on "keyup", ".new input", (event) -> event.preventDefault()