Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-09 20:02:54 +01:00
Cook field labels
Dieser Commit ist enthalten in:
Ursprung
5e936036e6
Commit
b73b39370f
3 geänderte Dateien mit 12 neuen und 6 gelöschten Zeilen
|
@ -1,6 +1,6 @@
|
|||
<label for={{field.id}}>
|
||||
{{#if field.label}}
|
||||
<span class='label-value'>{{field.label}}</span>
|
||||
<span class='label-value'>{{{field.label}}}</span>
|
||||
{{/if}}
|
||||
</label>
|
||||
|
||||
|
|
|
@ -125,8 +125,12 @@
|
|||
flex-flow: wrap;
|
||||
align-items: center;
|
||||
|
||||
.field-label {
|
||||
.label-value {
|
||||
width: 100%;
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.field-image {
|
||||
|
|
|
@ -28,12 +28,10 @@ end
|
|||
attr_accessor :dropdown_none
|
||||
|
||||
def initialize(attrs)
|
||||
attrs = attrs || {}
|
||||
|
||||
@attrs = attrs || {}
|
||||
@id = attrs[:id]
|
||||
@type = attrs[:type]
|
||||
@required = !!attrs[:required]
|
||||
@label = attrs[:label]
|
||||
@description = attrs[:description]
|
||||
@image = attrs[:image]
|
||||
@key = attrs[:key]
|
||||
|
@ -42,6 +40,10 @@ end
|
|||
@choices = []
|
||||
@dropdown_none = attrs[:dropdown_none]
|
||||
end
|
||||
|
||||
def label
|
||||
@label ||= PrettyText.cook(@attrs[:label], keep_emoji_images: true)
|
||||
end
|
||||
end
|
||||
|
||||
::Wizard::Choice.class_eval do
|
||||
|
@ -54,7 +56,7 @@ end
|
|||
end
|
||||
|
||||
def label
|
||||
@label ||= PrettyText.cook(@opts[:label], keep_emoji_images: true, postProcessTag: '<div>')
|
||||
@label ||= PrettyText.cook(@opts[:label], keep_emoji_images: true)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Laden …
In neuem Issue referenzieren