forked from sonata-project/SonataTimelineBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimeline.html.twig
49 lines (38 loc) · 1.68 KB
/
timeline.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{#
This file is part of the Sonata package.
(c) Thomas Rabaix <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% extends sonata_block.templates.block_base %}
{% block block %}
{% if settings.title %}
<h3>{{ settings.title }}</h3>
{% endif %}
{% sonata_template_box 'This is the timeline block.' %}
<ul>
{% for entry in entries %}
{% set subject = entry.getComponent('subject') %}
{% set target = entry.getComponent('target') %}
{% set target_text_component = entry.getComponent('target_text') %}
{% if subject.data %}
{% set subject_text = sonata_timeline_generate_link(subject) %}
{% else %}
{% set subject_text = '<abbr title="reference: ' ~ subject.hash ~ '">element deleted</abbr>' %}
{% endif %}
{% if target.data is defined and target.data is not empty %}
{% set target_text = sonata_timeline_generate_link(target) %}
{% elseif target_text_component %}
{% set target_text = '<abbr title="Element Deleted">'~target_text_component~'</abbr>' %}
{% else %}
{% set target_text = '<abbr title="reference: ' ~ target.hash ~ '">element deleted</abbr>' %}
{% endif %}
{% set verb = "actions."~entry.verb %}
<li>
{{ verb|trans({'%subject%': subject_text, '%target%': target_text}, "SonataTimelineBundle")|raw }}
</li>
{% else %}
No action for now ...
{% endfor %}
</ul>
{% endblock %}