Changeset 128
- Timestamp:
- 12/28/05 05:02:42
- Files:
-
- qPloneComments/trunk/Extensions/utils.py (modified) (3 diffs)
- qPloneComments/trunk/__init__.py (modified) (2 diffs)
- qPloneComments/trunk/skins/qplonecomments/discussion_publish_comment.py (modified) (1 diff)
- qPloneComments/trunk/skins/qplonecomments/discussionitem_view.pt (modified) (3 diffs)
- qPloneComments/trunk/skins/qplonecomments/ifModerate.py (added)
- qPloneComments/trunk/skins/qplonecomments/qPloneComments_config.cpt (modified) (2 diffs)
- qPloneComments/trunk/skins/qplonecomments/qPloneComments_config_script.cpy (modified) (1 diff)
- qPloneComments/trunk/skins/qplonecomments/qPloneComments_configlist.cpt (deleted)
- qPloneComments/trunk/skins/qplonecomments/viewThreadsAtBottom.pt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneComments/trunk/Extensions/utils.py
r127 r128 6 6 result = marker 7 7 pp = getToolByName(self, 'portal_properties') 8 config_ps = getattr(pp, PROPERTY_SHEET )8 config_ps = getattr(pp, PROPERTY_SHEET, None) 9 9 if config_ps: 10 10 result = getattr(config_ps, prop_name, marker) … … 14 14 # Checking is discussion item published 15 15 def isPublished(self): 16 16 from zLOG import LOG 17 LOG('qPloneComments.utils',777,'isPublished','isPublished was called on %s context' % str(self.getId()) ) 18 17 19 roles = self.permission_settings() 18 20 roles = [r for r in roles if r['name']=='View'] … … 64 66 mh.send(body) 65 67 68 def publishDiscussion(self): 69 roles = ['Anonymous'] 70 self.manage_permission('View', roles, acquire=1) 71 72 qPloneComments/trunk/__init__.py
r127 r128 7 7 8 8 from config import * 9 from Extensions.utils import * 9 10 10 11 registerDirectory('skins', SKIN_GLOBALS) … … 39 40 self._container[ id ] = item 40 41 41 roles = ['Manager', 'Owner', 'Reviewer'] 42 item.manage_permission('View', roles, acquire=0) 43 44 ################################################# 45 from zLOG import LOG 46 roles = item.permission_settings() 47 roles = [r for r in roles if r['name']=='View'][0] 48 roles_view = roles['roles'] 49 acquire = roles['acquire'] 50 LOG('qPloneComments',777,'createReply','roles = %s' % str(roles) ) 51 LOG('qPloneComments',777,'createReply','view_roles=%s' % (str(roles_view)) ) 52 LOG('qPloneComments',777,'createReply','acquire=%s' % (str(acquire)) ) 53 54 ################################################# 55 #item.manage_permission('Access contents information', roles, acquire=0) 42 # Control of performing moderation 43 ifModerate = getProp(self, "Turning_on/off_Moderation", marker=False) 44 if ifModerate: 45 from zLOG import LOG 46 LOG('qPloneComments',777,'createReply','ifModerate=%s \t that''s why Moderation was called' % str(ifModerate) ) 47 roles = ['Manager', 'Owner', 'Reviewer'] 48 item.manage_permission('View', roles, acquire=0) 56 49 57 50 return id qPloneComments/trunk/skins/qplonecomments/discussion_publish_comment.py
r127 r128 9 9 ## 10 10 from Products.CMFPlone import transaction_note 11 from Products.qPloneComments.Extensions.utils import publishDiscussion 11 12 12 req = context.REQUEST 13 14 roles = ['Anonymous'] 15 context.manage_permission('View', roles, acquire=1) 13 # Publish discussion item 14 publishDiscussion(context) 16 15 17 16 transaction_note('Published discussion item') 18 17 target = '%s/%s' % (context.absolute_url(), context.getTypeInfo().getActionById('view') ) 19 18 20 return req.RESPONSE.redirect(target)19 return context.REQUEST.RESPONSE.redirect(target) qPloneComments/trunk/skins/qplonecomments/discussionitem_view.pt
r127 r128 21 21 tal:define="userHasReviewPermission python:checkPermission('Review portal content', here); 22 22 isPublished here/isDIPublished; 23 ">23 ifModerate here/ifModerate;"> 24 24 25 25 <h2> … … 29 29 30 30 <div class="documentByLine"> 31 <span tal:content="python:test(isPublished, 'Published', 'Not Published')"> Pablish state </span> 31 <span tal:content="python:test(isPublished, 'Published', 'Not Published')" 32 tal:condition="ifModerate"> Publish state </span> 32 33 <span i18n:translate="posted_by">Posted by</span> 33 34 <span tal:content="here/Creator">Poster Name</span> … … 71 72 </form> 72 73 74 <div class="documentByLine" 75 tal:condition="not:isPublished">Until publishing this comment adding reply impossible.</div> 76 73 77 </div> 74 78 qPloneComments/trunk/skins/qplonecomments/qPloneComments_config.cpt
r127 r128 11 11 <div metal:define-macro="main" i18n:domain="plone"> 12 12 13 <h1 class="documentFirstHeading"> 14 <img tal:replace="structure here/product_icon.gif" /> 15 <span tal:replace="here/title_or_id">Title or id</span> 16 </h1> 17 18 <div metal:use-macro="here/document_actions/macros/document_actions"> 19 Document actions (print, sendto etc) 20 </div> 13 <h1 i18n:translate="qplonecomments_configuration">qPloneComments Configuration</h1> 21 14 22 15 <a href="" 23 16 class="link-parent" 24 i18n:translate="label_up_to_product_page" 25 tal:define="parent_url python:here.navigationParent(here, template.getId())" 26 tal:condition="parent_url" 27 tal:attributes="href parent_url"> 28 Up to Product page 17 tal:attributes="href string: $portal_url/plone_control_panel" 18 i18n:translate="label_up_to_plone_setup"> 19 Up to Plone Setup 29 20 </a> 30 31 <div class="documentDescription"32 tal:content="here/Description">33 description34 </div>35 36 <h2 i18n:translate="heading_qplonecomments">37 qPloneComments configuration38 </h2>39 21 40 22 <form name="edit_form" … … 48 30 49 31 <fieldset> 32 <legend i18n:translate="legend_mailhost_details">qPloneComments configuration Details</legend> 50 33 <table cellspacing="4" cellpadding="4" border="0" 51 34 tal:define ="props_map python:props_sheet.propertyMap();" qPloneComments/trunk/skins/qplonecomments/qPloneComments_config_script.cpy
r127 r128 19 19 for id,type in property_maps: 20 20 if type == 'boolean': 21 # For boolean type in REQUEST present ONLY CHECKED fields 22 # PECULIARITY: when field uncheck - it disappear from the REQUEST 21 23 if id in request_ids: 22 24 kw[id] = True qPloneComments/trunk/skins/qplonecomments/viewThreadsAtBottom.pt
r127 r128 50 50 51 51 <div class="comment" 52 tal:define="isPublished reply/isDIPublished ">53 52 tal:define="isPublished reply/isDIPublished; 53 ifModerate here/ifModerate"> 54 54 <h3> 55 55 <tal:block replace="structure portal/discussionitem_icon.gif"/> … … 59 59 <div class="documentByLine" 60 60 tal:define="anonymous_creator python:reply.Creator()=='Anonymous User'"> 61 <span tal:content="python:test(isPublished, 'Published', 'Not Published')"> Pablish state </span> 61 <span tal:content="python:test(isPublished, 'Published', 'Not Published')" 62 tal:condition="ifModerate"> Publish state </span> 62 63 <span i18n:translate="label_comment_by">Posted by</span> 63 64 <span tal:content="reply/Creator" … … 80 81 style="display: inline;" 81 82 tal:attributes="action string:${reply/absolute_url}/discussion_reply_form" 82 tal:condition="python:checkPermission('Reply to item', reply) ">83 tal:condition="python:checkPermission('Reply to item', reply) and isPublished"> 83 84 84 85 <input class="standalone" … … 116 117 /> 117 118 </form> 119 120 <div class="documentByLine" 121 tal:condition="not:isPublished">Until publishing this comment adding reply impossible.</div> 118 122 119 123 <div tal:define="replies python:here.getReplyReplies(reply)"
