mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Improve Embeddable Comment Render
* render embeddable comment into twig template; * add some style
This commit is contained in:
@@ -36,6 +36,7 @@ require('./modules/breadcrumb/index.js');
|
||||
require('./modules/download-report/index.js');
|
||||
require('./modules/select_interactive_loading/index.js');
|
||||
require('./modules/export-list/export-list.scss');
|
||||
require('./modules/entity/index.js');
|
||||
|
||||
/*
|
||||
* load img
|
||||
|
@@ -0,0 +1,6 @@
|
||||
.chill-entity__comment-embeddable {
|
||||
.chill-entity__comment-embeddable__metadata {
|
||||
font-size: smaller;
|
||||
color: var(--chill-light-gray);
|
||||
}
|
||||
}
|
@@ -0,0 +1,2 @@
|
||||
// css classes to render entities
|
||||
require('./comment_embeddable.scss');
|
@@ -0,0 +1,36 @@
|
||||
{{ opening_box|raw }}
|
||||
<div class="">
|
||||
<div class="comment-embeddable_comment">
|
||||
|
||||
{%- if options['limit_lines'] is not null -%}
|
||||
{% set content = comment.comment|split('\n')|slice(0, options['limit_lines'])|join('\n') %}
|
||||
{%- else -%}
|
||||
{% set content = comment.comment %}
|
||||
{%- endif -%}
|
||||
|
||||
<blockquote class="chill-user-quote">
|
||||
{% if options['disable_markdown'] %}
|
||||
{{ content|nl2br }}
|
||||
{% else %}
|
||||
{{ content|chill_markdown_to_html }}
|
||||
{% endif %}
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
{% if options['metadata'] %}
|
||||
<div class="chill-entity__comment-embeddable__metadata">
|
||||
{% if user is not empty %}
|
||||
<span class="chill-entity__comment-embeddable__user">
|
||||
{{ 'Last updated by'| trans }} {{ user|chill_entity_render_box(options['user']) }}
|
||||
</span>';
|
||||
{% endif %}
|
||||
|
||||
{% if comment.date is not empty %}
|
||||
<span class="chill-entity__comment-embeddable__date">
|
||||
{% if user is empty %}{{ 'Last updated on'|trans ~ ' ' }}{% else %}{{ 'on'|trans ~ ' ' }}{% endif %}
|
||||
{{ comment.date|format_datetime("medium", "short") }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{{ closing_box|raw }}
|
Reference in New Issue
Block a user