PageRenderTime 19ms CodeModel.GetById 16ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/mod_comment/templates/admin_comments.tpl

http://github.com/zotonic/zotonic
Smarty Template | 66 lines | 61 code | 5 blank | 0 comment | 5 complexity | 8a13be7e9ee30ece5ad3e8588f10f369 MD5 | raw file
 1{% extends "admin_base.tpl" %}
 2
 3{% block title %}
 4{_ Recent Comments _}
 5{% endblock %}
 6
 7{% block content %}
 8<div class="admin-header">
 9    <h2>{_ Recent comments _}</h2>
10</div>
11
12<div class="well">
13    <a class="btn btn-default btn-sm" href="{% url admin_comments_settings %}">{_ Settings _}</a>
14</div>
15<div>
16    <table class="table table-striped do_adminLinkedTable">
17        <thead>
18            <tr>
19                <th width="15%">{_ Added on _}</th>
20                <th width="15%">{_ Page _}</th>
21                <th width="35%">{_ Message _}</th>
22                <th width="35%">{_ Name _} / {_ Email _}</th>
23            </tr>
24        </thead>
25
26        <tbody>
27            {% with m.search.paged[{recent_comments page=q.page}] as result %}
28            {% for comment in result %}
29            {% with comment.id as id %}
30            <tr id="{{ #comment.id }}" {% if not comment.is_visible %}class="unpublished" {% endif %} data-href="{{ m.rsc[comment.rsc_id].page_url }}#comment-{{ id }}">
31                <td>{{ comment.created|date:_"d M Y, H:i" }}</td>
32                <td>{{ m.rsc[comment.rsc_id].title|truncate:20 }}</td>
33                <td>{{ comment.message|striptags|truncate:40 }}</td>
34                <td title="{{ comment.email|escape }}">
35                    <div class="pull-right buttons">
36                        {% button class="btn btn-default btn-xs" text=_"view" action={redirect location=[m.rsc[comment.rsc_id].page_url,"#comment-",id|format_integer]|join } %}
37                        {% include "_admin_comments_toggledisplay.tpl" element=#comment.id %}
38                        {% button class="btn btn-default btn-xs"
39                           text=_"delete"
40                           action={confirm text=_"Are you sure you wish to delete that comment?"
41                           action={postback delegate="controller_admin_comments"
42                                            postback={comment_delete id=id on_success={slide_fade_out target=#comment.id}}}} %}
43                    </div>
44                    {% if comment.user_id %}
45                    {{ m.rsc[comment.user_id].title }} (#{{ comment.user_id }})
46                    {% else %}
47                    {{ comment.name|truncate:20 }} &ndash;
48                    {{ comment.email|truncate:20|escape }}
49                    {% endif %}
50                </td>
51            </tr>
52            {% endwith %}
53            {% empty %}
54            <tr>
55                <td colspan="4">
56                    {_ There are no comments. _}
57                </td>
58            </tr>
59            {% endfor %}
60        </tbody>
61    </table>
62    {% pager result=result dispatch="admin_comments" qargs %}
63    {% endwith %}
64
65</div>
66{% endblock %}