Filtrage du type « File » dans folder_factories.
[Plinn.git] / Products / Plinn / skins / content / folder_factories.pt
1 <html metal:use-macro="here/main_template/macros/master">
2 <head>
3 <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
4 <title>folder_factories</title>
5 <link href="zpt_stylesheet.css" rel="stylesheet" media="screen"/>
6 <link href="../content/plinn_style.css" rel="stylesheet" media="screen"/>
7 </head>
8 <body>
9 <div metal:fill-slot="main" i18n:domain="plinn">
10 <div tal:condition="python: not(here.portal_membership.checkPermission('Access contents information', here))">
11 <span tal:define="dummy here/unauthRedirect"/>
12 </div>
13 <form tal:attributes="action string:${here/absolute_url}/add_content" method="post" id="factories_form">
14 <table cellspacing="0" tal:define="ucn here/getUntitledContentName" class="FolderFactories">
15 <tr>
16 <th><br/></th>
17 <th i18n:translate="">Type</th>
18 <th i18n:translate="">Name</th>
19 <th><br/></th>
20 </tr>
21 <div tal:repeat="item here/allowedContentTypes" tal:omit-tag="">
22 <div tal:condition="python:item.getId() != 'File'" tal:omit-tag="">
23 <tr tal:define="icon python:here.restrictedTraverse(item.getIcon())">
24 <td class="ListName">
25 <img tal:attributes="src icon/absolute_url ; alt item/Title ; height icon/height ; width icon/width" i18n:attributes="alt"/>
26 </td>
27 <td tal:content="item/Title" i18n:translate="" class="ListName">Content name</td>
28 <td tal:condition="python:not item.listActionInfos('object/create', check_visibility=0)">
29 <input type="text" name="id" size="24" tal:attributes="name string:${item/id}.id:record; value ucn"/>
30 </td>
31 <td tal:condition="python:item.listActionInfos('object/create', check_visibility=0)">
32 <input type="hidden" value="1" tal:attributes="name string:${item/id}.create_form:record"/>
33 </td>
34 <td>
35 <input type="submit" value="Add" tal:attributes="name string:${item/id}.type:record" i18n:attributes="value"/>
36 </td>
37 </tr>
38 <tr>
39 <td colspan="4" class="spacing"></td>
40 </tr>
41 </div>
42 </div>
43 </table>
44 </form>
45 <script type="text/javascript" charset="utf-8">
46 (function(){
47 var fform = document.getElementById('factories_form');
48 var fm = new FormManager(fform);
49 var submitButton;
50 fm.onBeforeSubmit = function(self, evt) {
51 if (submitButton)
52 self.submitButton = submitButton;
53 };
54 var id2type = /(^[^\.]+)\.id:record$/;
55 function trackFocus(evt) {
56 var input = getTargetedObject(evt);
57 var matches = id2type.exec(input.name);
58 if (matches && matches.length == 2)
59 submitButton = fform.elements[matches[1] + '.type:record'];
60 }
61 var e;
62 for (var i = 0 ; i < fform.elements.length ; i++) {
63 e = fform.elements[i];
64 if (e.type==='text')
65 addListener(e, 'focus', trackFocus);
66 }
67 }());
68 </script>
69 </div>
70 </body>
71 </html>