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

Revision 3022, 10.6 KB checked in by jukka, 10 years ago (diff)

Fixes for after upgrade bugs

Line 
1<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
2      lang="en"
3      i18n:domain="lemill">
4<body>
5
6
7 <metal:block define-macro="memberfolder_object_info" tal:define="HasCoverImage obj/getHasCoverImage | python:None;
8     interests obj/getInterests | nothing;
9     nicename obj/getNicename | nothing;
10     location_country obj/getLocation_country | nothing;
11     messenger real_obj/getMessenger1 | nothing;
12     obj_url obj/getURL;
13     ">
14
15     <div class="coverimage" tal:condition="HasCoverImage">
16        <span></span>
17         <span tal:define="real_object obj/getObject | nothing;
18                       piccy real_object/getCoverImage | obj/getCoverImage;" tal:omit-tag="">
19             <a href="" tal:attributes="href obj_url">
20                 <img src="" alt="Member Folder" tal:attributes="src piccy/absolute_url | python:'images/default_member.png'"/>
21             </a>
22         </span>
23     </div>
24     <div class="coverimage" tal:condition="not:HasCoverImage">
25        <span></span>
26         <a href="" tal:attributes="href obj_url">
27             <img src="images/default_member.png" alt="Member Folder" height="120" width="120" />
28         </a>
29     </div>
30     <a href=""
31         tal:attributes="href obj_url" class="browse_title_d">
32         <span tal:replace="nicename"></span>
33     </a>
34        <a tal:condition="python: messenger and not isAnon" tal:attributes="href messenger">
35            <img src="discussionitem_icon.gif" align="right"/>
36        </a>     
37
38    <div class="metadata">
39    <ul class="metadata">
40     <li class="browse_title_r">
41        <a href=""
42            tal:attributes="href obj_url">
43            <span tal:replace="nicename"></span>
44        </a>
45        <a tal:condition="python: messenger and not isAnon" tal:attributes="href messenger">
46            <img src="discussionitem_icon.gif" />
47        </a>     
48     </li>
49     <li class="browse_info" tal:condition="location_country">
50             <tal:block i18n:translate="label_location">Location</tal:block>:
51                <a href="#" tal:attributes="href string:${community_section}/country?location=${location_country}" tal:content="location_country">Country</a>
52     </li>       
53     <li class="browse_info" tal:condition="interests">
54         <div><tal:block i18n:translate="label_interests">Interests</tal:block>:
55             <tal:block tal:repeat="interests python:interests[:20]"  tal:omit-tag="">
56                <a href="#" tal:attributes="href string:${community_section}/interests?interests=${interests}" tal:content="interests">PLACEHOLDER</a><span tal:condition="not:repeat/interests/end" tal:omit-tag="">, </span>
57             </tal:block>
58         </div>
59     </li>
60
61    </ul>
62   </div>
63
64 </metal:block>
65
66
67 <metal:block define-macro="group_object_info" tal:define="HasCoverImage obj/getHasCoverImage | python:None;
68     name obj/Title | obj/getId;
69     tags obj/getTags;
70     obj_url obj/getURL;
71     lang obj/getLanguage_skills;
72     ">
73     <div class="coverimage" tal:condition="HasCoverImage">
74        <span></span>
75         <span tal:define="real_object obj/getObject | nothing;
76                           piccy real_object/getCoverImage | obj/getCoverImage;" tal:omit-tag="">
77             <a href="" tal:attributes="href obj_url">
78                 <img src="" alt="Group Blog" tal:attributes="src piccy/absolute_url | string:images/default_group.png" />
79             </a>
80         </span>
81     </div>
82     <div class="coverimage" tal:condition="not:HasCoverImage">
83        <span></span>
84         <a href="" tal:attributes="href obj_url">
85             <img src="images/default_group.png" alt="Group Blog" height="120" width="120" />
86         </a>
87     </div>
88    <a href=""
89        tal:attributes="href obj_url" class="browse_title_d">
90        <span tal:replace="name"></span>
91    </a>
92    <div class="metadata">
93     <ul class="metadata">
94
95      <li class="browse_title_r">
96          <a href=""
97              tal:attributes="href obj_url">
98              <span tal:replace="name"></span>
99          </a>
100      </li>
101    <li class="browse_info" tal:condition="tags">
102        <tal:block i18n:translate="label_tags">Tags</tal:block>:
103        <tal:block tal:repeat="tag python:tags[:20]"  tal:omit-tag="">
104            <a href="#" tal:attributes="href string:${tag_link_pref}${tag}" tal:content="tag">PLACEHOLDER</a><span tal:condition="not:repeat/tag/end" tal:omit-tag="">, </span>
105        </tal:block>   
106    </li>
107    <li class="browse_info" tal:condition="lang">
108        <tal:block i18n:translate="label_languages">Languages</tal:block>:
109        <tal:block tal:repeat="la lang"  tal:omit-tag="">
110            <a href="#" tal:attributes="href python:'%s%s' % (lang_link_pref, la)" tal:content="python:context.script_getPrettyLanguage(la)">PLACEHOLDER</a><span tal:condition="not:repeat/la/end" tal:omit-tag="">, </span>
111        </tal:block>   
112    </li>
113
114     </ul>
115    </div>
116 </metal:block>
117
118
119
120
121
122<metal:block define-macro="resource_object_info">
123
124    <tal:outer_defs define="obj_state obj/getState | string:"
125        condition="python:obj_state!='deleted'">
126
127    <tal:defs define="obj_url obj/getURL | obj/absolute_url;
128            showAuthor python:obj_state != 'draft';
129            obj_url python:test(use_view_action, '%s/view' % obj_url, obj_url);
130            HasCoverImage obj/getHasCoverImage | python:None;
131            name obj/Title | obj/getId;
132            creator obj/Creator;
133            modDate obj/ModificationDate;
134            authors obj/listCreators;
135            lang obj/Language;
136            tags obj/getTags | string:;">
137
138     <div class="coverimage" tal:condition="HasCoverImage">
139        <span></span>
140         <span tal:define="piccyurl string:${obj/getURL}/coverImage" tal:omit-tag="">
141             <a href="" tal:attributes="href obj_url">
142                 <img src="" tal:attributes="src piccyurl; alt python:obj.portal_type" />
143             </a>
144         </span>
145     </div>
146     <div class="coverimage" tal:condition="not:HasCoverImage">
147         <a href="" tal:attributes="href obj_url">
148             <img src="" tal:attributes="src python:context.content.getDefaultIcon(obj.portal_type); alt python:obj.portal_type" height="120" width="120" />
149         </a>
150     </div>
151
152    <a href=""
153        tal:attributes="href obj_url" class="browse_title_d">
154        <span tal:replace="name"/>
155    </a>
156    <div class="metadata">
157     <ul class="metadata">
158
159     <li class="browse_title_r">
160         <a href=""
161             tal:attributes="href obj_url">
162             <strong tal:content="name" />
163         </a>
164     </li>
165
166     <li class="browse_info" tal:condition="showAuthor"><span i18n:translate="label_authors">Authors</span>:
167        <tal:loop tal:repeat="author authors">
168                 <a tal:replace="structure python:lutool.linkTo(author)" />
169                 <tal:sep tal:condition="not:repeat/author/end">,</tal:sep>
170        </tal:loop>
171    </li>
172    <li class="browse_info" tal:condition="tags">
173        <tal:block i18n:translate="label_tags">Tags</tal:block>:
174        <tal:block tal:repeat="tag python:tags[:20]"  tal:omit-tag="">
175            <a href="#" tal:attributes="href string:${link_pref}${tag}" tal:content="tag">PLACEHOLDER</a><span tal:condition="not:repeat/tag/end" tal:omit-tag="">, </span>
176        </tal:block>
177   
178    </li>
179    <li class="browse_info" tal:condition="lang">
180        <tal:block i18n:domain="plone" i18n:translate="label_language">Language</tal:block>: <span tal:replace="python:here.script_getPrettyLanguage(lang)"></span></li>
181    </ul>
182   </div>
183   </tal:defs>
184   </tal:outer_defs>
185
186</metal:block>
187
188
189
190<metal:block define-macro="resources_list">
191<tal:split define="special_list python:here.lemill_tool.splitResultList(batch); link_pref string:${context/aq_inner/aq_parent/absolute_url}/tags?tag=">
192<tal:rep repeat="special special_list">
193<h2 tal:condition="python:special[0] != ''" tal:content="python:special[0]" i18n:translate="" class="learning_story_title" />
194<ul id="resource_list" class="expanded">
195    <li tal:repeat="obj python:special[1]" class="resultobject">
196        <metal:tds use-macro="here/resource_list_macro/macros/resource_object_info" />
197    </li>
198</ul>
199</tal:rep>
200</tal:split>
201</metal:block>
202
203<metal:block define-macro="resources_list_unsorted">
204<ul id="resource_list" class="expanded" tal:define="link_pref string:${context/aq_inner/aq_parent/absolute_url}/tags?tag=">
205    <li tal:repeat="obj batch" class="resultobject">
206        <metal:tds use-macro="here/resource_list_macro/macros/resource_object_info" />
207    </li>
208</ul>
209</metal:block>
210
211
212<metal:block define-macro="members_list"> 
213<ul id="resources_list" class="expanded" tal:define="community_section python: '%s/community' % portal_url;">
214    <li tal:repeat="obj batch" class="resultobject">
215        <metal:tds use-macro="here/resource_list_macro/macros/memberfolder_object_info" />
216    </li>
217</ul>
218</metal:block>
219
220<metal:block define-macro="groups_list"> 
221<ul id="resources_list" class="expanded" tal:define="tag_link_pref string:${portal_url}/community/tags?tag=;
222lang_link_pref string:${portal_url}/community/g_language?language_skills=">
223    <li tal:repeat="obj batch" class="resultobject">
224        <metal:tds use-macro="here/resource_list_macro/macros/group_object_info" />
225    </li>
226</ul>
227</metal:block>
228
229<metal:block define-macro="mixed_results_list"> 
230<ul id="resources_list" class="expanded" tal:define="
231        pu python:portal_url;
232        tag_link_pref string:${pu}/community/tags?tag=;
233        lang_link_pref string:${pu}/community/g_language?language_skills=;
234        community_section python: '%s/community' % pu;
235        section_dictionary python: {'Activity':'methods', 'Tool':'tools', 'MultimediaMaterial':'content',  'PresentationMaterial':'content', 'ExerciseMaterial':'content', 'PILOTMaterial':'content', 'SchoolProjectMaterial':'content', 'Piece':'content', 'LeMillReference':'content', 'BlogPost':'community', 'DiscussionItem':'community', 'Collection':'community', 'CollectionsFolder':'community','LessonPlan':'content', 'LeMillPrintResource':'content'}">
236    <li tal:repeat="obj batch" class="resultobject">
237        <tal:if_group condition="python: obj.portal_type=='GroupBlog'">
238            <metal:tds use-macro="here/resource_list_macro/macros/group_object_info" />
239        </tal:if_group>
240        <tal:if_member condition="python: obj.portal_type=='MemberFolder'">
241            <metal:tds use-macro="here/resource_list_macro/macros/memberfolder_object_info" />
242        </tal:if_member>
243        <tal:if_resource condition="python: obj.portal_type in section_dictionary.keys()">
244            <tal:defs define="link_pref python:'%s/%s/tags?tag=' % (pu,section_dictionary[obj.portal_type])">
245                <metal:tds use-macro="here/resource_list_macro/macros/resource_object_info" />
246            </tal:defs>
247        </tal:if_resource>
248    </li>
249</ul>
250</metal:block>
251
252
253</body>
254</html>
Note: See TracBrowser for help on using the repository browser.