Tabs -> 4 × spaces
[Plinn.git] / skins / generic / widgets.pt
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
3 <html xmlns="http://www.w3.org/1999/xhtml">
4
5 <head>
6 <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7 <title>widgets</title>
8 <link href="../patch_skins/plinn_style.css" rel="stylesheet" media="screen">
9 </head>
10
11 <body>
12 <pre>tabs</pre>
13 <hr/>
14 <table class="tabs" metal:define-macro="tabs">
15 <tr>
16 <td tal:repeat="ai_dict ai_dicts" tal:attributes="class python:(useQueryString and ['%s?%s' % (request['URL0'], request['QUERY_STRING']) == ai_dict['url'], ] or [request['URL0'] == ai_dict['url'], ])[0] and 'selected' or nothing">
17 <a href="." tal:attributes="href ai_dict/url" tal:content="python:ai_dict['name'] or ai_dict['id']" i18n:translate="">Action 1</a>
18 </td>
19 </tr>
20 </table>
21 <pre>generic_header</pre>
22 <hr />
23 <div metal:define-macro="generic_header"
24 tal:define="mq python:modules['ZTUtils'].make_query;
25 url python:request.get('URL0');
26 cmfPerms python:modules['Products.CMFCore.permissions'];
27 ModifyPortalContent cmfPerms/ModifyPortalContent;
28 allow_edit python:mtool.checkPermission(ModifyPortalContent, here)">
29 <table width="100%">
30 <tr>
31 <td tal:condition="allow_edit" i18n:domain="plinn">
32 <a href="." title="Edit metadata" i18n:attributes="title" id="ToggleFormButton"
33 tal:attributes="href python: '%s?%s' % (url , mq( request.form, {'edit_metadata':'titleAndDescForm'} ))"><img src="../images/collapsedPalette.gif" alt="Edit metadata" height="16" width="16" tal:attributes="src here/collapsedPalette.gif/absolute_url" border="0" i18n:attributes="alt" /></a>
34 </td>
35 <td width="100%" id="HeaderArea" tal:define="metadata_macro python:request.form.get('edit_metadata', 'viewTitleAndDesc')">
36 <span metal:use-macro="python:here.header_widgets.macros[metadata_macro]"></span>
37 </td>
38 </tr>
39 </table>
40 <script type="text/javascript" tal:attributes="src here/palette.js/absolute_url"></script>
41 <script type="text/javascript" tal:attributes="src here/generic_header_script.js/absolute_url"></script>
42 <script type="text/javascript" tal:attributes="src here/calendar.js/absolute_url"></script>
43 <script type="text/javascript" tal:attributes="src string:${portal_url}/lang/calendar-fr.js"></script>
44 <script type="text/javascript" tal:attributes="src here/calendar-setup.js/absolute_url"></script>
45 <script type="text/javascript">//<!--
46 initHeaderScript();
47 //-->
48 </script>
49 </div>
50
51 <div metal:define-macro="clipboard"
52 tal:condition="python:not request.SESSION.get('editBoxes')"
53 i18n:domain="plinn"
54 tal:on-error="python:here.emptyClipboard(empty=True,ajax=True) and None"
55 id="clipboard">
56 <table tal:condition="clip" class="clipboard" cellspacing="0" tal:define="clip here/getCPInfoList">
57 <tr><th i18n:translate="">Clipboard</th></tr>
58 <tr><td>
59 <form tal:attributes="action string:${here/absolute_url}/emptyClipboard" method="post">
60 <ul>
61 <li tal:repeat="item clip" tal:attributes="class python:repeat['item'].odd() and 'odd' or 'even'"><input type="checkbox" name="indexes:int:list" tal:attributes="value repeat/item/index"/><a tal:attributes="href item/url ; title item/title"><img tal:attributes="src item/icon ; alt item/type ; height item/height ; width item/width" border="0" /> <span tal:replace="item/title">Title</span></a></li>
62 </ul>
63 <input type="submit" name="delete" value="Delete" i18n:attributes="value" style="float:left"/>
64 <input type="submit" name="empty" value="Empty" i18n:attributes="value" style="float:right" />
65 </form>
66 </td></tr>
67 </table>
68 </div>
69
70 <div metal:define-macro="date_selector"
71 tal:define="isDict python:hasattr(date, 'keys');
72 year python:str(isDict and date['year'] or date.year()) ;
73 month python:str(isDict and date['month'] or date.month()).zfill(2) ;
74 day python:str(isDict and date['day'] or date.day()).zfill(2) ;
75 hour python:str(isDict and date['hour'] or date.hour()).zfill(2) ;
76 minute python:str(isDict and date['minute'] or date.minute()).zfill(2);
77 defaultDate defaultDate|nothing"
78 i18n:domain="plinn"
79 tal:omit-tag="">
80 <div tal:condition="defaultDate" tal:omit-tag="">
81 <label>
82 <input type="checkbox" id="effective_date_cb" tal:attributes="id string:${dateName}_cb" />
83 <span tal:replace="defaultDateLabel|nothing">default</span>
84 </label><br />
85 </div>
86 <div tal:attributes="id string:${dateName}_fields">
87 <input type="hidden" tal:attributes="id dateName" /><span i18n:translate="" tal:omit-tag=""
88 ><span i18n:name="month"
89 ><input type="text" size="2" tal:attributes="id string:${dateName}_month; name string:${dateName}.month:record; value month"
90 /></span>&nbsp;/&nbsp;<span i18n:name="day"
91 ><input type="text" size="2" tal:attributes="id string:${dateName}_day; name string:${dateName}.day:record; value day"
92 /></span>&nbsp;/&nbsp;<span i18n:name="year"
93 ><input type="text" size="4" tal:attributes="id string:${dateName}_year; name string:${dateName}.year:record; value year"
94 /></span>&nbsp;&nbsp;<span i18n:name="hour"
95 ><input type="text" size="2" tal:attributes="id string:${dateName}_hour; name string:${dateName}.hour:record; value hour"
96 /></span>&nbsp;:&nbsp;<span i18n:name="minute"
97 ><input type="text" size="2" tal:attributes="id string:${dateName}_minute; name string:${dateName}.minute:record; value minute"
98 /></span></span>
99 <input type="button" value="..." tal:attributes="id string:show_${dateName}_cal" /><br />
100 <script type="text/javascript" tal:condition="not:defaultDate"
101 tal:content="structure python:'''
102 // <!--\n
103 new MetadataDateManager('%s');\n
104 // -->''' % dateName">
105 </script>
106 <script type="text/javascript" tal:condition="defaultDate"
107 tal:content="structure python:'''
108 // <!--\n
109 new MetadataDateManager('%s', new Date('%s'));\n
110 // -->''' % (dateName, defaultDate)">
111 </script>
112 </div>
113 </div>
114
115 <table metal:define-macro="news_box"
116 class="news_box" cellspacing="0"
117 tal:define="ctool python:modules['Products.CMFCore.utils'].getToolByName(here, 'portal_catalog');
118 news python:ctool(portal_type='News Item'
119 , sort_on='modified'
120 , sort_order='reverse'
121 , review_state='published')[:5]"
122 tal:condition="news"
123 i18n:domain="plinn">
124 <tr>
125 <th i18n:translate="">News</th>
126 </tr>
127 <tr tal:repeat="n news">
128 <td tal:define="oddrow repeat/n/odd" tal:attributes="class python:oddrow and 'odd' or 'even'">
129 <a tal:attributes="href n/getURL ; title n/Description">
130 <img border="0" alt="News Item" tal:attributes="src n/getIcon" i18n:attributes="alt" />
131 <span tal:replace="n/Title|n/getId"></span>
132 <div tal:content="python:DateTime(n.ModificationDate).strftime(locale_date_fmt)"></div>
133 </a>
134 </td>
135 </tr>
136 </table>
137
138
139 <div metal:define-macro="debug" tal:replace="nothing">
140 </div>
141 </body>
142
143 </html>