source: trunk/LATMOS-Accounts-Web/root/html/logs/index.tt @ 1772

Last change on this file since 1772 was 1772, checked in by nanardon, 8 years ago

Add link to see object log by ikey

File size: 2.3 KB
Line 
1<form action="[% c.uri_for('/logs') %]">
2<label for=otype>Type d'objet</label> 
3<select id=otype name=otype>
4<option value="">--</option>
5[% FOREACH otype = c.model('Accounts').db.list_supported_objects %]
6<option value=[% otype %][% " selected" IF otype == c.req.param('otype') %]>[% otype | html %]</option>
7[% END %]
8</select>
9<br>
10<label for=object>Nom de l'object:</label><input id=object name=object value="[% c.req.param('object') %]">
11<br>
12<label for=modifier>Modifié par:</label><input id=modifier name=modifier value="[% c.req.param('modifier') %]">
13<br>
14<input type=submit>
15</form>
16
17<script>
18$(function () {
19    $('#object').autocomplete({
20        minLength: 0,
21        source: function( request, response ) {
22            $.ajax({
23                url: '[% c.uri_for("/json/list") %]',
24                data: {
25                    otype: $('#otype').val(),
26                    term: request.term,
27                },
28                success: function( data ) {
29                    response( data );
30                }
31            });
32        },
33    });
34    $('#modifier').autocomplete({
35        minLength: 0,
36        source: function( request, response ) {
37            $.ajax({
38                url: '[% c.uri_for("/json/list") %]',
39                data: {
40                    otype: 'user',
41                    term: request.term,
42                },
43                success: function( data ) {
44                    response( data );
45                }
46            });
47        },
48    });
49
50});
51</script>
52
53[% IF logobject %]
54<p>[% logobject.type %] / [% logobject.id %] <a href="[% c.uri_for('/logs', {
55    'okey' => logobject.get_attributes('ikey'),
56    'modifier' => c.req.param('modifier') } ) %]">Traverser les renomages</a></p>
57[% END %]
58
59[% FOREACH logentry = logs %]
60[% IF loop.first %]
61<table border=1 style="font-size: 12px">
62[% END %]
63
64<tr>
65<td>
66[% logentry.logdate |remove('\..*') %]<br>
67</td>
68
69[% IF NOT c.req.param('modifier') %]
70<td>
71[% logentry.username | html %]
72</td>
73[% END %]
74
75[% IF NOT logobject %]
76<td>
77[% logentry.otype | html %] /
78[% logentry.name | html %]
79</td>
80[% END %]
81
82<td>
83<a href="[% c.uri_for('/logs', {
84    'okey' => logentry.ikey,
85    'modifier' => c.req.param('modifier') } ) %]">[% logentry.ikey %]</a>
86</td>
87
88<td>
89<b>[% logentry.changetype | html %]</b>:
90[% logentry.message | html %]
91</td>
92
93</tr>
94
95[% IF loop.last %]
96</table>
97[% END %]
98[% END %]
Note: See TracBrowser for help on using the repository browser.