mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
OnTheFly: adding displayBadge option to replace button by badge
When using displayBadge=true, you need to pass buttonText=string with badge content. Limitation: onTheFly cannot use directly PersonRenderBox to display badge, because it don't have person object in props !
This commit is contained in:
@@ -7,16 +7,31 @@
|
||||
name: string 'person', 'thirdparty'
|
||||
id: integer
|
||||
}
|
||||
* action 'show', 'edit', 'create'
|
||||
* action string 'show', 'edit', 'create'
|
||||
* buttonText string
|
||||
* displayBadge boolean (default: false) replace button by badge, need to define buttonText for content
|
||||
|
||||
#}
|
||||
<div class="onthefly-container"
|
||||
<span class="onthefly-container"
|
||||
|
||||
data-target-name="{{ targetEntity.name|e('html_attr') }}"
|
||||
data-target-id="{{ targetEntity.id|e('html_attr') }}"
|
||||
data-action="{{ action|e('html_attr') }}"
|
||||
data-target-name="{{ targetEntity.name|e('html_attr') }}"
|
||||
data-target-id="{{ targetEntity.id|e('html_attr') }}"
|
||||
|
||||
></div>
|
||||
{% if action is defined %}
|
||||
data-action="{{ action|e('html_attr') }}"
|
||||
{% else %}
|
||||
data-action="show"
|
||||
{% endif %}
|
||||
|
||||
{% if buttonText is defined %}
|
||||
data-button-text="{{ buttonText|e('html_attr') }}"
|
||||
{% endif %}
|
||||
|
||||
{% if displayBadge is defined and displayBadge == 1 %}
|
||||
data-display-badge="true"
|
||||
{% endif %}
|
||||
|
||||
></span>
|
||||
|
||||
{{ encore_entry_script_tags('vue_onthefly') }}
|
||||
{{ encore_entry_link_tags('vue_onthefly') }}
|
||||
|
Reference in New Issue
Block a user