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

Revision 3052, 15.3 KB checked in by jukka, 9 years ago (diff)

Removed some of the unused templates, community and portfolio related pages are still there. All kinds of work done towards LeMill 3.

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="portlet grid">
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="portlet grid" 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="portlet grid" 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="portlet grid" 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="portlet grid" 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 Content:
101Uses tags
102
103<tal:tags_div metal:define-macro="tagsDiv">
104    <div class="portlet grid" tal:define="url_base python:context.getSectionFolder(bottom=True).absolute_url()">
105        <ul>
106           <tal:loopy repeat="tag d/tags"><a href="" tal:attributes="href python:url_base+'/tags?tag='+tag" tal:content="tag" /><span tal:condition="not:repeat/tag/end" tal:omit-tag="">, </span></tal:loopy>
107           <span tal:condition="not:d/tags"><span i18n:translate="no_tags">No tags</span> <a href="javascript:void(0)" tal:condition="d/canEdit" i18n:translate="add" onclick="$('div#tagform').toggle('fast');$('input#tags').focus();" >(add)</a>
108           <div id="tagform" style="display:none"><form tal:attributes="action string:${here_url}/updateTags" id="tagsUpdater" method="post">
109           <input name="tags" id="tags" type="text" width="20" /><br/>
110           <span class="discreet" i18n:translate="help_tags_separation">Please separate tags with ','</span></form></div></span>
111        </ul>
112       
113    </div>   
114</tal:tags_div>
115
116
117Used by:
118All Resources
119Uses:
120showCollections, lenCollections
121
122<tal:collections_div metal:define-macro="collectionsDiv">
123<div class="portlet grid" tal:condition="d/showCollections">
124    <ul>
125        <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>
126        <li tal:condition="d/lenCollections">
127            <a href=""  i18n:translate="label_view_collections"
128                tal:attributes="href string:${here_url}/collections_list">
129                View collections</a> (<span tal:replace="d/lenCollections" />)
130        </li>
131    </ul>
132</div>
133</tal:collections_div>
134
135Used by:
136Materials
137Uses:
138showBranches, branches, original
139
140<tal:branch_div metal:define-macro="branchesDiv">
141<div class="portlet grid" tal:condition="d/showBranches">
142    <ul>
143        <tal:branch repeat="resource d/branches">
144        <li>
145          <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>
146        </li>
147        </tal:branch>
148        <li tal:condition="d/original">
149          <a href="" tal:attributes="href d/original" i18n:translate="link_copy_original">Original</a>
150        </li>
151    </ul>
152</div>
153</tal:branch_div>
154
155Used by:
156Resources, except pieces
157Uses:
158showTranslations, translations, canManage,
159
160<tal:translate_div metal:define-macro="translationsDiv">
161<div class="portlet grid" tal:condition="d/showTranslations">
162    <ul>
163        <li><a href="" tal:attributes="href d/translateLink"><tal:block i18n:translate="label_translate">Translate</tal:block>...</a></li>
164        <tal:trans repeat="resource d/translations">
165           <li tal:condition="not:resource/isThis">
166             <a href="" tal:content="resource/languageName | nothing" tal:attributes="href resource/url | nothing" />
167           </li>
168           <li tal:condition="resource/isThis" tal:content="resource/languageName" />
169        </tal:trans>
170        <li tal:condition="d/canManage"><a href="" tal:attributes="href python:'%s/manage_translations' % here_url">Manage translations</a></li>
171    </ul>
172</div>
173</tal:translate_div>
174
175Used by:
176Materials
177Uses:
178hasViews, studentViewLink, slideShowLink
179
180<tal:views_div metal:define-macro="viewsDiv">
181<div class="portlet grid" tal:condition="d/hasViews">
182    <ul>
183        <li tal:condition="d/studentViewLink"><a i18n:translate="label_student_view" tal:attributes="href d/studentViewLink">Student view</a></li>
184        <li tal:condition="d/slideShowLink"><a i18n:translate="label_slideshow" href="" tal:attributes="href d/slideShowLink">Slideshow</a>
185        </li>
186    </ul>
187</div>
188</tal:views_div>
189
190Used by: PILOTs
191Uses: embedCode
192
193<tal:embed_div metal:define-macro="embedDiv">
194<div class="portlet grid" tal:condition="d/embedCode">
195    <ul style="list-style:none">
196        <li>
197            <div i18n:translate="embed_to_your_blog">Embed to your blog</div>
198            <input id="embed_code" type="text" tal:attributes="value d/embedCode" onclick="javascript:document.getElementById('embed_code').focus();document.getElementById('embed_code').select();"/>
199        </li>
200    </ul>
201</div>
202</tal:embed_div>
203
204Materials:
205hasViews, studentViewLink, slideShowLink
206showBranches, branches, original
207
208Resources:
209showTranslations, translations, canManage,
210showCollections, lenCollections
211mainView, editLink, hasAbout, discussionLink, lenDiscussion, canConvert, aboutView, versionView
212subView, canChangeCoverImage, canRetract, canPublish, canUndelete, canManage, embedCode
213
214
215************ Groups ***************
216
217Uses:
218canChangeCoverImage, mainView
219
220<tal:group_cover_image metal:define-macro="groupCoverImageDiv">
221<div class="portlet grid">
222    <p style="text-align: center;">
223      <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" />     
224      <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>     
225    </p>
226    <ul tal:condition="d/canChangeCoverImage">
227        <li>
228            <a  href="" tal:attributes="href string:${here_url}/change_coverimage"><tal:block i18n:translate="label_change_cover_image">Change cover image</tal:block>...</a>
229        </li>
230    </ul>
231</div>
232</tal:group_cover_image>
233
234Uses:
235mainView, manageGroup, joinGroup, leaveGroup
236
237<tal:group_edit_div metal:define-macro="groupEditDiv">
238<div class="portlet grid" tal:condition="d/mainView">
239    <div class="portlet-title" i18n:domain="plone" i18n:translate="heading_actions">Actions</div>
240    <ul>
241        <li tal:condition="d/manageGroup"><a i18n:translate="label_manage_members" href="edit">Manage group</a></li>
242        <li tal:condition="d/joinGroup"><a href="#" i18n:translate="label_join_group" tal:attributes="href string:${d/joinGroup}">Join this group</a></li>
243        <li tal:condition="d/leaveGroup"><a href="leave_group" i18n:translate="label_leave_group">Leave group</a></li>
244    </ul>
245</div>
246</tal:group_edit_div>
247
248Uses:
249groupMembers
250<tal:group_members_div metal:define-macro="groupMembersDiv">
251<div class="portlet grid" tal:condition="d/groupMembers">
252    <div class="portlet-title" i18n:translate="heading_members">Members</div>
253    <ul>
254     <tal:loop repeat="memberdata d/groupMembers">
255        <li tal:define="membername python:memberdata[0];
256            member_url python:memberdata[1];">
257            <a href="#" tal:attributes="href member_url" tal:content="membername">PLACEHOLDER</a>
258        </li>
259     </tal:loop><a href="#" class="show_less" i18n:translate="show_less">Show less</a>
260     <a href="#" class="show_more" i18n:translate="show_more">Show more (<span i18n:name="n" tal:replace="python:len(d['groupMembers'])" />)</a>
261    </ul>
262</div>
263</tal:group_members_div>
264
265Uses:
266groupResources
267<tal:group_resources_div metal:define-macro="groupResourcesDiv">
268<div class="portlet grid" tal:define="amounts_dict d/groupResources">
269    <div class="portlet-title" i18n:translate="heading_groups_resources">Group's resources</div>
270    <ul>
271        <li>
272            <a i18n:translate="" href="portfolio?type=resource">Content</a>
273        (<span tal:replace="amounts_dict/Content" />)</li>
274        <li>
275            <a i18n:translate="" href="portfolio?type=Activity">Methods</a>
276        (<span tal:replace="amounts_dict/Activities" />)
277        </li>
278        <li>
279            <a i18n:translate="" href="portfolio?type=Tool">Tools</a>
280        (<span tal:replace="amounts_dict/Tools" />)
281        </li>
282
283        <li>
284            <a i18n:translate="label_tag_cloud" href="portfolio">Tag cloud</a>
285        </li>
286    </ul>
287</div>
288</tal:group_resources_div>
289
290************ Posts ***************
291Uses:
292groupURL
293
294<tal:post_cover_image metal:define-macro="postCoverImageDiv">
295<div class="portlet grid">
296    <p style="text-align: center;" tal:condition="d/groupURL">
297     <a href="" tal:attributes="href d/groupURL">
298      <img src="images/default_groupblog.png" tal:attributes="src d/groupCoverImageURL; alt d/groupTitle" style="padding: 39px 0px 29px 0px;" />
299     </a>
300    </p>
301</div>
302</tal:post_cover_image>
303
304
305Uses:
306editPost, deletePost, undeletePost
307
308<tal:post_edit_div metal:define-macro="postEditDiv">
309<div class="portlet grid" tal:condition="context/canIEdit">
310    <div class="portlet-title" i18n:domain="plone" i18n:translate="heading_actions">Actions</div>
311    <ul>
312        <li tal:condition="d/editPost">
313           <a href="edit" tal:attributes="href string:${here_url}/edit" i18n:translate="label_edit_topic">Edit this topic</a>
314        </li>       
315        <li tal:condition="d/deletePost">
316           <a href="delete_post" tal:attributes="href string:${here_url}/delete_post" i18n:translate="label_delete_topic">Delete this topic</a>
317        </li>
318        <li tal:condition="d/undeletePost">
319           <a href="undelete_post" tal:attributes="href string:${here_url}/undelete_post" i18n:translate="label_undelete_topic">Undelete topic</a>
320        </li>
321    </ul>
322</div>
323</tal:post_edit_div>
324
325************** MemberFolders *************
326
327Uses:
328memberImageURL, subView, memberURL
329
330<tal:mf_cover_image metal:define-macro="memberImageDiv">
331<div class="portlet grid">
332    <p style="text-align: center;" >
333      <img src="images/default_memberfolder.png" tal:condition="d/mainView" tal:attributes="src d/memberImageURL; alt context/getNicename" style="padding: 39px 0px 29px 0px;" />
334     <a href="" tal:condition="d/subView" tal:attributes="href d/memberURL">
335      <img src="images/default_memberfolder.png" tal:attributes="src d/memberImageURL; alt context/getNicename" style="padding: 39px 0px 29px 0px;" />
336     </a>
337    </p>
338</div>
339</tal:mf_cover_image>
340
341Uses:
342contactControls, inviteToGroup, addContact, removeContact
343
344<tal:mf_contact_control metal:define-macro="memberContactControl">
345<div class="portlet grid" tal:condition="d/contactControls">
346    <ul>
347        <li tal:condition="d/inviteToGroup">
348            <a href="group_invite" i18n:translate="link_invite_to_group">Invite to group</a>
349        </li>
350        <li tal:condition="d/addContact">
351            <a href="script_contact_add" i18n:translate="add_as_contact">Add as contact</a>
352        </li>
353        <li tal:condition="d/removeContact">
354            <a href="script_contact_remove" i18n:translate="remove_from_contacts">Remove from contacts</a>           
355        </li>
356    </ul>
357</div>
358</tal:mf_contact_control>
359
360
361</body>
362</html>
363
Note: See TracBrowser for help on using the repository browser.