Ticket #61: qplonecomments.diff

File qplonecomments.diff, 14.5 kB (added by andycat, 16 months ago)

diff neeed as of 26 sept 07 to get recent comments portlet using qPloneComments

  • qPloneComments/browser/__init__.py

    diff -Naur /home/andy/src/qPloneComments/browser/__init__.py qPloneComments/browser/__init__.py
    old new  
     1 
     2# browser package 
  • qPloneComments/browser/configure.zcml

    diff -Naur /home/andy/src/qPloneComments/browser/configure.zcml qPloneComments/browser/configure.zcml
    old new  
     1<configure xmlns="http://namespaces.zope.org/zope" 
     2           xmlns:browser="http://namespaces.zope.org/browser" 
     3           xmlns:five="http://namespaces.zope.org/five"> 
     4 
     5  <browser:page 
     6      for="*" 
     7      name="recent_comment_view" 
     8      class=".portlets.recent_comments.RecentCommentPortlet" 
     9      permission="zope.Public" 
     10      allowed_interface="Products.CMFPlone.browser.interfaces.IRecentPortlet" 
     11      /> 
     12 
     13</configure> 
  • qPloneComments/browser/portlets/__init__.py

    diff -Naur /home/andy/src/qPloneComments/browser/portlets/__init__.py qPloneComments/browser/portlets/__init__.py
    old new  
     1 
  • qPloneComments/browser/portlets/recent_comments.py

    diff -Naur /home/andy/src/qPloneComments/browser/portlets/recent_comments.py qPloneComments/browser/portlets/recent_comments.py
    old new  
     1from Products.CMFPlone.browser.interfaces import IRecentPortlet 
     2from Products.CMFCore.utils import getToolByName 
     3 
     4from zope.interface import implements 
     5from Products.CMFPlone import utils 
     6 
     7 
     8class RecentCommentPortlet(utils.BrowserView): 
     9    implements(IRecentPortlet) 
     10 
     11    def results(self): 
     12        """ """ 
     13        context = utils.context(self) 
     14        putils = getToolByName(context, 'plone_utils') 
     15        portal_catalog = getToolByName(context, 'portal_catalog') 
     16        typesToShow = 'Discussion Item' 
     17        return self.request.get( 
     18            'items', 
     19            portal_catalog.searchResults(sort_on='modified', 
     20                                         portal_type=typesToShow, 
     21                                         sort_order='reverse', 
     22                                         sort_limit=5)[:5]) 
  • qPloneComments/configure.zcml

    diff -Naur /home/andy/src/qPloneComments/configure.zcml qPloneComments/configure.zcml
    old new  
     1<configure xmlns="http://namespaces.zope.org/zope" 
     2           xmlns:browser="http://namespaces.zope.org/browser" 
     3           xmlns:five="http://namespaces.zope.org/five"> 
     4 
     5  <include package=".browser" /> 
     6 
     7</configure> 
  • qPloneComments/skins/qplonecomments/2.5/validate_talkback.vpy

    diff -Naur /home/andy/src/qPloneComments/skins/qplonecomments/2.5/validate_talkback.vpy qPloneComments/skins/qplonecomments/2.5/validate_talkback.vpy
    old new  
    4444        if not (req.form.has_key('Creator') and not req.form['Creator'] == ""): 
    4545            state.setError('Creator', qpcMF(u'Please enter your name.'), 'name_required') 
    4646 
     47from zLOG import LOG, INFO 
     48LOG('validate_talkback',INFO,' state is %s ' % state.getErrors()) 
     49 
     50 
    4751if state.getErrors(): 
    4852    context.plone_utils.addPortalMessage(_(u'Please correct the indicated errors.')) 
    4953    return state.set(status='failure') 
  • qPloneComments/skins/qplonecomments/approve_comment_template.pt

    diff -Naur /home/andy/src/qPloneComments/skins/qplonecomments/approve_comment_template.pt qPloneComments/skins/qplonecomments/approve_comment_template.pt
    old new  
    1010<tal:new_comment define="obj nocall:options/obj"  
    1111       i18n:translate="approvemail_new_comment_link"> 
    1212       Please review new comment added to the following page "<tal:x replace="obj/Title" i18n:name="title"/>": 
    13        <tal:link replace="obj/absolute_url" i18n:name="link"/> 
     13       <tal:link replace="python:obj.absolute_url() + '/view'" i18n:name="link"/> 
    1414</tal:new_comment> 
    1515 
    1616-- 
  • qPloneComments/skins/qplonecomments/notify_comment_template.pt

    diff -Naur /home/andy/src/qPloneComments/skins/qplonecomments/notify_comment_template.pt qPloneComments/skins/qplonecomments/notify_comment_template.pt
    old new  
    1212<tal:x replace="options/name"/>, 
    1313<tal:notify define="obj nocall:options/obj"  
    1414       i18n:translate="notifycomment_link"> 
    15        Your comment on '<tal:x replace="obj/absolute_url" i18n:name="url"/>' has been 
    16 published. To see your comment, go to <tal:x replace="obj/absolute_url" i18n:name="url"/> 
     15       Your comment on '<tal:x replace="python:obj.absolute_url+'/view'" i18n:name="url"/>' has been 
     16published. To see your comment, go to <tal:x replace="python:obj.absolute_url() + '/view'" i18n:name="url"/> 
    1717</tal:notify> 
    1818 
    1919-- 
  • qPloneComments/skins/qplonecomments/portlet_recent_comments.pt

    diff -Naur /home/andy/src/qPloneComments/skins/qplonecomments/portlet_recent_comments.pt qPloneComments/skins/qplonecomments/portlet_recent_comments.pt
    old new  
     1<html xmlns:tal="http://xml.zope.org/namespaces/tal" 
     2      xmlns:metal="http://xml.zope.org/namespaces/metal" 
     3      i18n:domain="plone"> 
     4<body> 
     5<div metal:define-macro="portlet" 
     6     tal:condition="python:template.getId()!='recently_published'"> 
     7 
     8<tal:recentlist tal:define="view context/@@recent_comment_view; 
     9                            results view/results;"> 
     10 
     11<dl class="portlet" id="portlet-recent-comments"> 
     12 
     13    <dt class="portletHeader"> 
     14        <span class="portletTopLeft"></span> 
     15        <a href="#"  
     16            tal:attributes="href string:${portal_url}/recent_comments" 
     17            i18n:translate="box_recent_comments">Recent Comments</a> 
     18        <span class="portletTopRight"></span> 
     19    </dt> 
     20    <tal:items tal:repeat="obj results"> 
     21    <dd class="portletItem" 
     22        tal:define="oddrow repeat/obj/odd; 
     23                    item_wf_state obj/review_state; 
     24                    item_wf_state_class python:'state-' + normalizeString(item_wf_state); 
     25                    item_type_class python: 'visualIcon contenttype-' + normalizeString(obj.portal_type);" 
     26        tal:attributes="class python:test(oddrow, 
     27                                         'portletItem even', 
     28                                         'portletItem odd')"> 
     29        <div tal:attributes="class item_type_class"> 
     30        <a href="" 
     31           tal:attributes="href string:${obj/getURL}/view; 
     32                           title obj/Description; 
     33                           class string:$item_wf_state_class visualIconPadding tile"> 
     34            <tal:title content="obj/pretty_title_or_id"> 
     35            Plone 2.1 released! 
     36            </tal:title> 
     37            <span class="portletItemDetails" 
     38                  tal:content="python:toLocalizedTime(obj.ModificationDate)" 
     39                  >May 5</span> 
     40        </a> 
     41        </div> 
     42    </dd> 
     43    </tal:items> 
     44 
     45    <dd class="portletItem" 
     46        tal:condition="not: results" 
     47        i18n:translate="box_recent_no_comments"> 
     48        No comments yet. 
     49    </dd> 
     50 
     51    <dd class="portletFooter"> 
     52        <a href="#" 
     53           class="tile" 
     54           tal:attributes="href string:${portal_url}/recent_comments" 
     55           i18n:translate="box_more_recently_changed"> 
     56        All recent comments &hellip; 
     57        </a> 
     58        <span class="portletBottomLeft"></span> 
     59        <span class="portletBottomRight"></span> 
     60    </dd> 
     61</dl> 
     62 
     63</tal:recentlist> 
     64 
     65</div> 
     66</body> 
     67</html> 
  • qPloneComments/skins/qplonecomments/published_comment_template.pt

    diff -Naur /home/andy/src/qPloneComments/skins/qplonecomments/published_comment_template.pt qPloneComments/skins/qplonecomments/published_comment_template.pt
    old new  
    99 
    1010<tal:new_comment define="obj nocall:options/obj" i18n:translate="publishedmail_new_comment_link"> 
    1111View new comment added to the following page "<tal:x replace="obj/Title" i18n:name="title"/>": 
    12 <tal:x replace="obj/absolute_url" i18n:name="link"/> 
     12<tal:x replace="python:obj.absolute_url() + '/view'" i18n:name="link"/> 
    1313</tal:new_comment> 
    1414 
    1515-- 
  • qPloneComments/skins/qplonecomments/recent_comments.pt

    diff -Naur /home/andy/src/qPloneComments/skins/qplonecomments/recent_comments.pt qPloneComments/skins/qplonecomments/recent_comments.pt
    old new  
     1<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" 
     2      lang="en" 
     3      metal:use-macro="here/main_template/macros/master" 
     4      i18n:domain="plone"> 
     5 
     6<metal:block fill-slot="top_slot" 
     7             tal:define="dummy python:request.set('disable_border', 1)" /> 
     8 
     9<body> 
     10 
     11<div metal:fill-slot="main" 
     12     tal:define="results python:container.portal_catalog(portal_type='Discussion Item',sort_on='modified',sort_order='reverse'); 
     13                 Batch python:modules['Products.CMFPlone'].Batch; 
     14                 DateTime python:modules['DateTime'].DateTime; 
     15                 b_start python:request.get('b_start',0);"> 
     16 
     17    <h1 i18n:translate="heading_recent_comments"> 
     18        Recent comments 
     19    </h1> 
     20 
     21    <div i18n:translate="description_recent_comments" class="documentDescription"> 
     22        All recent comments items, latest first. 
     23    </div> 
     24 
     25    <form name="searchresults" action="" method="post" tal:condition="results" 
     26                      tal:define="batch python:Batch(results, 20, int(b_start), orphan=1)"> 
     27 
     28        <tal:results tal:repeat="result batch"> 
     29 
     30            <dl> 
     31                <dt tal:define="item_wf_state result/review_state; 
     32                                item_wf_state_class python:'state-' + normalizeString(item_wf_state);"> 
     33                    <span tal:attributes="class python: 'visualIcon contenttype-' + normalizeString(result.portal_type) + ' visualIconPadding'"> 
     34                    <a href="/view" 
     35                       tal:content="result/pretty_title_or_id" 
     36                       tal:attributes="href result/getURL; 
     37                                       class string:$item_wf_state_class"> 
     38                    Title 
     39                    </a> 
     40                    </span> 
     41 
     42                    <span class="discreet" i18n:translate="text_creator_date"> 
     43                        by 
     44                        <span tal:define="creator result/Creator; 
     45                                          author python:mtool.getMemberInfo(creator)" 
     46                              tal:content="python:author and author['fullname'] or creator" 
     47                              tal:omit-tag="" 
     48                              i18n:name="creator">creator</span>, 
     49                        last updated: 
     50                        <span tal:content="python:toLocalizedTime(result.ModificationDate, long_format=1)" 
     51                              tal:omit-tag="" 
     52                              i18n:name="date">date</span> 
     53                    </span> 
     54                </dt> 
     55                 
     56                <dd tal:content="result/Description"> 
     57                    Description 
     58                </dd> 
     59            </dl> 
     60 
     61        </tal:results> 
     62 
     63        <div class="spacer"> 
     64        &nbsp; 
     65        </div> 
     66 
     67        <!-- Navigation --> 
     68        <div metal:use-macro="here/batch_macros/macros/navigation" /> 
     69 
     70        </form> 
     71 
     72    <p tal:condition="not: results" i18n:translate="text_no_new_comments"> 
     73        No comments have been left. 
     74    </p> 
     75 
     76  </div> 
     77 
     78</body> 
     79 
     80</html> 
  • qPloneComments/skins/qplonecomments/recent_comments.pt.metadata

    diff -Naur /home/andy/src/qPloneComments/skins/qplonecomments/recent_comments.pt.metadata qPloneComments/skins/qplonecomments/recent_comments.pt.metadata
    old new  
     1[default] 
     2title=Recently modified comments 
  • qPloneComments/skins/qplonecomments/rejected_comment_template.pt

    diff -Naur /home/andy/src/qPloneComments/skins/qplonecomments/rejected_comment_template.pt qPloneComments/skins/qplonecomments/rejected_comment_template.pt
    old new  
    1313 
    1414<tal:notify define="obj nocall:options/obj"  
    1515       i18n:translate="notifyreject_link"> 
    16        Your comment on '<tal:x replace="obj/absolute_url" i18n:name="url"/>' did not receive 
     16       Your comment on '<tal:x replace="python:obj.absolute_url() + '/view'" i18n:name="url"/>' did not receive 
    1717approval. Please direct any questions or concerns to <tal:x replace="options/mfrom" i18n:name="mfrom"/>. 
    1818</tal:notify> 
    1919 
  • qPloneComments/skins/qplonecomments/reply_notify_template.pt

    diff -Naur /home/andy/src/qPloneComments/skins/qplonecomments/reply_notify_template.pt qPloneComments/skins/qplonecomments/reply_notify_template.pt
    old new  
    1212<tal:x replace="options/name"/>, 
    1313<tal:notify define="obj nocall:options/obj"  
    1414       i18n:translate="replynotify_link"> 
    15        Someone replied to your comment '<tal:x replace="obj/absolute_url" i18n:name="url"/>' on '<tal:x replace="here/absolute_url" i18n:name="here_url"/>'. To read the response, go to '<tal:x replace="obj/absolute_url" i18n:name="url"/>'. 
     15       Someone replied to your comment '<tal:x replace="python:obj.absolute_url() + '/view'" i18n:name="url"/>' on '<tal:x replace="here/absolute_url" i18n:name="here_url"/>'. To read the response, go to '<tal:x replace="python:obj.absolute_url() + '/view'" i18n:name="url"/>'. 
    1616</tal:notify> 
    1717 
    1818--