0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00

Add rich text for step descriptions

Dieser Commit ist enthalten in:
Angus McLeod 2017-11-02 10:22:13 +08:00
Ursprung df65c92665
Commit d14db3678a
4 geänderte Dateien mit 32 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -34,12 +34,12 @@
</div> </div>
</div> </div>
<div class="setting"> <div class="setting full">
<div class="setting-label"> <div class="setting-label">
<h3>{{i18n 'admin.wizard.step.description'}}</h3> <h3>{{i18n 'admin.wizard.step.description'}}</h3>
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{textarea name="description" value=step.description placeholder=(i18n "admin.wizard.custom_text_placeholder")}} {{d-editor value=step.description placeholder="admin.wizard.custom_text_placeholder"}}
</div> </div>
</div> </div>

Datei anzeigen

@ -47,6 +47,12 @@
.wizard-column .wizard-field .input-area { .wizard-column .wizard-field .input-area {
margin: 0.5em 0; margin: 0.5em 0;
} }
img.emoji {
width: 20px;
height: 20px;
vertical-align: middle;
}
} }
.step-message { .step-message {

Datei anzeigen

@ -60,10 +60,28 @@
margin-top: 5px; margin-top: 5px;
display: block; display: block;
} }
.d-editor {
width: 100%;
.d-editor-input {
height: 100px;
}
button {
margin: 0;
}
}
} }
&.full { &.full {
width: 100%; width: 100%;
.setting-value {
width: initial;
overflow: hidden;
float: none;
}
} }
label { label {

Datei anzeigen

@ -75,6 +75,12 @@ class CustomWizard::AdminController < ::ApplicationController
return render json: { error: error } if error return render json: { error: error } if error
## end of error checks
wizard['steps'].each do |s|
s['description'] = PrettyText.cook(s['description']) if s['description']
end
existing = PluginStore.get('custom_wizard', wizard['id']) || {} existing = PluginStore.get('custom_wizard', wizard['id']) || {}
new_time = existing['after_time_scheduled'] ? new_time = existing['after_time_scheduled'] ?
after_time_scheduled != Time.parse(existing['after_time_scheduled']).utc : after_time_scheduled != Time.parse(existing['after_time_scheduled']).utc :