Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-26 02:50:28 +01:00
Cook step titles
Dieser Commit ist enthalten in:
Ursprung
620f30368e
Commit
92fb880502
3 geänderte Dateien mit 7 neuen und 3 gelöschten Zeilen
|
@ -71,6 +71,10 @@ export default {
|
||||||
return index === 0 && !required;
|
return index === 0 && !required;
|
||||||
}.property('step.index', 'wizard.required'),
|
}.property('step.index', 'wizard.required'),
|
||||||
|
|
||||||
|
cookedTitle: function() {
|
||||||
|
return cook(this.get('step.title'));
|
||||||
|
}.property('step.title'),
|
||||||
|
|
||||||
cookedDescription: function() {
|
cookedDescription: function() {
|
||||||
return cook(this.get('step.description'));
|
return cook(this.get('step.description'));
|
||||||
}.property('step.description'),
|
}.property('step.description'),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div class='wizard-step-contents'>
|
<div class='wizard-step-contents'>
|
||||||
{{#if step.title}}
|
{{#if step.title}}
|
||||||
<h1 class='wizard-step-title'>{{step.title}}</h1>
|
<h1 class='wizard-step-title'>{{cookedTitle}}</h1>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if step.description}}
|
{{#if step.description}}
|
||||||
|
|
|
@ -127,8 +127,8 @@ end
|
||||||
|
|
||||||
::WizardStepSerializer.class_eval do
|
::WizardStepSerializer.class_eval do
|
||||||
def title
|
def title
|
||||||
return object.title if object.title
|
return PrettyText.cook(object.title) if object.title
|
||||||
I18n.t("#{object.key || i18n_key}.title", default: '')
|
PrettyText.cook(I18n.t("#{object.key || i18n_key}.title", default: ''))
|
||||||
end
|
end
|
||||||
|
|
||||||
def description
|
def description
|
||||||
|
|
Laden …
In neuem Issue referenzieren