Files
2017-12-21 11:42:41 +01:00

25 lines
679 B
CoffeeScript

import Ember from 'ember'
Component = Ember.Component.extend
tagName: 'h2'
classNames: ['page-title', 'ui', 'header']
back: null
title: Ember.computed 'titleSpec', ->
title = "#{@get('titleSpec')}"
options = {}
# allow modelPath as argument, useful for page-title 'action.new_model' modelPath='models.projects.site' etc
if modelPath = @get('modelPath')
options.model = t(modelPath)
# interpret the given argument as a translation string if it matches the characteristics
title = tspan(title, options) if is_translation_path(title)
title.htmlSafe()
Component.reopenClass
positionalParams: ['titleSpec']
export default Component