polls.tpl 7.29 KB
Newer Older
1
2
{extends 'admin/admin_page.tpl'}

3
4
5
6
{block name="header"}
    <script src="{"js/app/admin/polls.js"|resource}" type="text/javascript"></script>
{/block}

7
{block 'admin_main'}
8
    <div class="panel panel-default" id="poll_search">
9
        <div class="panel-heading">{t('Generic', 'Search')}</div>
10
11
12
13
14
        <div class="panel-body" style="display: none;">
            <form action="" method="GET">
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
15
                            <label for="poll" class="control-label">{t('Admin', 'Poll ID')}</label>
16
17
18
                            <input type="text" name="poll" id="poll" class="form-control"
                                   value="{$search['poll']|html}"/>
                        </div>
19
20
21
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
22
                            <label for="title" class="control-label">{t('Admin', 'Title')}</label>
23
24
25
26
27
                            <input type="text" name="title" id="title" class="form-control"
                                   value="{$search['title']|html}"/>
                        </div>
                    </div>
                    <div class="col-md-6">
28
                        <div class="form-group">
29
                            <label for="name" class="control-label">{t('Admin', 'Author')}</label>
30
31
32
33
34
35
                            <input type="text" name="name" id="name" class="form-control"
                                   value="{$search['name']|html}"/>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
36
                            <label for="mail" class="control-label">{t('Admin', 'Email')}</label>
37
38
                            <input type="text" name="mail" id="mail" class="form-control"
                                   value="{$search['mail']|html}"/>
39
40
41
                        </div>
                    </div>
                </div>
42
                <input type="submit" value="{t('Generic', 'Search')}" class="btn btn-default"/>
43
44
45
46
            </form>
        </div>
    </div>

47
    <form action="" method="POST">
48
        <input type="hidden" name="csrf" value="{$crsf}"/>
49
50
        {if $poll_to_delete}
            <div class="alert alert-warning text-center">
51
                <h3>{t('adminstuds', 'Confirm removal of your poll')} "{$poll_to_delete->id|html}"</h3>
52
53
54

                <p>
                    <button class="btn btn-default" type="submit" value="1"
55
                            name="annullesuppression">{t('adminstuds', 'Keep the poll')}</button>
56
                    <button type="submit" name="delete_confirm" value="{$poll_to_delete->id|html}"
57
                            class="btn btn-danger">{t('adminstuds', 'Delete poll')}</button>
58
59
60
                </p>
            </div>
        {/if}
61
        <input type="hidden" name="csrf" value="{$crsf}"/>
62

Olivier Perez's avatar
Olivier Perez committed
63
64
        <div class="panel panel-default">
            <div class="panel-heading">
65
                {if $count == $total}{$count}{else}{$count} / {$total}{/if} {t('Admin', 'polls in the database at this time')}
Olivier Perez's avatar
Olivier Perez committed
66
            </div>
67
68
            <div class="table-of-polls panel">
                <table class="table table-bordered table-polls">
Olivier Perez's avatar
Olivier Perez committed
69
                    <tr align="center">
70
                        <th scope="col"></th>
71
72
73
74
75
76
77
                        <th scope="col">{t('Admin', 'Title')}</th>
                        <th scope="col">{t('Admin', 'Author')}</th>
                        <th scope="col">{t('Admin', 'Email')}</th>
                        <th scope="col">{t('Admin', 'Expiry date')}</th>
                        <th scope="col">{t('Admin', 'Votes')}</th>
                        <th scope="col">{t('Admin', 'Poll ID')}</th>
                        <th scope="col" colspan="3">{t('Admin', 'Actions')}</th>
78
79
80
81
82
                    </tr>
                    {foreach $polls as $poll}
                        <tr align="center">
                            <td class="cell-format">
                                {if $poll->format === 'D'}
JosephK's avatar
JosephK committed
83
                                    <i class="fa fa-calendar" aria-hidden="true"
84
85
                                       title="{t('Generic', 'Date')}"></i>
                                    <span class="sr-only">{t('Generic', 'Date')}</span>
86
                                {else}
JosephK's avatar
JosephK committed
87
                                    <i class="fa fa-th-list" aria-hidden="true"
88
89
                                       title="{t('Generic', 'Classic')}"></i>
                                    <span class="sr-only">{t('Generic', 'Classic')}</span>
90
91
92
93
94
95
                                {/if}
                            </td>
                            <td>{$poll->title|html}</td>
                            <td>{$poll->admin_name|html}</td>
                            <td>{$poll->admin_mail|html}</td>

96
97
                            {if $poll->end_date > date_create()}
                                <td>{$poll->end_date|date_format_intl:'d/m/Y'}</td>
Olivier Perez's avatar
Olivier Perez committed
98
                            {else}
99
                                <td><span class="text-danger">{$poll->end_date|date_format_intl:'d/m/Y'}</span></td>
Olivier Perez's avatar
Olivier Perez committed
100
                            {/if}
101
102
                            <td>{$poll->votes|html}</td>
                            <td>{$poll->id|html}</td>
JosephK's avatar
JosephK committed
103
104
                            <td>
                                <a href="{poll_url id=$poll->id}" class="btn btn-link"
105
                                   title="{t('Admin', 'See the poll')}">
JosephK's avatar
JosephK committed
106
                                    <i class="fa fa-eye" aria-hidden="true"></i>
107
                                    <span class="sr-only">{t('Admin', 'See the poll')}</span>
JosephK's avatar
JosephK committed
108
109
110
111
                                </a>
                            </td>
                            <td>
                                <a href="{poll_url id=$poll->admin_id admin=true}" class="btn btn-link"
112
                                   title="{t('Admin', 'Change the poll')}">
JosephK's avatar
JosephK committed
113
                                   <i class="fa fa-pencil" aria-hidden="true"></i>
114
                                   <span class="sr-only">{t('Admin', 'Change the poll')}</span>
JosephK's avatar
JosephK committed
115
116
                                </a>
                            </td>
117
118
                            <td>
                                <button type="submit" name="delete_poll" value="{$poll->id|html}" class="btn btn-link"
119
                                        title="{t('Admin', 'Poll deleted')}">
JosephK's avatar
JosephK committed
120
                                    <i class="fa fa-trash text-danger" aria-hidden="true"></i>
121
                                    <span class="sr-only">{t('Admin', 'Poll deleted')}</span>
JosephK's avatar
JosephK committed
122
                                </button>
123
124
125
126
127
                            </td>
                        </tr>
                    {/foreach}
                </table>
            </div>
128

Olivier Perez's avatar
Olivier Perez committed
129
            <div class="panel-heading">
130
                {t('Admin', 'Pages:')}
Olivier Perez's avatar
Olivier Perez committed
131
132
                {for $p=1 to $pages}
                    {if $p===$page}
133
134
                        <a href="{$SERVER_URL}admin/polls.php?page={$p}&{$search_query}" class="btn btn-danger"
                           disabled="disabled">{$p}</a>
135
                    {else}
136
                        <a href="{$SERVER_URL}admin/polls.php?page={$p}&{$search_query}" class="btn btn-info">{$p}</a>
137
                    {/if}
Olivier Perez's avatar
Olivier Perez committed
138
139
                {/for}
            </div>
140
        </div>
141
    </form>
142
{/block}