source: trunk/skins/lemill/portlet_macros.pt @ 3010

Revision 3010, 14.8 KB checked in by jukka, 10 years ago (diff)

PILOTs can now be embedded. Unified to use same portlet macro as embedding collections.

Line 
1<html xmlns:tal="http://xml.zope.org/namespaces/tal"
2      xmlns:metal="http://xml.zope.org/namespaces/metal"
3      i18n:domain="lemill">
4<body>
5
6************ Resources ***************
7Used by:
8All Resources
9Uses:
10subView, canChangeCoverImage, canRetract, canPublish, canUndelete, canManage
11
12<tal:coverImage metal:define-macro="coverImageDiv">
13<div class="tb-portlet">
14    <p style="text-align: center;">
15     <a href="" tal:condition="d/subView" tal:attributes="href string: ${here_url}/view">
16      <img src="images/default_learningresource.png" tal:attributes="src here/getCoverImageURL; alt python:here.meta_type" style="padding: 39px 0px 29px 0px;" />
17     </a>
18      <img tal:condition="not:d/subView" src="images/default_learningresource.png" tal:attributes="src here/getCoverImageURL; alt python:here.meta_type" style="padding: 39px 0px 29px 0px;" />     
19    </p>
20    <ul tal:condition="d/canChangeCoverImage">
21        <li>
22            <a  href="" tal:attributes="href string:${here_url}/change_coverimage"><tal:block i18n:translate="label_change_cover_image">Change cover image</tal:block>...</a>
23        </li>
24        <li tal:condition="d/canRetract">
25            <a href="" tal:attributes="href string:$here_url/retract"><tal:block i18n:domain="lemill" i18n:translate="Change to draft">Change to draft</tal:block></a>
26        </li>
27    </ul>
28    <ul tal:condition="d/canPublish">
29        <li>
30            <a href="" tal:attributes="href string:$here_url/lemill_ask_publish"><tal:block i18n:domain="plone" i18n:translate="Publish">Publish</tal:block>...</a>
31        </li>
32    </ul>
33    <ul tal:condition="d/canUndelete">
34        <li><a i18n:translate="label_restore_or_undelete" href="" tal:attributes="href string:${here_url}/rescue">Restore deleted</a></li>
35        <li tal:condition="d/canManage"><a i18n:translate="label_move_to_trash" href="" tal:attributes="href string:${here_url}/permaDelete" class="deleteLinkColor">Move to trash</a></li>
36    </ul>
37</div>
38</tal:coverImage>
39
40
41Used by:
42All Resources
43Uses:
44mainView, editLink, hasAbout, discussionLink, lenDiscussion, canConvert, aboutView, versionView
45
46<tal:edit_div metal:define-macro="editDiv">
47<div class="tb-portlet" tal:condition="d/mainView">
48    <ul>
49        <li>
50            <a href="" i18n:domain="plone" tal:attributes="href d/editLink"><tal:block i18n:translate="label_edit">Edit</tal:block>...</a>
51        </li>
52        <li tal:condition="d/hasAbout">
53            <a href="" i18n:translate="label_view_about" tal:attributes="href string:${here_url}/about_view">About</a>
54        </li>
55        <li><a href="" i18n:translate="label_view_history" tal:attributes="href string:${here_url}/history_view">History</a></li>
56        <li tal:condition="d/discussionLink"><a href="" i18n:translate="label_discussion" tal:attributes="href d/discussionLink">Discussion</a><span tal:condition="d/lenDiscussion"> (<span tal:content="d/lenDiscussion" />)</span></li>
57        <li metal:define-macro="delete_action" tal:condition="d/canModerate">
58           <a href="" i18n:domain="plone" tal:attributes="href string:${here_url}/delete" class="deleteLinkColor"><tal:block i18n:translate="Delete">Delete</tal:block>...</a>
59        </li>
60        <li tal:condition="d/canConvert">
61           <a href="" tal:attributes="href string:${here_url}/manage_convert" class="deleteLinkColor"><tal:block>Convert resource</tal:block>...</a>
62        </li>
63    </ul>
64</div>
65<div class="tb-portlet" tal:condition="d/aboutView">
66    <ul>
67      <li><a href="" tal:attributes="href d/editMetadataLink"><tal:block i18n:translate="label_edit_about">Edit about</tal:block>...</a></li>
68    </ul>
69</div>
70<div class="tb-portlet" tal:condition="d/versionView">
71    <ul>
72        <li><a href="" i18n:translate="label_restore_this_version"  tal:attributes="href string:${here_url}/restoreAVersion?timestamp=${d/versionView}">Restore this version</a></li>
73    </ul>
74</div>
75</tal:edit_div>
76
77Used by:
78Piece
79Uses:
80mainView
81
82<tal:source_file_div metal:define-macro="sourceFileDiv">
83<div tal:condition="python:context.canIEditSource()" >
84    <div class="tb-portlet" tal:condition="d/mainView">
85        <span id="deltext" i18n:translate="source_file_delete_confirmation" style="display:none">Are you sure you want to delete source file?</span>
86        <ul>
87            <li tal:condition="not: context/getSourceFile">
88                <a href="" tal:attributes="href string:${here_url}/source_file_add">
89                    <tal:block i18n:translate="label_add_source_file">Add source file</tal:block>...</a>
90            </li>
91            <li tal:condition="context/getSourceFile">
92                <a href="" class="deleteLinkColor" tal:attributes="href string:${here_url}/delete_source; onclick python:'return delItem(\'deltext\');;'"><tal:block i18n:translate="label_delete_source_file">Delete source file</tal:block>...</a>
93            </li>
94        </ul>
95    </div>   
96</div>
97</tal:source_file_div>
98
99Used by:
100All Resources
101Uses:
102showCollections, lenCollections
103
104<tal:collections_div metal:define-macro="collectionsDiv">
105<div class="tb-portlet" tal:condition="d/showCollections">
106    <ul>
107        <li tal:condition="not:isAnon"><a href="" tal:attributes="href string:${here_url}/collection_add"><tal:block i18n:translate="label_add_to_collection">Add to collection</tal:block>...</a></li>
108        <li tal:condition="d/lenCollections">
109            <a href=""  i18n:translate="label_view_collections"
110                tal:attributes="href string:${here_url}/collections_list">
111                View collections</a> (<span tal:replace="d/lenCollections" />)
112        </li>
113    </ul>
114</div>
115</tal:collections_div>
116
117Used by:
118Materials
119Uses:
120showBranches, branches, original
121
122<tal:branch_div metal:define-macro="branchesDiv">
123<div class="tb-portlet" tal:condition="d/showBranches">
124    <ul>
125        <tal:branch repeat="resource d/branches">
126        <li>
127          <a href="" tal:attributes="href resource"><tal:version i18n:translate="label_copy_version">Version <tal:number i18n:name="number" tal:content="repeat/resource/number">1</tal:number></tal:version></a>
128        </li>
129        </tal:branch>
130        <li tal:condition="d/original">
131          <a href="" tal:attributes="href d/original" i18n:translate="link_copy_original">Original</a>
132        </li>
133    </ul>
134</div>
135</tal:branch_div>
136
137Used by:
138Resources, except pieces
139Uses:
140showTranslations, translations, canManage,
141
142<tal:translate_div metal:define-macro="translationsDiv">
143<div class="tb-portlet" tal:condition="d/showTranslations">
144    <ul>
145        <li><a href="" tal:attributes="href d/translateLink"><tal:block i18n:translate="label_translate">Translate</tal:block>...</a></li>
146        <tal:trans repeat="resource d/translations">
147           <li tal:condition="not:resource/isThis">
148             <a href="" tal:content="resource/languageName | nothing" tal:attributes="href resource/url | nothing" />
149           </li>
150           <li tal:condition="resource/isThis" tal:content="resource/languageName" />
151        </tal:trans>
152        <li tal:condition="d/canManage"><a href="" tal:attributes="href python:'%s/manage_translations' % here_url">Manage translations</a></li>
153    </ul>
154</div>
155</tal:translate_div>
156
157Used by:
158Materials
159Uses:
160hasViews, studentViewLink, slideShowLink
161
162<tal:views_div metal:define-macro="viewsDiv">
163<div class="tb-portlet" tal:condition="d/hasViews">
164    <ul>
165        <li tal:condition="d/studentViewLink"><a i18n:translate="label_student_view" tal:attributes="href d/studentViewLink">Student view</a></li>
166        <li tal:condition="d/slideShowLink"><a i18n:translate="label_slideshow" href="" tal:attributes="href d/slideShowLink">Slideshow</a>
167        </li>
168    </ul>
169</div>
170</tal:views_div>
171
172Used by: PILOTs
173Uses: embedCode
174
175<tal:embed_div metal:define-macro="embedDiv">
176<div class="tb-portlet" tal:condition="d/embedCode">
177    <ul style="list-style:none">
178        <li>
179            <div i18n:translate="embed_to_your_blog">Embed to your blog</div>
180            <input id="embed_code" type="text" tal:attributes="value d/embedCode" onclick="javascript:document.getElementById('embed_code').focus();document.getElementById('embed_code').select();"/>
181        </li>
182    </ul>
183</div>
184</tal:embed_div>
185
186Materials:
187hasViews, studentViewLink, slideShowLink
188showBranches, branches, original
189
190Resources:
191showTranslations, translations, canManage,
192showCollections, lenCollections
193mainView, editLink, hasAbout, discussionLink, lenDiscussion, canConvert, aboutView, versionView
194subView, canChangeCoverImage, canRetract, canPublish, canUndelete, canManage, embedCode
195
196
197************ Groups ***************
198
199Uses:
200canChangeCoverImage, mainView
201
202<tal:group_cover_image metal:define-macro="groupCoverImageDiv">
203<div class="tb-portlet">
204    <p style="text-align: center;">
205      <img src="images/default_groupblog.png" tal:attributes="src here/getCoverImageURL; alt python:here.meta_type" style="padding: 39px 0px 29px 0px;" tal:condition="d/mainView" />     
206      <a href="" tal:attributes="href here/absolute_url" tal:condition="not:d/mainView"><img src="images/default_groupblog.png" tal:attributes="src here/getCoverImageURL; alt python:here.meta_type" style="padding: 39px 0px 29px 0px;" /></a>     
207    </p>
208    <ul tal:condition="d/canChangeCoverImage">
209        <li>
210            <a  href="" tal:attributes="href string:${here_url}/change_coverimage"><tal:block i18n:translate="label_change_cover_image">Change cover image</tal:block>...</a>
211        </li>
212    </ul>
213</div>
214</tal:group_cover_image>
215
216Uses:
217mainView, manageGroup, joinGroup, leaveGroup
218
219<tal:group_edit_div metal:define-macro="groupEditDiv">
220<div class="tb-portlet" tal:condition="d/mainView">
221    <div class="portlet-title">
222    <img src="transparent.png" tal:attributes="src string:${portal_url}/transparent.png" alt="" class="smallicon" />
223    <tal:block i18n:domain="plone" i18n:translate="heading_actions">Actions</tal:block>
224    </div>
225    <ul>
226        <li tal:condition="d/manageGroup"><a i18n:translate="label_manage_members" href="edit">Manage group</a></li>
227        <li tal:condition="d/joinGroup"><a href="#" i18n:translate="label_join_group" tal:attributes="href string:${d/joinGroup}">Join this group</a></li>
228        <li tal:condition="d/leaveGroup"><a href="leave_group" i18n:translate="label_leave_group">Leave group</a></li>
229    </ul>
230</div>
231</tal:group_edit_div>
232
233Uses:
234groupMembers
235<tal:group_members_div metal:define-macro="groupMembersDiv">
236<div class="tb-portlet" tal:condition="d/groupMembers">
237    <div class="portlet-title">
238    <img src="transparent.png" tal:attributes="src string:${portal_url}/transparent.png" alt="" class="smallicon" />
239    <tal:block i18n:translate="heading_members">Members</tal:block>
240    </div>
241
242    <ul>
243     <tal:loop repeat="memberdata d/groupMembers">
244        <li tal:define="membername python:memberdata[0];
245            member_url python:memberdata[1];">
246            <a href="#" tal:attributes="href member_url" tal:content="membername">PLACEHOLDER</a>
247        </li>
248     </tal:loop><a href="#" class="show_less" i18n:translate="show_less">Show less</a>
249     <a href="#" class="show_more" i18n:translate="show_more">Show more (<span i18n:name="n" tal:replace="python:len(d['groupMembers'])" />)</a>
250    </ul>
251</div>
252</tal:group_members_div>
253
254Uses:
255groupResources
256<tal:group_resources_div metal:define-macro="groupResourcesDiv">
257<div class="tb-portlet" tal:define="amounts_dict d/groupResources">
258    <div class="portlet-title">
259        <img src="transparent.png" tal:attributes="src string:${portal_url}/transparent.png" alt="" class="smallicon" />
260        <tal:block i18n:translate="heading_groups_resources">Group's resources</tal:block>
261    </div>
262    <ul>
263        <li>
264            <a i18n:translate="" href="portfolio?type=resource">Content</a>
265        (<span tal:replace="amounts_dict/Content" />)</li>
266        <li>
267            <a i18n:translate="" href="portfolio?type=Activity">Methods</a>
268        (<span tal:replace="amounts_dict/Activities" />)
269        </li>
270        <li>
271            <a i18n:translate="" href="portfolio?type=Tool">Tools</a>
272        (<span tal:replace="amounts_dict/Tools" />)
273        </li>
274
275        <li>
276            <a i18n:translate="label_tag_cloud" href="portfolio">Tag cloud</a>
277        </li>
278    </ul>
279</div>
280</tal:group_resources_div>
281
282************ Posts ***************
283Uses:
284groupURL
285
286<tal:post_cover_image metal:define-macro="postCoverImageDiv">
287<div class="tb-portlet">
288    <p style="text-align: center;" tal:condition="d/groupURL">
289     <a href="" tal:attributes="href d/groupURL">
290      <img src="images/default_groupblog.png" tal:attributes="src d/groupCoverImageURL; alt d/groupTitle" style="padding: 39px 0px 29px 0px;" />
291     </a>
292    </p>
293</div>
294</tal:post_cover_image>
295
296
297Uses:
298editPost, deletePost, undeletePost
299
300<tal:post_edit_div metal:define-macro="postEditDiv">
301<div class="tb-portlet" tal:condition="context/canIEdit">
302    <div class="portlet-title">
303    <img src="transparent.png" tal:attributes="src string:${portal_url}/transparent.png" alt="" class="smallicon" />
304    <tal:block i18n:domain="plone" i18n:translate="heading_actions">Actions</tal:block>
305    </div>
306    <ul>
307        <li tal:condition="d/editPost">
308           <a href="edit" tal:attributes="href string:${here_url}/edit" i18n:translate="label_edit_topic">Edit this topic</a>
309        </li>       
310        <li tal:condition="d/deletePost">
311           <a href="delete_post" tal:attributes="href string:${here_url}/delete_post" i18n:translate="label_delete_topic">Delete this topic</a>
312        </li>
313        <li tal:condition="d/undeletePost">
314           <a href="undelete_post" tal:attributes="href string:${here_url}/undelete_post" i18n:translate="label_undelete_topic">Undelete topic</a>
315        </li>
316    </ul>
317</div>
318</tal:post_edit_div>
319
320************** MemberFolders *************
321
322Uses:
323memberImageURL, subView, memberURL
324
325<tal:mf_cover_image metal:define-macro="memberImageDiv">
326<div class="tb-portlet">
327    <p style="text-align: center;" >
328      <img src="images/default_memberfolder.png" tal:condition="d/mainView" tal:attributes="src d/memberImageURL; alt context/getNicename" style="padding: 39px 0px 29px 0px;" />
329     <a href="" tal:condition="d/subView" tal:attributes="href d/memberURL">
330      <img src="images/default_memberfolder.png" tal:attributes="src d/memberImageURL; alt context/getNicename" style="padding: 39px 0px 29px 0px;" />
331     </a>
332    </p>
333</div>
334</tal:mf_cover_image>
335
336Uses:
337contactControls, inviteToGroup, addContact, removeContact
338
339<tal:mf_contact_control metal:define-macro="memberContactControl">
340<div class="tb-portlet" tal:condition="d/contactControls">
341    <ul>
342        <li tal:condition="d/inviteToGroup">
343            <a href="group_invite" i18n:translate="link_invite_to_group">Invite to group</a>
344        </li>
345        <li tal:condition="d/addContact">
346            <a href="script_contact_add" i18n:translate="add_as_contact">Add as contact</a>
347        </li>
348        <li tal:condition="d/removeContact">
349            <a href="script_contact_remove" i18n:translate="remove_from_contacts">Remove from contacts</a>           
350        </li>
351    </ul>
352</div>
353</tal:mf_contact_control>
354
355
356</body>
357</html>
358
Note: See TracBrowser for help on using the repository browser.