[Backport] Issue 2731: Using utf-8 chars in wiki titles

stable
Alejandro Alonso 2015-10-15 07:47:22 +02:00 committed by David Barragán Merino
parent 1d0b471ec6
commit 657a63f746
3 changed files with 7 additions and 7 deletions

View File

@ -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", {
@ -113,6 +113,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()
@ -123,7 +125,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 = =>

View File

@ -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()

View File

@ -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")