summaryrefslogtreecommitdiff
path: root/src/application/templates/bootstrap-3/components/topic_log.twig
blob: 9614c4ebcdcb8d8e62fe8819238f0fbdd0033c18 (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
{%- set user = "" -%}
{%- if postAuthor is null -%}
    {%- set user = __("(deleted)")|e("html") -%}
{%- else -%}
    {%- set user =
        '<a href="?_action=viewuser&amp;user='
        ~ postAuthor.id|url_encode|e("html")
        ~ '">'
        ~ postAuthor.displayName|e("html")
        ~ '</a>'
    -%}
{%- endif -%}

<div class="media" id="post-{{ logMessage.id }}">
    <div class="media-left hidden-sm hidden-xs">
        {% if postAuthor %}
            {% if hideActions %}
                <img class="media-object" alt="{{ __("Profile picture") }}" src="?_action=profilepicture&amp;user={{ postAuthor.id|url_encode }}" width="64" height="64">
            {% else %}
                <a href="?_action=viewuser&amp;user={{ postAuthor.id|url_encode }}">
                    <img class="media-object" alt="{{ __("Profile picture") }}" src="?_action=profilepicture&amp;user={{ postAuthor.id|url_encode }}" width="64" height="64">
                </a>
            {% endif %}
        {% else %}
            <div class="media-object" style="width:64px;height:64px"></div>
        {% endif %}
    </div>
    <div class="media-body">
        {% if logMessage.type == constant("mystic\\forum\\orm\\TopicLogMessage::LOCKED") %}
            <div class="well icon-well text-info">
                <span class="fa fa-lock text-info" aria-hidden="true"></span>
                <em>{{ __("%user% locked this topic", {
                    "user": user,
                }) }}</em>
                <br>
                <small class="_time">{{ logMessage.postDate.format("c") }}</small>
            </div>
        {% elseif logMessage.type == constant("mystic\\forum\\orm\\TopicLogMessage::UNLOCKED") %}
            <div class="well icon-well text-success">
                <span class="fa fa-unlock text-success" aria-hidden="true"></span>
                <em>{{ __("%user% unlocked this topic", {
                    "user": user,
                }) }}</em>
                <br>
                <small class="_time">{{ logMessage.postDate.format("c") }}</small>
            </div>
        {% elseif logMessage.type == constant("mystic\\forum\\orm\\TopicLogMessage::TITLE_CHANGED") %}
            <div class="well icon-well text-info">
                <span class="fa fa-pencil text-info" aria-hidden="true"></span>
                <em>{{ __("%user% changed the title of this topic from %old_title% to %new_title%", {
                    "user": user,
                    "old_title": '<strong>' ~ logMessage.params.old_value|default(__("unknown"))|e("html") ~ '</strong>',
                    "new_title": '<strong>' ~ logMessage.params.new_value|default(__("unknown"))|e("html") ~ '</strong>',
                }) }}</em>
                <br>
                <small class="_time">{{ logMessage.postDate.format("c") }}</small>
            </div>
        {% else %}
            {{ __("unknown") }}
        {% endif %}
    </div>
</div>