Some wiki fixes

stable
Jesús Espino 2014-07-28 13:10:08 +02:00
parent 8babff7cec
commit c29296bf83
5 changed files with 29 additions and 12 deletions

View File

@ -19,6 +19,8 @@
# File: modules/common/filters.coffee # File: modules/common/filters.coffee
### ###
taiga = @.taiga
module = angular.module("taigaCommon") module = angular.module("taigaCommon")
defaultFilter = -> defaultFilter = ->
@ -38,3 +40,8 @@ yesNoFilter = ->
return "No" return "No"
module.filter("yesNo", yesNoFilter) module.filter("yesNo", yesNoFilter)
unslugify = ->
return taiga.unslugify
module.filter("unslugify", unslugify)

View File

@ -48,6 +48,10 @@ slugify = (data) ->
return _.str.slugify(data) return _.str.slugify(data)
unslugify = (data) ->
return _.str.capitalize(data.replace(/-/g, ' '))
toggleText = (element, texts) -> toggleText = (element, texts) ->
nextTextPosition = element.data('nextTextPosition') nextTextPosition = element.data('nextTextPosition')
nextTextPosition = 0 if not nextTextPosition? or nextTextPosition >= texts.length nextTextPosition = 0 if not nextTextPosition? or nextTextPosition >= texts.length
@ -104,6 +108,7 @@ taiga.bindOnce = bindOnce
taiga.mixOf = mixOf taiga.mixOf = mixOf
taiga.trim = trim taiga.trim = trim
taiga.slugify = slugify taiga.slugify = slugify
taiga.unslugify = unslugify
taiga.toggleText = toggleText taiga.toggleText = toggleText
taiga.groupBy = groupBy taiga.groupBy = groupBy
taiga.timeout = timeout taiga.timeout = timeout

View File

@ -8,14 +8,15 @@ block content
ng-init="section='wiki'") ng-init="section='wiki'")
sidebar.menu-secondary.extrabar sidebar.menu-secondary.extrabar
section.wiki-nav(tg-wiki-nav, ng-model="wikiLinks") section.wiki-nav(tg-wiki-nav, ng-model="wikiLinks")
section.main.backlog section.main.wiki
//Include views/components/mainTitle //Include views/components/mainTitle
header header
h1 h1
span(tg-bo-html="project.name") span(tg-bo-html="project.name")
span.green Wiki span.green Wiki
span.green(tg-bo-html='wikiSlug') span.wiki-title(tg-bo-html='wikiSlug|unslugify')
a.button.button-green.save-wiki(href="", title="Save", ng-click="ctrl.save()") Save .action-buttons
a.button.button-green.save-wiki(href="", title="Save", ng-click="ctrl.save()") Save
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)

View File

@ -8,15 +8,16 @@ block content
ng-init="section='wiki'") ng-init="section='wiki'")
sidebar.menu-secondary.extrabar sidebar.menu-secondary.extrabar
section.wiki-nav(tg-wiki-nav, ng-model="wikiLinks") section.wiki-nav(tg-wiki-nav, ng-model="wikiLinks")
section.main.backlog section.main.wiki
//Include views/components/mainTitle //Include views/components/mainTitle
header header
h1 h1
span(tg-bo-html="project.name") span(tg-bo-html="project.name")
span.green Wiki span.green Wiki
span.wiki-title(tg-bo-html='wiki.slug') span.wiki-title(tg-bo-html='wiki.slug|unslugify')
a.button.button-red.edit-wiki(href="", title="Delete", ng-click="ctrl.delete()") Delete .action-buttons
a.button.button-green.edit-wiki(href="", title="Edit", ng-click="ctrl.edit()") Edit a.button.button-red.delete-wiki(href="", title="Delete", ng-click="ctrl.delete()") Delete
a.button.button-green.edit-wiki(href="", title="Edit", ng-click="ctrl.edit()") Edit
include views/modules/wiki-summary include views/modules/wiki-summary

View File

@ -1,9 +1,12 @@
.wiki-content { .wiki-content {
margin-bottom: 2rem; margin-bottom: 2rem;
} }
.edit-wiki { .action-buttons {
float: right; position: absolute;
} top: 2rem;
.delete-wiki { right: 2rem;
float: right; .delete-wiki, .edit-wiki, .save-wiki {
float:right;
margin-left: 10px;
}
} }