Line | |
---|
1 | <div style="display: inline-block; width 60%; vertical-align: top"> |
---|
2 | [% INCLUDE 'oaliases/index.tt' %] |
---|
3 | </div> |
---|
4 | <div style="display: inline-block; vertical-align: top"> |
---|
5 | <h3>Alias [% objectalias.type %]/[% objectalias.id | html %]</h3> |
---|
6 | <form action="[% c.uri_for('/oaliases', objectalias.type, objectalias.id) %]"> |
---|
7 | <label for=oalias>Alias pour</label> |
---|
8 | <input type=text id=oalias name=oalias value="[% objectalias.get_attributes('oalias') | html %]"> |
---|
9 | <br> |
---|
10 | <label for=exported>Exporté:</label> |
---|
11 | <input name=exported id=exported type=checkbox value=1 [% 'checked' IF objectalias.get_attributes('exported') %]> |
---|
12 | <br> |
---|
13 | <input type=submit> |
---|
14 | <input type=submit name=delete value="Détruire" id=delete> |
---|
15 | <script> |
---|
16 | $(function() { |
---|
17 | $('#oalias').autocomplete({ |
---|
18 | delay: 200, |
---|
19 | minLength: 0, |
---|
20 | source: function( request, response ) { |
---|
21 | $.ajax({ |
---|
22 | url: '[% c.uri_for('/json/list') %]', |
---|
23 | data: { |
---|
24 | otype: $('#otype').val(), |
---|
25 | term: request.term, |
---|
26 | }, |
---|
27 | success: function(data) { |
---|
28 | response(data); |
---|
29 | }, |
---|
30 | }); |
---|
31 | }, |
---|
32 | }); |
---|
33 | $( "#oalias" ).focus(function() { $( "#oalias" ).autocomplete("search", "" ); }); |
---|
34 | $( "#oalias" ).click(function() { $( "#oalias" ).autocomplete("search", "" ); }); |
---|
35 | |
---|
36 | $( '#delete' ).on('click', function(event) { |
---|
37 | if (!confirm("Détruire l'alias [% objectalias.type %]/[% objectalias.id | html %] ?")) { |
---|
38 | event.preventDefault(); |
---|
39 | return; |
---|
40 | } |
---|
41 | }); |
---|
42 | }); |
---|
43 | </script> |
---|
44 | </form> |
---|
45 | |
---|
46 | </div> |
---|
Note: See
TracBrowser
for help on using the repository browser.