Changeset 1391


Ignore:
Timestamp:
02/21/07 17:42:17 (13 years ago)
Author:
jukka
Message:

Closed #1155, spent 2h. Also fixed collections some more.

Location:
trunk
Files:
13 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Collection.py

    r1390 r1391  
    452452    }, 
    453453    ) 
    454  
    455     def getPreviousSection(self, req): 
    456         """ return previous section """ 
    457         ref = req.get('HTTP_REFERER', None) 
    458         if ref is None: 
    459             return 'community' 
    460         purl = getToolByName(self, 'portal_url')() 
    461         for c in ('content', 'activities', 'tools'): 
    462             if ref.startswith(purl+'/'+c): 
    463                 return c 
    464         return 'community' 
    465454                 
    466455registerType(CollectionsFolder, PROJECTNAME) 
  • trunk/Extensions/Install.py

    r1389 r1391  
    788788                        c.cleanRefsToResources() 
    789789            print >>out, "Migration from 1.7.1 complete"             
     790        if old<="1.7.2": 
     791            print >>out, "Starting migration from 1.7.2" 
     792            print >>out, "Removing stories from the system" 
     793            # Get stories folder and delete stuff there         
     794            for member in self.community.objectValues('MemberFolder'): 
     795                if hasattr(member.aq_base, 'stories'): 
     796                    for i in member.stories.objectIds('Story'): 
     797                        manage_delObject(member.stories, i) 
     798                    manage_delObject(member, 'stories') 
     799            print >>out, "Migration from 1.7.2 complete"             
    790800 
    791801 
  • trunk/LargeSectionFolder.py

    r1385 r1391  
    376376            'Tool':('down','here','tools'), 
    377377            #'Collection':('down','here','collections'), <-- I think these should be included, but will require some extra work, I'll wait for comments 
    378             #'Story':('down','here','tipsforuse') 
    379378            } 
    380379         
     
    397396        'tools':'Tool', 
    398397        'collections':'Collection', 
    399         'tipsforuse':'Story', 
    400398        } 
    401399 
     
    574572            res=rc({'targetUID':x.UID}) 
    575573            score=0 
    576             scores={'Collection':1,'Story':10} 
     574            scores={'Collection':1} 
    577575            for r in res: 
    578576                typ = getTypeForReferenceSource(r) 
     
    588586            created=pc({'Creator':x.id}) 
    589587            score=0 
    590             scores={'Piece':1, 'PILOTMaterial':10, 'PresentationMaterial':10, 'MultimediaMaterial':10, 'Activity':10, 'Tool':10,'Story':10, 'BlogPost':1} 
     588            scores={'Piece':1, 'PILOTMaterial':10, 'PresentationMaterial':10, 'MultimediaMaterial':10, 'Activity':10, 'Tool':10, 'BlogPost':1} 
    591589            for c in created: 
    592590                typ=c.portal_type 
     
    921919        if not hasattr(folder.aq_base,'collections'): 
    922920            folder.invokeFactory('CollectionsFolder', id='collections') 
    923         if not hasattr(folder.aq_base,'stories'): 
    924             folder.invokeFactory('StoryFolder', id='stories')                 
    925921        return folder.absolute_url()    
    926922 
  • trunk/MemberFolder.py

    r1334 r1391  
    280280    global_allow = 1 
    281281 
    282     allowed_content_types = ('CollectionsFolder', 'StoryFolder', 'Topic') 
     282    allowed_content_types = ('CollectionsFolder', 'Topic') 
    283283    default_view = ('member_view') 
    284284    filter_content_types = True 
     
    356356            msg=u'You are not allowed to delete this collection' 
    357357        return (self.collections, msg)       
    358  
    359     def getStoriesFolder(self): 
    360         """...""" 
    361         if not hasattr(self.aq_base, 'stories'): 
    362             self.invokeFactory('StoryFolder', id='stories') 
    363         return self.stories 
    364      
    365     def getStories(self): 
    366         """...""" 
    367         return self.getStoriesFolder().objectValues('Story') 
    368358     
    369359    def whatamI(self): 
  • trunk/SectionFolder.py

    r1318 r1391  
    378378            'Tool':('down','here','tools'), 
    379379            #'Collection':('down','here','collections'), <-- I think these should be included, but will require some extra work, I'll wait for comments 
    380             #'Story':('down','here','tipsforuse') 
    381380            } 
    382381         
     
    399398        'tools':'Tool', 
    400399        'collections':'Collection', 
    401         'tipsforuse':'Story', 
    402400        } 
    403401 
  • trunk/Story.py

    r1373 r1391  
    4646        relationship = 'relatesToContent', 
    4747        multiValued = True, 
    48         isMetadata = True, 
     48        isMetadata = False, 
    4949        languageIndependent = False, 
    50         index = 'KeywordIndex', 
     50        index = None, 
    5151        write_permission = ModifyPortalContent, 
    5252        allowed_types= ALL_CONTENT_TYPES, 
     
    6969        relationship = 'relatesToActivities', 
    7070        multiValued = True, 
    71         isMetadata = True, 
     71        isMetadata = False, 
    7272        languageIndependent = False, 
    73         index = 'KeywordIndex', 
     73        index = None, 
    7474        write_permission = ModifyPortalContent, 
    7575        allowed_types=('Document','Activity',), 
     
    9292        relationship = 'relatesToTools', 
    9393        multiValued = True, 
    94         isMetadata = True, 
     94        isMetadata = False, 
    9595        languageIndependent = False, 
    96         index = 'KeywordIndex', 
     96        index = None, 
    9797        write_permission = ModifyPortalContent, 
    9898        allowed_types=('Document','Tool',), 
  • trunk/config.py

    r1389 r1391  
    5050COMMUNITY_MAIN_TYPES = ('GroupBlog','MemberFolder',) 
    5151COMMUNITY_FEATUTED_TYPES = ('MemberFolder',) 
    52 COMMUNITY_TYPES = ('Story','BlogPost',) + COMMUNITY_MAIN_TYPES 
     52COMMUNITY_TYPES = ('BlogPost',) + COMMUNITY_MAIN_TYPES 
    5353FEATURED_TYPES = MATERIAL_TYPES + ACTIVITY_TYPES + TOOLS_TYPES + COMMUNITY_FEATUTED_TYPES 
    5454ALL_CONTENT_TYPES = CONTENT_TYPES + ACTIVITY_TYPES + TOOLS_TYPES + COMMUNITY_TYPES 
     
    6767 'GroupBlog': ('Group', 'Groups'), 
    6868 'BlogPost': ('Blog post', 'Blog posts'), 
    69  'Story': ('Tip for use', 'Tips for use'), 
    7069 'LeMillReference': ('Reference', 'References'), 
    7170 'Collection': ('Collection', 'Collections'), 
     
    9089         'MemberFolder':'community.members',  
    9190         'GroupBlog':'community.groups',  
    92          'BlogPost':'community.blogposts', 
    93          'Story': 'community.stories'} 
     91         'BlogPost':'community.blogposts'} 
    9492 
    9593# Skin variations. The first one will be the defaul 
     
    117115                        'Tool':['all',], 
    118116                        'Activity':['all',], 
    119                         'Story':['all',], 
    120117                        'GroupBlog':['all',], 
    121118                        'LeMillReference' : ['all',], 
     
    128125SECTION_PROPERTIES = { 
    129126    'Methods': 
    130         {'left_slots':('here/portlet_add_activity/macros/portlet', 'here/portlet_related_stories/macros/portlet'),}, 
     127        {'left_slots':('here/portlet_add_activity/macros/portlet',),}, 
    131128    'Tools': 
    132         {'left_slots':('here/portlet_add_tool/macros/portlet', 'here/portlet_related_stories/macros/portlet'),}, 
     129        {'left_slots':('here/portlet_add_tool/macros/portlet',),}, 
    133130    'Content': 
    134         {'left_slots': ('here/portlet_add_content/macros/portlet', 'here/portlet_related_stories/macros/portlet'),}, 
     131        {'left_slots': ('here/portlet_add_content/macros/portlet',),}, 
    135132    'Community': 
    136133        {'left_slots':('here/portlet_add_community/macros/portlet',),}, 
     
    219216    [(('GroupBlog',), (tc('tags'), tc('group_language_skills'),  {'id':'groups', 'title':'Groups', 'getmethod':'sortable_title'})), 
    220217    (('MemberFolder',), (tc('language_skills'), tc('location_topic'), tc('skills'), tc('interests'),  {'id':'members', 'title':'Members','getmethod':'getSortable_nicename'})), 
    221     (('Story',), ({'id':'stories', 'title':'Stories', 'getmethod':'sortable_title'}, {'id':'my_stories', 'title':'My stories', 'getmethod':'sortable_title', 'criterions':[('ATCurrentAuthorCriterion','Creator',''),('ATSelectionCriterion','review_state','public')]})), 
    222218    (('BlogPost',), ({'id':'blogposts', 'title':'Blog posts', 'getmethod':'sortable_title'}, {'id':'my_blogposts', 'title':'My posts', 'getmethod':'sortable_title', 'criterions':[('ATCurrentAuthorCriterion','Creator',''),('ATSelectionCriterion','review_state','public')]})), 
    223219    (ALL_CONTENT_TYPES, ({'id':'portfolio', 'title':'Portfolio', 'getmethod':'getTags'},))] 
     
    284280        'resources':'resources', # no idea where these come from 
    285281        'my_blogposts':'posts', # this shouldn't be called 
    286         'my_stories':'stories' # this shouldn't be called 
    287282        } 
    288283         
     
    299294        'Collection':'images/default_collection.png', # doesn't exist 
    300295        'BlogPost':'images/default_member.png', # shouldn't be called this way 
    301         'Story':'images/default_story.png', # doesn't exist 
    302296        } 
    303297         
  • trunk/skins/lemill/collection_view.cpt

    r1390 r1391  
    2525        <h1 i18n:translate="collection_title">Collection: <span i18n:name="title" tal:replace="here/Title"/></h1> 
    2626 
    27         <h2 i18n:translate="label_learning_story">Learning and teaching story</h2>  
     27        <h2 tal:condition="python: here.Description() or isOwner" i18n:translate="label_learning_story">Learning and teaching story</h2>  
    2828        <div tal:condition="here/Description" tal:replace="structure here/Description" /> 
    29         <p tal:condition="not:here/Description" i18n:translate="learning_story_explanation">You have not written a story about this collection yet. 
     29        <p tal:condition="python: isOwner and not here.Description()" i18n:translate="learning_story_explanation">You have not written a story about this collection yet. 
    3030If you have used these resources in a learning session you can share 
    31 your experiences by <a href="edit">writing a learning and teaching story</a>.</p> 
     31your experiences by <a href="collection_edit">writing a learning and teaching story</a>.</p> 
    3232 
    3333    <tal:content condition="here/getRelatedContent" tal:define="resources python:here.getResources(reftype='relatedContent');"> 
  • trunk/skins/lemill/find_related_stories.py

    r236 r1391  
    1313var = 'getRawRelatedContent' 
    1414if context.meta_type == 'Activity': 
    15     var = 'getRawRelatedActivities' 
     15    var = 'getRawRelatedMethods' 
    1616if context.meta_type == 'Tool': 
    1717    var = 'getRawRelatedTools' 
    1818query = {var:context.UID(), 
    19     'meta_type':'Story', 
     19    'getGoodStory':True, 
     20    'meta_type':'Collection', 
    2021    'sort_on': 'Date', 
    2122    'sort_order': 'descending'} 
  • trunk/skins/lemill/global_sections.pt

    r1151 r1391  
    1111        <tal:tabs tal:repeat="tab portal_tabs"><li tal:attributes="id string:portaltab-${tab/id};"> 
    1212            <a href="" i18n:translate="" 
    13                tal:condition="python:request.has_key('SESSION') and request.SESSION.has_key('keep_in_section') and context.absolute_url().find('collections')!=-1" 
    14                tal:content="tab/name" 
    15                tal:attributes="href tab/url; 
    16                                title tab/description|nothing; 
    17                                class python:test(request.SESSION.get('keep_in_section','community')==tab['id'], 'selected', 'plain');">PLACEHOLDER</a> 
    18             <a href="" i18n:translate="" 
    19                tal:condition="python:context.absolute_url().find('collections')==-1" 
    2013               tal:content="tab/name" 
    2114               tal:attributes="href tab/url; 
  • trunk/skins/lemill/member_view.pt

    r1385 r1391  
    114114                    <tal:authorContent define="content_n python:here.getResources(True, request, context.getFeaturedTypes()); 
    115115                                               collections_n python:len(here.getCollections()); 
    116                                                stories_n python:len(here.getStories()); 
    117116                                               samples context/getSamples; 
    118117                    "> 
    119                         <h1 i18n:translate="heading_portfolio" tal:condition="python: content_n>0 or collections_n>0 or stories_n>0"> 
     118                        <h1 i18n:translate="heading_portfolio" tal:condition="python: content_n>0 or collections_n>0"> 
    120119                            Portfolio 
    121120                        </h1> 
     
    147146                            <a i18n:translate="label_collections" href="collections">Collections</a> 
    148147                            (<span tal:replace="python:len(here.getCollections())"></span>) 
    149                             | 
    150                             <a i18n:translate="label_tips_for_use" href="stories">Tips for use</a> 
    151                             (<span tal:replace="python:len(here.getStories())"></span>) 
    152148                        </div> 
    153149 
  • trunk/skins/lemill/portlet_material_actions.pt

    r1390 r1391  
    5959    <ul> 
    6060    <tal:macro metal:define-macro="collection_actions"> 
    61         <li tal:condition="not:isAnon"><a href="" tal:attributes="href string:${here/absolute_url}/collection_add'"><tal:block i18n:translate="label_add_to_collection">Add to collection</tal:block>...</a></li> 
     61        <li tal:condition="not:isAnon"><a href="" tal:attributes="href string:${here/absolute_url}/collection_add"><tal:block i18n:translate="label_add_to_collection">Add to collection</tal:block>...</a></li> 
    6262        <li tal:condition="colls"> 
    6363            <a href=""  i18n:translate="label_view_collections" 
  • trunk/skins/lemill_eun/main_template.pt

    r1153 r1391  
    4848                    </tal:block> 
    4949                </tal:block> 
    50                     <tal:block condition="python:request.has_key('SESSION') and context.absolute_url().find('collections')!=-1"> 
    51                         <tal:def define="global section_name python:request.SESSION.get('keep_in_section')"></tal:def> 
    52                     </tal:block> 
    5350                                                                 
    5451                <tal:block define="global base_url string:ploneColors_${section_name}.css"/> 
  • trunk/skins/lemill_tables/main_template.pt

    r1320 r1391  
    4848                    </tal:block> 
    4949                </tal:block> 
    50                     <tal:block condition="python:request.has_key('SESSION') and context.absolute_url().find('collections')!=-1"> 
    51                         <tal:def define="global section_name python:request.SESSION.get('keep_in_section')"></tal:def> 
    52                     </tal:block> 
    5350                <tal:block define="global base_url string:ploneColors_${section_name}.css"/> 
    5451                <link rel="stylesheet" type="text/css" tal:attributes="href base_url" /> 
Note: See TracChangeset for help on using the changeset viewer.