source: trunk/skins/lemill/portlet_groupblog_actions.pt @ 1919

Revision 1919, 4.4 KB checked in by jukka, 12 years ago (diff)

Refactored groups to not use portal_groups. Things should be faster and users from weird sources shouldn't cause so much problems. Not much tested yet, but archetype update and quickinstaller reinstall works fine.

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<div metal:define-macro="portlet" id="portlet-groupblog-actions"
6    tal:define="blogobj here/getBlog;
7        blogurl blogobj/absolute_url;
8        blogtitle blogobj/title;       
9        isMember python:here.isMember(member.id);
10        isManager python:here.amIManager();
11        canModerate python:here.canIModerate() or isManager;
12        isPost here/isPost | nothing;
13        isAuthor python:isPost and member.id==here.Creator();">
14
15<div class="tb-portlet" metal:define-macro="image_div">
16    <p style="text-align: center"><a href="#" tal:attributes="href string:$blogurl">
17        <img src="default.png" tal:attributes="src blogobj/getCoverImageURL; alt python:here.meta_type" style="padding: 39px 0px 29px 0px;"/>
18    </a></p>
19    <ul tal:condition="isMember">
20        <li><a href="" i18n:translate="label_change_cover_image" tal:attributes="href string:$blogurl/change_coverimage">Change cover image</a></li>
21    </ul>
22</div>
23
24<div class="tb-portlet">
25    <div class="portlet-title">
26    <img src="transparent.png" alt="" class="smallicon" />
27    <tal:block i18n:domain="plone" i18n:translate="heading_actions">Actions</tal:block>
28    </div>
29    <ul tal:condition="isMember">       
30       
31        <li tal:condition="python: (isAuthor or isManager) and isPost">
32           <a href="" i18n:translate="label_edit_topic" tal:attributes="href string:${here_url}/edit">Edit this topic</a>
33        </li>       
34        <li tal:condition="python: (isAuthor or canModerate) and isPost and wf_state!='deleted'">
35           <a href="" i18n:translate="label_delete_topic" tal:attributes="href string:${here_url}/delete_post">Delete this topic</a>
36        </li>
37        <li tal:condition="python: (isAuthor or canModerate) and isPost and wf_state=='deleted'" >
38           <a href="" i18n:translate="label_undelete_topic" tal:attributes="href string:${here_url}/undelete_post">Undelete topic</a>
39        </li>
40        <li tal:condition="isMember"><a i18n:translate="label_manage_members" href="" tal:attributes="href string:$blogurl/edit">Manage group</a></li>
41        <li><a href="" i18n:translate="label_leave_group" tal:attributes="href string:$blogurl/leave_group">Leave group</a></li>
42    </ul>
43    <ul tal:condition="python: not isMember and not isAnon">
44        <li><a href="#" i18n:translate="label_join_group" tal:attributes="href string:$blogurl/join_group">Join this group</a></li>
45    </ul>
46    <ul tal:condition="isAnon">
47        <li><a href="#" i18n:translate="label_join_group" tal:attributes="href string:$blogurl/join_form">Join this group</a></li>
48    </ul>
49</div>
50
51<div class="tb-portlet" metal:define-macro="group_members">
52    <div class="portlet-title">
53    <img src="transparent.png" alt="" class="smallicon" />
54    <tal:block i18n:translate="heading_members">Members</tal:block>
55    </div>
56
57    <ul tal:define="groupmembers blogobj/getGroupMembersNamesAndUrls;
58        n_mem python:len(groupmembers)">
59        <tal:listing condition="python: n_mem&lt;400" repeat="memberdata groupmembers">
60             <li tal:define="membername python:memberdata[0];
61                 member_url python:memberdata[1];">
62                 <a href="#" tal:attributes="href member_url" tal:content="membername">PLACEHOLDER</a>
63             </li>
64        </tal:listing>
65        <tal:toomuch condition="python: n_mem>399">
66             <li>
67                 <a href="#" i18n:translate="label_n_members_in_group" tal:attributes="href list_members"><tal:block i18n:name="amount" tal:replace="n_mem"/>members in this group</a>
68             </li>
69        </tal:toomuch>
70    </ul>
71</div>
72
73<div class="tb-portlet" tal:define="
74    resources_n python:blogobj.getGroupMaterials(n=True);
75    ">
76    <div class="portlet-title">
77        <img src="transparent.png" alt="" class="smallicon" />
78        <tal:block i18n:translate="heading_groups_resources">Group's resources</tal:block>
79    </div>
80
81    <ul>
82        <li>
83            <a i18n:translate="" href="portfolio" tal:attributes="href python:'portfolio?getRawGroupEditing=%s&amp;portal_type=resource' % blogobj.UID()">Content</a>
84        (<span tal:replace="resources_n" />)
85        </li>
86        <li>
87        <a i18n:translate="label_tag_cloud" href="portfolio" tal:attributes="href python:'portfolio?getRawGroupEditing=%s' % blogobj.UID()">Tag cloud</a>
88        </li>
89
90       
91    </ul>
92</div>
93
94
95
96</div>
97</body>
98</html>
99
100
Note: See TracBrowser for help on using the repository browser.