Last change
on this file was
1459,
checked in by nanardon, 9 years ago
|
Restore object name detection
|
-
Property svn:keywords set to
Id
|
File size:
1.2 KB
|
Line | |
---|
1 | <!-- $Id$ --> |
---|
2 | |
---|
3 | <h2>Créer un objet de type [% c.forward('/obj_to_label', [ form.otype ]) | html %]</h2> |
---|
4 | <div id="objectform" class="objectform"> |
---|
5 | <form action="[% c.uri_for('/create', form.otype) %]" method="POST"> |
---|
6 | <table border="1"> |
---|
7 | |
---|
8 | <input type="hidden" name="step" value="[% ochelper.step | html %]"> |
---|
9 | [% IF ochelper.name.ask %] |
---|
10 | <tr><th>Nom de l'objet:</th> |
---|
11 | <td><input id="_name" type="text" name="_name" value="[% ochelper.name.content | html %]"> |
---|
12 | <script> |
---|
13 | $( function() { |
---|
14 | $( "#_name" ).on('input', function() { |
---|
15 | $.ajax({ |
---|
16 | method: "POST", |
---|
17 | url: '[% c.uri_for('/ajax', 'objexist', form.otype) %]', |
---|
18 | data: { val: $(this).val() }, |
---|
19 | }). done(function( msg ) { |
---|
20 | $( '#_name_span' ).html (msg); |
---|
21 | }); |
---|
22 | }); |
---|
23 | }); |
---|
24 | </script> |
---|
25 | <span id="_name_span"></span> |
---|
26 | </td></tr> |
---|
27 | [% END %] |
---|
28 | [% FOREACH attr = ochelper.ask %] |
---|
29 | <tr> |
---|
30 | <th> |
---|
31 | [% form.attr_label(attr) %] |
---|
32 | [% IF form.attr_hint(attr) %] |
---|
33 | <span |
---|
34 | title="[% form.attr_hint(attr) | html %]" |
---|
35 | class="hint">?</span> |
---|
36 | [% END %] |
---|
37 | </th> |
---|
38 | <td>[% form.attr_field(attr) %]</td></tr> |
---|
39 | [% END %] |
---|
40 | |
---|
41 | <tr><td colspan="2"><input type="submit"></td></tr> |
---|
42 | </table> |
---|
43 | |
---|
44 | </form> |
---|
45 | </div> |
---|
Note: See
TracBrowser
for help on using the repository browser.