]> git.agnieray.net Git - galette.git/blob - galette/templates/default/history.tpl
Add CSRF Middleware
[galette.git] / galette / templates / default / history.tpl
1 {extends file="page.tpl"}
2
3 {block name="content"}
4 <form action="{path_for name="history_filter"}" method="post" id="filtre">
5 <div id="listfilter">
6 <label for="start_date_filter">{_T string="since"}</label>&nbsp;
7 <input type="text" name="start_date_filter" id="start_date_filter" maxlength="10" size="10" value="{$history->filters->start_date_filter}"/>
8 <label for="end_date_filter">{_T string="until"}</label>&nbsp;
9 <input type="text" name="end_date_filter" id="end_date_filter" maxlength="10" size="10" value="{$history->filters->end_date_filter}"/>
10
11
12 {assign var="users" value=$history->getUsersList()}
13 {if $users|@count gt 0}
14 <label for="user_filter">{_T string="Member"}</label>&nbsp;
15 <select name="user_filter" id="user_filter">
16 <option value="0"{if $history->filters->user_filter eq 0} selected="selected"{/if}>{_T string="Select an user"}</option>
17 {foreach from=$users item=$user}
18 <option value="{$user}"{if $history->filters->user_filter === $user} selected="selected"{/if}>{$user}</option>
19 {/foreach}
20 </select>
21 {/if}
22
23 {assign var="actions" value=$history->getActionsList()}
24 {if $actions|@count gt 0}
25 <label for="action_filter">{_T string="Action"}</label>&nbsp;
26 <select name="action_filter" id="action_filter">
27 <option value="0">{_T string="Select an action"}</option>
28 {foreach from=$actions item=$action}
29 <option value="{$action|escape}"{if $history->filters->action_filter eq $action} selected="selected"{/if}>{$action|escape}</option>
30 {/foreach}
31 </select>
32 {/if}
33
34
35 <input type="submit" class="inline" value="{_T string="Filter"}"/>
36 <input type="submit" name="clear_filter" class="inline" value="{_T string="Clear filter"}"/>
37 </div>
38 <div class="infoline">
39 <a
40 class="button delete"
41 href="{path_for name="flushHistory"}"
42 >
43 <i class="fas fa-trash"></i>
44 {_T string="Flush the logs"}
45 </a>
46 {_T string="%count entry" plural="%count entries" count=$history->getCount() pattern="/%count/" replace=$history->getCount()}
47 <div class="fright">
48 <label for="nbshow">{_T string="Records per page:"}</label>
49 <select name="nbshow" id="nbshow">
50 {html_options options=$nbshow_options selected=$numrows}
51 </select>
52 <noscript> <span><input type="submit" value="{_T string="Change"}" /></span></noscript>
53 {include file="forms_types/csrf.tpl"}
54 </div>
55 </div>
56 </form>
57
58 <table class="listing">
59 <thead>
60 <tr>
61 <th class="small_head">#</th>
62 <th class="left date_row">
63 <a href="{path_for name="history" data=["option" => "order", "value" => "Galette\Filters\HistoryList::ORDERBY_DATE"|constant]}">
64 {_T string="Date"}
65 {if $history->filters->orderby eq constant('Galette\Filters\HistoryList::ORDERBY_DATE')}
66 {if $history->filters->ordered eq constant('Galette\Filters\HistoryList::ORDER_ASC')}
67 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt="{_T string="Ascendent"}"/>
68 {else}
69 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt="{_T string="Descendant"}"/>
70 {/if}
71 {/if}
72 </a>
73 </th>
74 <th class="left date_row">
75 <a href="{path_for name="history" data=["option" => "order", "value" => "Galette\Filters\HistoryList::ORDERBY_IP"|constant]}">
76 {_T string="IP"}
77 {if $history->filters->orderby eq constant('Galette\Filters\HistoryList::ORDERBY_IP')}
78 {if $history->filters->ordered eq constant('Galette\Filters\HistoryList::ORDER_ASC')}
79 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt="{_T string="Ascendent"}"/>
80 {else}
81 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt="{_T string="Descendant"}"/>
82 {/if}
83 {/if}
84 </a>
85 </th>
86 <th class="left date_row">
87 <a href="{path_for name="history" data=["option" => "order", "value" => "Galette\Filters\HistoryList::ORDERBY_USER"|constant]}">
88 {_T string="User"}
89 {if $history->filters->orderby eq constant('Galette\Filters\HistoryList::ORDERBY_USER')}
90 {if $history->filters->ordered eq constant('Galette\Filters\HistoryList::ORDER_ASC')}
91 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt="{_T string="Ascendent"}"/>
92 {else}
93 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt="{_T string="Descendant"}"/>
94 {/if}
95 {/if}
96 </a>
97 </th>
98 <th class="left username_row">
99 <a href="{path_for name="history" data=["option" => "order", "value" => "Galette\Filters\HistoryList::ORDERBY_ACTION"|constant]}">
100 {_T string="Action"}
101 {if $history->filters->orderby eq constant('Galette\Filters\HistoryList::ORDERBY_ACTION')}
102 {if $history->filters->ordered eq constant('Galette\Filters\HistoryList::ORDER_ASC')}
103 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt="{_T string="Ascendent"}"/>
104 {else}
105 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt="{_T string="Descendant"}"/>
106 {/if}
107 {/if}
108 </a>
109 </th>
110 <th class="left">
111 {_T string="Description"}
112 </th>
113 </tr>
114 </thead>
115 <tbody>
116 {if $logs|@count == 0}
117 <tr><td colspan="6" class="emptylist">{_T string="No log found"}</td></tr>
118 {else}
119 {foreach from=$logs item=log name=eachlog}
120 <tr class="{if $smarty.foreach.eachlog.iteration % 2 eq 0}even{else}odd{/if}">
121 <td data-scope="row">
122 {$smarty.foreach.eachlog.iteration}
123 <span class="row-title">
124 {_T string="History entry %id" pattern="/%id/" replace=$smarty.foreach.eachlog.iteration}
125 </span>
126 </td>
127 <td class="nowrap" data-title="{_T string="Date"}">{$log.date_log|date_format:"%a %d/%m/%Y - %R"}</td>
128 <td class="nowrap" data-title="{_T string="IP"}">{$log.ip_log}</td>
129 <td data-title="{_T string="User"}">{$log.adh_log}</td>
130 <td data-title="{_T string="Action"}">{$log.action_log|escape}</td>
131 <td data-title="{_T string="Description"}">
132 {$log.text_log|escape}
133 {if $log.sql_log}
134 <span class="sql_log">{$log.sql_log|escape:"htmlall"}</span>
135 {/if}
136 </td>
137 </tr>
138 {foreachelse}
139 <tr><td colspan="6" class="emptylist">{_T string="logs are empty"}</td></tr>
140 {/foreach}
141 {/if}
142 </tbody>
143 </table>
144 {if $logs|@count != 0}
145 <div class="center cright">
146 {_T string="Pages:"}<br/>
147 <ul class="pages">{$pagination}</ul>
148 </div>
149 {/if}
150 {/block}
151
152 {block name="javascripts"}
153 <script type="text/javascript">
154 $(function() {
155 {include file="js_removal.tpl"}
156 var _elt = $('<img src="{base_url}/{$template_subdir}images/info.png" class="qryhide" alt="" title="{_T string="Show associated query"}"/>');
157 $('.sql_log').hide().parent().prepend(_elt);
158 $('.qryhide').click(function() {
159 $(this).next('.sql_log').show();
160 });
161 });
162
163 $('#start_date_filter, #end_date_filter').datepicker({
164 changeMonth: true,
165 changeYear: true,
166 showOn: 'button',
167 buttonText: '<i class="far fa-calendar-alt"></i> <span class="sr-only">{_T string="Select a date" escape="js"}</span>'
168 });
169 </script>
170 {/block}