Changeset 450


Ignore:
Timestamp:
07/14/06 15:38:24 (13 years ago)
Author:
jukka
Message:

Fixed #511, spent 2h.

Location:
trunk
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/BlogPost.py

    r441 r450  
    7979        self.content_status_modify(workflow_action='publish') 
    8080        if not hasattr(item.aq_base, 'left_slots'): 
    81             self._setProperty('left_slots', ['here/portlet_%s_actions/macros/portlet' % item.meta_type.lower(),], 'lines') 
     81            self._setProperty('left_slots', ['here/portlet_groupblog_actions/macros/portlet',], 'lines') 
    8282        if hasattr(container, 'recent_posts'): 
    8383            container.addRecent_post(self.getId()) 
     
    140140        return self.getTitle() 
    141141 
    142     def hide_post(self): 
     142    def isPost(self): 
     143        return True 
     144 
     145    def delete_post(self): 
    143146        """ Hide, remove from recent posts and remove from Collaboration proposals """ 
    144147        container=self.getBlog() 
     
    154157            self.community.addCollaboration_proposal(uid) 
    155158 
    156  
     159    def undelete_post(self): 
     160        """ Bring back post but currently doesn't add to collaboration proposals or recent posts """ 
     161        self.content_status_modify(workflow_action='publish') 
    157162 
    158163     
  • trunk/Extensions/Install.py

    r438 r450  
    199199                x.setRights('CreativeCommons') 
    200200            print >>out, "Migration from 0.4 complete" 
    201     if old<='0.4.1': 
     201        if old<='0.4.1': 
    202202            print >>out, "Starting migration from 0.4.1" 
    203         groupdatatool=getToolByName(self,"portal_groupdata") 
    204         for prop in ['tags','email','scope']: 
    205             if groupdatatool.hasProperty(prop): 
    206                 groupdatatool.manage_delProperties([prop]) 
    207             print >>out, "Migration from 0.4.1 complete" 
     203            groupdatatool=getToolByName(self,"portal_groupdata") 
     204            for prop in ['tags','email','scope']: 
     205                if groupdatatool.hasProperty(prop): 
     206                    groupdatatool.manage_delProperties([prop]) 
     207                print >>out, "Migration from 0.4.1 complete" 
     208        if old<='0.4.2': 
     209                print >>out, "Starting migration from 0.4.2" 
     210                for group in self.community.objectValues(('GroupBlog',)): 
     211                    for post in group.objectValues(('BlogPost',)): 
     212                        post._setProperty('left_slots', ['here/portlet_groupblog_actions/macros/portlet',], 'lines') 
     213                print >>out, "Migration from 0.4.2 complete" 
    208214        print >>out,"Migration completed." 
     215 
    209216 
    210217def uninstall(self): 
  • trunk/LeMillWorkflow.py

    r330 r450  
    7474 
    7575    state = wf.states['hidden'] 
    76     state.setProperties(title='hidden', transitions=()) 
     76    state.setProperties(title='hidden', transitions=('retract','publish')) 
    7777    state.setPermission(view, 0, ('Manager', 'Owner', 'Member', 'Authenticated', 'Anonymous')) 
    7878    state.setPermission(edit, 0, ('Manager', 'Owner')) 
     
    147147    wf.states.deleteStates(('draft',)) 
    148148    wf.states.setInitialState('public') 
    149     wf.transitions.deleteTransitions(('publish','retract')) 
     149    wf.transitions.deleteTransitions(('retract',)) 
    150150 
    151151def setupWikish_workflow(wf): 
  • trunk/skins/lemill/portlet_groupblog_actions.pt

    r443 r450  
    88        blogtitle blogobj/title;         
    99        isMember python:here.isMember(member.id); 
    10         isManager python:here.amIManager()"> 
     10        isManager python:here.amIManager(); 
     11        isPost here/isPost | nothing; 
     12        isAuthor python:isPost and member.id==here.Creator()"> 
    1113 
    1214<div class="tb-portlet" metal:define-macro="image_div"> 
    13     <img src="default.png" tal:attributes="src blogobj/getCoverImageURL" height="120" width="160" style="padding: 10px 19px"/> 
     15    <a href="#" tal:attributes="href string:$blogurl"> 
     16        <img src="default.png" tal:attributes="src blogobj/getCoverImageURL" height="120" width="160" style="padding: 10px 19px"/> 
     17    </a> 
    1418    <ul tal:condition="isMember"> 
    1519        <li><a href="" tal:attributes="href string:$blogurl/change_coverimage">Change cover image</a></li> 
     
    2428    <ul tal:condition="isMember"> 
    2529        <li><a href="#" tal:attributes="href string:$blogurl/createObject?type_name=BlogPost">New post</a></li> 
     30         
     31        <li tal:condition="python: isAuthor or isManager"> 
     32           <a href="" tal:attributes="href string:${here_url}/edit">Edit this post</a> 
     33        </li>         
     34        <li tal:condition="python: (isAuthor or isManager) and wf_state!='hidden'"> 
     35           <a href="" tal:attributes="href string:${here_url}/delete_post">Delete this post</a> 
     36        </li> 
     37        <li tal:condition="python: (isAuthor or isManager) and wf_state=='hidden'" > 
     38           <a href="" tal:attributes="href string:${here_url}/undelete_post">Undelete post</a> 
     39        </li> 
    2640        <li><a href="" tal:attributes="href string:$blogurl/edit">Edit group information</a></li> 
    2741        <li><a href="TODO">Edit categories</a></li> 
  • trunk/skins/lemill/viewThreadsAtBottom.pt

    r423 r450  
    4949                  action="" 
    5050                  method="post" 
    51                   tal:condition="python:userHasReplyPermission and isDiscussionAllowed" 
     51                  tal:condition="python:userHasReplyPermission and isDiscussionAllowed and wf_state!='hidden'" 
    5252                  tal:attributes="action string:$here_url/discussion_reply" 
    5353                  tal:define="fieldName string:body_text; 
  • trunk/tests/testGroups.py

    r439 r450  
    133133        self.workspace.at_post_edit_script()                    
    134134        result=self.publish(self.portal.absolute_url_path()+'/community/testgroup')         
    135         self.failUnless(re.search('Group links', result.getBody()), "Group links portlet isn't visible when there should be links: %s" % result.getBody()) 
     135        self.failUnless(re.search('Blogroll', result.getBody()), "Group links portlet isn't visible when there should be links: %s" % result.getBody()) 
    136136        self.failUnless(re.search('href="http://www.yle.fi"', result.getBody()), 'Group link not correct: there should be href="http://www.yle.fi" in %s' % result.getBody())         
    137137         
  • trunk/version.txt

    r438 r450  
    1 0.4.2 
     10.4.3 
Note: See TracChangeset for help on using the changeset viewer.