Improve Embeddable Comment Render

* render embeddable comment into twig template;
* add some style
This commit is contained in:
2021-03-25 21:57:48 +01:00
parent 3ca5018e45
commit 66e590972a
7 changed files with 81 additions and 28 deletions

View File

@@ -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

View File

@@ -0,0 +1,6 @@
.chill-entity__comment-embeddable {
.chill-entity__comment-embeddable__metadata {
font-size: smaller;
color: var(--chill-light-gray);
}
}

View File

@@ -0,0 +1,2 @@
// css classes to render entities
require('./comment_embeddable.scss');

View File

@@ -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 }}