KevaChat is distributed chat platform for open, uncensored and privacy respectable communication with permanent data storage in blockchain.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
3.7 KiB

{% macro recursive_post_tree(namespace, writable, tree) %}
{% import _self as self %}
{% if tree | length %}
<ul>
{% for post in tree %}
<li>
<div>
<a name="{{ post.txid }}"></a>
<strong>
9 months ago
{{ post.user }}
</strong>
&bull;
{% if post.pending %}
{{ post.time | format_ago }}
{% if post.pool %}
&bull;
{{ 'pending %s KVA to %s (%s)' | trans | format(post.pool.cost, post.pool.address, post.pool.expires | format_expire ) }}
{% endif %}
<span title="{{ 'pending in pool' | trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71z"/>
</svg>
</span>
{% else %}
<a rel="nofollow" href="{{ path('room_namespace', { namespace : namespace, _fragment : post.txid }) }}" title="{{ post.time | date('c') }}">{{ post.time | format_ago }}</a>
{% if writable %}
&bull;
<a rel="nofollow" href="{{ path('room_namespace', { namespace : namespace, txid : post.txid, _fragment : post.txid }) }}">{{ 'reply' | trans }}</a>
{% endif %}
{% endif %}
<small>
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" viewBox="0 0 16 16">
<path d="M3.5 11.5a3.5 3.5 0 1 1 3.163-5H14L15.5 8 14 9.5l-1-1-1 1-1-1-1 1-1-1-1 1H6.663a3.5 3.5 0 0 1-3.163 2M2.5 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/>
</svg>
{{ post.key }}
</small>
{# apply markdown whitelist filters only to prevent ping from remote includes #}
{{
post.message | message_to_markdown
| trim
| nl2br
| markdown_to_html
}}
</div>
{% if post.tree is defined and post.tree | length %}
{{ self.recursive_post_tree(namespace, writable, post.tree) }}
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
{% from _self import recursive_post_tree %}
{% extends 'default/layout.html.twig' %}
{% block head_title_content %}{{ request.get('namespace') | keva_namespace_value }} - {{ app.name }}{% endblock %}
{% block main_content %}
{% if tree %}
{{ recursive_post_tree(request.get('namespace'), writable, tree) }}
<a name="latest"></a>
{% else %}
<ul>
<li>
<div>
{{ 'room does not contain kevachat messages' | trans }}
</div>
</li>
</ul>
{% endif %}
{% endblock %}
{% block footer_content %}
{% if writable %}
{{
render(
controller(
'App\\Controller\\ModuleController::post',
{
request: request
}
)
)
}}
{% endif %}
{% endblock %}