Show active attachments of wiki pages

stable
David Barragán Merino 2014-07-29 00:22:33 +02:00
parent d00ea43289
commit b194b8edc3
3 changed files with 8 additions and 4 deletions

View File

@ -31,7 +31,7 @@ module = angular.module("taigaWiki")
## Wiki Detail Controller ## Wiki Detail Controller
############################################################################# #############################################################################
class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin) class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.AttachmentsMixin)
@.$inject = [ @.$inject = [
"$scope", "$scope",
"$rootScope", "$rootScope",
@ -42,9 +42,12 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
"$q", "$q",
"$location", "$location",
"$filter", "$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.projectSlug = @params.pslug
@scope.wikiSlug = @params.slug @scope.wikiSlug = @params.slug
@scope.sectionName = "Wiki" @scope.sectionName = "Wiki"
@ -85,6 +88,7 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
.then(=> @.loadUsersAndRoles()) .then(=> @.loadUsersAndRoles())
.then(=> @.loadWikiLinks()) .then(=> @.loadWikiLinks())
.then(=> @.loadWiki()) .then(=> @.loadWiki())
.then(=> @.loadAttachments(@scope.wikiId))
edit: -> edit: ->
@location.path("/project/#{@scope.projectSlug}/wiki/#{@scope.wikiSlug}/edit") @location.path("/project/#{@scope.projectSlug}/wiki/#{@scope.wikiSlug}/edit")

View File

@ -21,4 +21,4 @@ block content
section.wysiwyg section.wysiwyg
textarea(placeholder="Write a your wiki page", ng-model="wiki.content", tg-markitup) textarea(placeholder="Write a your wiki page", ng-model="wiki.content", tg-markitup)
//include views/modules/attachments include views/modules/attachments

View File

@ -23,4 +23,4 @@ block content
section.wiki-content.wysiwyg(tg-bind-html="wiki.html") section.wiki-content.wysiwyg(tg-bind-html="wiki.html")
//include views/modules/attachments include views/modules/attachments