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