Merge pull request #666 from taigaio/issue-2731-using-utf8-chars-in-wiki-titles
Issue 2731: Using utf-8 chars in wiki titlesstable
commit
25f3f99d1b
|
@ -24,7 +24,6 @@ taiga = @.taiga
|
|||
mixOf = @.taiga.mixOf
|
||||
groupBy = @.taiga.groupBy
|
||||
bindOnce = @.taiga.bindOnce
|
||||
unslugify = @.taiga.unslugify
|
||||
debounce = @.taiga.debounce
|
||||
|
||||
module = angular.module("taigaWiki")
|
||||
|
@ -56,6 +55,7 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
@filter, @log, @appMetaService, @navUrls, @analytics, @translate) ->
|
||||
@scope.projectSlug = @params.pslug
|
||||
@scope.wikiSlug = @params.slug
|
||||
@scope.wikiTitle = @scope.wikiSlug
|
||||
@scope.sectionName = "Wiki"
|
||||
|
||||
promise = @.loadInitialData()
|
||||
|
@ -68,7 +68,7 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
|
||||
_setMeta: ->
|
||||
title = @translate.instant("WIKI.PAGE_TITLE", {
|
||||
wikiPageName: unslugify(@scope.wiki.slug)
|
||||
wikiPageName: @scope.wikiTitle
|
||||
projectName: @scope.project.name
|
||||
})
|
||||
description = @translate.instant("WIKI.PAGE_DESCRIPTION", {
|
||||
|
@ -112,6 +112,8 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
loadWikiLinks: ->
|
||||
return @rs.wiki.listLinks(@scope.projectId).then (wikiLinks) =>
|
||||
@scope.wikiLinks = wikiLinks
|
||||
selectedWikiLink = _.find(wikiLinks, {href: @scope.wikiSlug})
|
||||
@scope.wikiTitle = selectedWikiLink.title if selectedWikiLink?
|
||||
|
||||
loadInitialData: ->
|
||||
promise = @.loadProject()
|
||||
|
@ -122,7 +124,7 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
|
||||
delete: ->
|
||||
title = @translate.instant("WIKI.DELETE_LIGHTBOX_TITLE")
|
||||
message = unslugify(@scope.wiki.slug)
|
||||
message = @scope.wikiTitle
|
||||
|
||||
@confirm.askOnDelete(title, message).then (finish) =>
|
||||
onSuccess = =>
|
||||
|
|
|
@ -24,8 +24,6 @@ taiga = @.taiga
|
|||
mixOf = @.taiga.mixOf
|
||||
groupBy = @.taiga.groupBy
|
||||
bindOnce = @.taiga.bindOnce
|
||||
slugify = @.taiga.slugify
|
||||
unslugify = @.taiga.slugify
|
||||
|
||||
module = angular.module("taigaWiki")
|
||||
|
||||
|
@ -108,7 +106,7 @@ WikiNavDirective = ($tgrepo, $log, $location, $confirm, $navUrls, $analytics, $l
|
|||
.target($el.find(".new"))
|
||||
.start()
|
||||
|
||||
promise = $tgrepo.create("wiki-links", {project: $scope.projectId, title: newLink, href: slugify(newLink)})
|
||||
promise = $tgrepo.create("wiki-links", {project: $scope.projectId, title: newLink})
|
||||
promise.then ->
|
||||
$analytics.trackEvent("wikilink", "create", "create wiki link", 1)
|
||||
loadPromise = $ctrl.loadWikiLinks()
|
||||
|
|
|
@ -10,7 +10,7 @@ div.wrapper(ng-controller="WikiDetailController as ctrl",
|
|||
h1
|
||||
span(tg-bo-bind="project.name")
|
||||
span.green(translate="PROJECT.SECTION.WIKI")
|
||||
span.wiki-title(tg-bo-bind='wikiSlug|unslugify')
|
||||
span.wiki-title(ng-bind='wikiTitle')
|
||||
|
||||
div.summary.wiki-summary(tg-wiki-summary, ng-model="wiki", ng-if="wiki.id")
|
||||
section.wiki-content(tg-editable-wiki-content, ng-model="wiki")
|
||||
|
|
Loading…
Reference in New Issue