source: trunk/skins/lemill/resource_list_macro.pt @ 469

Revision 469, 8.0 KB checked in by tarmo, 13 years ago (diff)

All strings in ZPTs are now i18n'd. Refs #524, spent 90m,
30m remaining. Need to fix i18n:domains still.

Line 
1<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
2      lang="en"
3      i18n:domain="lemill">
4<body>
5
6 <metal:tag_macro define-macro="show_tags">
7             <p><tal:block i18n:translate="label_tags">Tags:</tal:block>
8                 <tal:block tal:repeat="tag python:tags[:20]"  tal:omit-tag="">
9                    <a href="#" tal:attributes="href string:$portal_url/search?getTags=${tag}" tal:content="tag">PLACEHOLDER</a>
10                     <span tal:condition="not:repeat/tag/end" tal:omit-tag="">, </span>
11                 </tal:block>
12             </p>
13 </metal:tag_macro>
14
15
16 <metal:inside_table define-macro="MemberFolder_info" tal:define="HasCoverImage obj/getHasCoverImage;
17     tags obj/getTags | nothing;
18     nicename obj/getNicename | nothing;
19     location_country obj/getLocation_country | nothing;
20     location_area obj/getLocation_area | nothing;
21     messenger real_obj/getMessenger1 | nothing;
22     language_skills obj/getLanguage_skills | nothing;
23     ">
24
25     <td tal:condition="HasCoverImage">
26         <span tal:define="real_object obj/getObject | nothing;
27                           piccy real_object/getCoverImage | obj/getCoverImage;" tal:omit-tag="">
28             <a href="" tal:attributes="href obj_url">
29                 <img src="" tal:attributes="src piccy/absolute_url" height="120" width="160" />
30             </a>
31         </span>
32     </td>
33     <td tal:condition="not:HasCoverImage">
34         <a href="" tal:attributes="href obj_url">
35             <img src="" tal:attributes="src python:'default_member.png'" height="120" width="160" />
36         </a>
37     </td>
38     <td tal:define="real_obj obj/getObject;
39              tags obj/getTags | nothing;
40              ">
41         <h4>
42             <a href=""
43                 tal:attributes="href obj_url">
44                 <span tal:replace="nicename"></span>
45             </a>
46             <a tal:condition="messenger" tal:attributes="href messenger">
47                 <img src="discussionitem_icon.gif" />
48             </a>
49         </h4>
50          <span tal:condition="location_country"  tal:omit-tag="">
51             <div i18n:translate="label_country">Country:
52                 <a href="#" tal:attributes="href string:$portal_url/search?getLocation_country=${location_country}" tal:content="location_country">Country</a>
53             </div>
54         </span>
55
56         <span tal:condition="location_area"  tal:omit-tag="">
57             <div i18n:translate="label_area"  tal:omit-tag="">Area:
58                 <a href="#" tal:attributes="href string:$portal_url/search?getLocation_area=${location_area}" tal:content="location_area">Area</a>
59             </div>
60         </span>
61       
62         <span tal:condition="tags" tal:omit-tag="">
63             <span metal:use-macro="here/resource_list_macro/macros/show_tags"/>
64         </span>
65
66         <span tal:condition="language_skills"  tal:omit-tag="">
67             <p i18n:translate="label_language_skills">Preferred languages:
68                 <span tal:repeat="languagename language_skills" tal:omit-tag="">
69                    <a href="#" tal:attributes="href string:$portal_url/search?getLanguage_skills=${languagename}" tal:content="python:here.script_getPrettyLanguage(languagename)">Language</a>
70                     <span tal:condition="not:repeat/languagename/end" tal:omit-tag="">, </span>
71                 </span>
72             </p>
73         </span>
74     </td>
75 </metal:inside_table>
76
77
78 <metal:inside_table define-macro="GroupBlog_info" tal:define="HasCoverImage obj/getHasCoverImage;
79     name obj/Title | obj/getId;
80     tags obj/getTags;
81     ">
82     <td tal:condition="HasCoverImage">
83         <span tal:define="real_object obj/getObject | nothing;
84                           piccy real_object/getCoverImage | obj/getCoverImage;" tal:omit-tag="">
85             <a href="" tal:attributes="href obj_url">
86                 <img src="" tal:attributes="src piccy/absolute_url" height="120" width="160" />
87             </a>
88         </span>
89     </td>
90     <td tal:condition="not:HasCoverImage" tal:on-error="nothing">
91         <a href="" tal:attributes="href obj_url">
92             <img src="" tal:attributes="src python:'default_group.png'" height="120" width="160" />
93         </a>
94     </td>
95     <td>
96         <h4>
97             <a href=""
98                 tal:attributes="href obj_url">
99                 <span tal:replace="name"></span>
100             </a>
101         </h4>
102         <span tal:condition="tags" tal:omit-tag="">
103             <span metal:use-macro="here/resource_list_macro/macros/show_tags"/>
104         </span>
105     </td>
106 </metal:inside_table>
107
108 <metal:inside_table define-macro="Resource_info" tal:define="HasCoverImage obj/getHasCoverImage;
109     name obj/Title | obj/getId;
110     creator obj/Creator;
111     lang obj/Language;
112     tags obj/getTags;
113     creator_nicename python:mtool.getHomeFolder(creator).NiceName();
114     ">
115
116     <td tal:condition="HasCoverImage">
117         <span tal:define="real_object obj/getObject | nothing;
118                           piccy real_object/getCoverImage | obj/getCoverImage;" tal:omit-tag="">
119             <a href="" tal:attributes="href obj_url">
120                 <img src="" tal:attributes="src piccy/absolute_url" height="120" width="160" />
121             </a>
122         </span>
123     </td>
124     <td tal:condition="not:HasCoverImage">
125         <a href="" tal:attributes="href obj_url">
126             <img src="" tal:attributes="src python:'default_'+(obj.meta_type).lower()+'.png'" height="120" width="160" />
127         </a>
128     </td>
129     <td>
130         <h4>
131             <a href=""
132                 tal:attributes="href obj_url">
133                 <span tal:replace="name"></span>
134             </a>
135         </h4>
136         <div tal:condition="showAuthor" tal:omit-tag="">Author: <span tal:replace="creator_nicename"></span></div>
137         <span metal:use-macro="here/resource_list_macro/macros/show_tags"/>
138         <div><tal:block i18n:translate="label_language">Language:</tal:block> <span tal:replace="python:here.script_getPrettyLanguage(lang)"></span></div>
139     </td>
140 </metal:inside_table>
141
142
143
144
145<metal:block define-macro="resources_list">
146
147<table class="resource_list">
148    <tr tal:repeat="obj object_list">
149        <tal:block define="obj_url obj/getURL | obj/absolute_url;
150            obj_type obj/portal_type;
151            url python:'%s?searchterm=%s'%(test(obj_type in use_view_action, obj_url+'/view', obj_url+'/'), searchterm);
152            review_state obj/review_state | nothing;
153            showAuthor python:review_state != 'draft';
154            inCollection inCollection | nothing
155            ">
156            <td tal:condition="inCollection" id="checkboxtd">
157                <input type="checkbox" name="" id="" value="True" tal:attributes="name python:repeat['obj'].number(); id python:repeat['obj'].number()" />
158            </td>
159            <tal:inside condition="python: obj_type=='MemberFolder'">
160                <metal:tds use-macro="here/resource_list_macro/macros/MemberFolder_info" />
161            </tal:inside>
162            <tal:inside condition="python: obj_type=='GroupBlog'">             
163                <metal:tds use-macro="here/resource_list_macro/macros/GroupBlog_info" />
164            </tal:inside>
165            <tal:inside condition="python: obj_type!='GroupBlog' and obj_type!='MemberFolder'">             
166                <metal:tds use-macro="here/resource_list_macro/macros/Resource_info" />
167            </tal:inside>
168
169            <td tal:condition="inCollection">
170                <div><img src="arrowUp.gif" alt="" title="Up" i18n:attributes="title button_up" onClick="" tal:attributes="onClick python:'javascript:location.href=\''+here.absolute_url()+'/script_collection_actions?action=MoveUp&amp;id='+str(repeat['obj'].number())+'\''"/></div>
171               
172                <div><img src="arrowDown.gif" alt="" title="Down" i18n:attributes="title button_down" onClick="" tal:attributes="onClick python:'javascript:location.href=\''+here.absolute_url()+'/script_collection_actions?action=MoveDown&amp;id='+str(repeat['obj'].number())+'\''"/></div>
173            </td>
174
175        </tal:block>
176    </tr>
177</table>
178
179</metal:block>
180
181
182</body>
183</html>
Note: See TracBrowser for help on using the repository browser.