From b194b8edc3c481358a6ac8ae990624daa5a7526c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Tue, 29 Jul 2014 00:22:33 +0200 Subject: [PATCH] Show active attachments of wiki pages --- app/coffee/modules/wiki/main.coffee | 8 ++++++-- app/partials/wiki-edit.jade | 2 +- app/partials/wiki.jade | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/coffee/modules/wiki/main.coffee b/app/coffee/modules/wiki/main.coffee index a2606567..2e31bd9c 100644 --- a/app/coffee/modules/wiki/main.coffee +++ b/app/coffee/modules/wiki/main.coffee @@ -31,7 +31,7 @@ module = angular.module("taigaWiki") ## Wiki Detail Controller ############################################################################# -class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin) +class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.AttachmentsMixin) @.$inject = [ "$scope", "$rootScope", @@ -42,9 +42,12 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin) "$q", "$location", "$filter", + "$log" ] - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @filter) -> + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location, @filter, @log) -> + @.attachmentsUrlName = "wiki/attachments" + @scope.projectSlug = @params.pslug @scope.wikiSlug = @params.slug @scope.sectionName = "Wiki" @@ -85,6 +88,7 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin) .then(=> @.loadUsersAndRoles()) .then(=> @.loadWikiLinks()) .then(=> @.loadWiki()) + .then(=> @.loadAttachments(@scope.wikiId)) edit: -> @location.path("/project/#{@scope.projectSlug}/wiki/#{@scope.wikiSlug}/edit") diff --git a/app/partials/wiki-edit.jade b/app/partials/wiki-edit.jade index 8c8254b7..3fb5381f 100644 --- a/app/partials/wiki-edit.jade +++ b/app/partials/wiki-edit.jade @@ -21,4 +21,4 @@ block content section.wysiwyg textarea(placeholder="Write a your wiki page", ng-model="wiki.content", tg-markitup) - //include views/modules/attachments + include views/modules/attachments diff --git a/app/partials/wiki.jade b/app/partials/wiki.jade index 6dfd8316..ab68e5a8 100644 --- a/app/partials/wiki.jade +++ b/app/partials/wiki.jade @@ -23,4 +23,4 @@ block content section.wiki-content.wysiwyg(tg-bind-html="wiki.html") - //include views/modules/attachments + include views/modules/attachments