Changeset 1385


Ignore:
Timestamp:
02/20/07 17:46:16 (13 years ago)
Author:
tarmo
Message:

Changed activities folder into a methods folder. Migration
script and installation scripts are in place. All visible UI
strings changed as well (hopefully). Closes #1147, spent 4h.

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/ConfigurationMethods.py

    r1366 r1385  
    125125    atool = getToolByName(portal, 'portal_actions') 
    126126    acts = atool._cloneActions() 
     127    # Clean up any portal_tabs from actions 
     128    new_acts=[] 
     129    for action in acts: 
     130        if action.category == 'portal_tabs': 
     131            pass 
     132        else: 
     133            new_acts.append(action) 
    127134 
    128135    # Loop through all main sections 
     
    150157                    value=value, 
    151158                    data_type=dtype)  
    152         # Set up tab actions 
    153         flag = False 
    154         for action in acts: 
    155             if action.category == 'portal_tabs' and action.title == item: 
    156                 flag = True 
    157         if not flag: 
    158             # Add action for portal tab 
    159             acts.append(ActionInformation(id=item.lower(), 
    160                                       title=item, 
    161                                       description=item, 
    162                                       category='portal_tabs', 
    163                                       permissions=('View',), 
    164                                       visible=True, 
    165                                       action='string:$portal_url/%s' % item.lower())) 
    166     atool._actions=acts 
     159                 
     160        # Add action for portal tab 
     161        new_acts.append(ActionInformation(id=item.lower(), 
     162                                          title=item, 
     163                                          description=item, 
     164                                          category='portal_tabs', 
     165                                          permissions=('View',), 
     166                                          visible=True, 
     167                                          action='string:$portal_url/%s' % item.lower())) 
     168    atool._actions=new_acts 
    167169 
    168170def setupGroups(self, portal): 
  • trunk/Extensions/Install.py

    r1338 r1385  
    3030 
    3131from Products.LeMill.config import * 
    32 from Products.LeMill.Resources import Resource 
     32from Products.LeMill.Resources import Resource, Redirector 
    3333from Products.LeMill.SectionFolder import SectionFolder 
    3434 
     
    760760                    member.stories.manage_delLocalRoles([to_delete_owner_stories,]) 
    761761                    member.stories.manage_addLocalRoles(member_as_owner, ['Owner',]) 
    762             print >>out, "Migration from 1.6.1 complete"             
    763  
     762            print >>out, "Migration from 1.6.1 complete" 
     763    if old<="1.7": 
     764            print >>out, "Starting migration from 1.7" 
     765        old_id='activities' 
     766        new_id='methods' 
     767        import pdb 
     768        pdb.set_trace() 
     769        folder = getattr(self,old_id) 
     770        self.manage_renameObject(old_id,new_id) 
     771        folder.id=new_id 
     772        # Set up redirector 
     773        red = Redirector(old_id) 
     774        red.redirect_to = folder.UID() 
     775        self._setObject(old_id,red) 
     776        # Change folder title 
     777        folder.setTitle('Methods') 
     778        # Remove unnecessary topic - it will be replaced with a properly named one 
     779        folder._delObject('activities') 
    764780 
    765781def uninstall(self): 
  • trunk/LargeSectionFolder.py

    r1380 r1385  
    879879    def tagcloud_type(self,topic_name): 
    880880        """ Other than community tag clouds count tags by their popularity, except hits """ 
    881         if topic_name=='activities': return 'activity_titles' 
     881        if topic_name=='methods': return 'activity_titles' 
    882882        else: return 'hits' 
    883883     
  • trunk/config.py

    r1374 r1385  
    6262 'Learning resource':('Learning resource', 'Learning resources'), 
    6363 'Content': ('Content', 'Content'), 
    64  'Activity': ('Activity', 'Activities'), 
     64 'Activity': ('Method', 'Methods'), 
    6565 'Tool': ('Tool', 'Tools'),  
    6666 'MemberFolder': ('Member', 'Members'), 
     
    8686         'LeMillReference':'content.content', 
    8787         'Content':'content.content', 
    88          'Activity':'activities.activities',  
     88         'Activity':'methods.methods',  
    8989         'Tool':'tools.tools',  
    9090         'MemberFolder':'community.members',  
     
    124124 
    125125# Main sections of the site 
    126 SECTIONS = ('Content','Activities','Tools','Community') 
     126SECTIONS = ('Content','Methods','Tools','Community') 
    127127 
    128128SECTION_PROPERTIES = { 
    129     'Activities': 
     129    'Methods': 
    130130        {'left_slots':('here/portlet_add_activity/macros/portlet', 'here/portlet_related_stories/macros/portlet'),}, 
    131131    'Tools': 
     
    138138 
    139139SECTION_FOLDER_TYPES = { 
    140     'Activities':'LargeActivityFolder', 
     140    'Methods':'LargeActivityFolder', 
    141141    'Tools':'LargeToolFolder', 
    142142    'Content':'LargeContentFolder', 
     
    205205# Folder:((allowed content types), (pregenerated topics)) 
    206206SECTION_TOPICS = { 
    207     'Activities': # folder where these topics should be created 
    208     [(('Activity',), (tc('language'), tc('tags'), tc('published'), {'id':'activities', 'title':'Activities', 'getmethod':'sortable_title'}))], # list of topics to be created 
     207    'Methods': # folder where these topics should be created 
     208    [(('Activity',), (tc('language'), tc('tags'), tc('published'), {'id':'methods', 'title':'Methods', 'getmethod':'sortable_title'}))], # list of topics to be created 
    209209    'Tools': 
    210210    [(('Tool',), (tc('language'), tc('tags'), tc('published'),{'id':'tools', 'title':'Tools', 'getmethod':'sortable_title'}))], 
  • trunk/skins/lemill/front-page.pt

    r1372 r1385  
    7878    </div> 
    7979    <tal:no_empties condition="python: story_candidate['chcontent'] and story_candidate['method'] and story_candidate['tool']"> 
    80     <h2><a href="new_story" tal:attributes="href python:test(isAnon, 'join_form', '%s/%s/stories/new_story?chcontent=%s&method=%s&tool=%s' % (membersfolder.absolute_url(), member, story_candidate['chcontent'].UID(), story_candidate['method'].UID(), story_candidate['tool'].UID()))" i18n="write_your_learning_story">Write your learning story</a> <span i18n:translate="about_using_these_resources">about using these resources...</span></h2>  
     80    <h2><a href="new_story" tal:attributes="href python:test(isAnon, 'join_form', '%s/%s/stories/new_story?chcontent=%s&amp;method=%s&amp;tool=%s' % (membersfolder.absolute_url(), member, story_candidate['chcontent'].UID(), story_candidate['method'].UID(), story_candidate['tool'].UID()))" i18n="write_your_learning_story">Write your learning story</a> <span i18n:translate="about_using_these_resources">about using these resources...</span></h2>  
    8181    </tal:no_empties> 
    8282 
  • trunk/skins/lemill/lemill_activities_view.pt

    r1349 r1385  
    99   <span tal:define="samples python:here.getSamples(search_results);" tal:condition="samples" tal:omit-tag=""> 
    1010    
    11     <h1 i18n:translate="heading_featured_activities">Featured activities</h1> 
     11    <h1 i18n:translate="heading_featured_methods">Featured methods</h1> 
    1212 
    1313    <div metal:define-macro="featured"> 
     
    2929   </span> 
    3030 
    31     <h1 i18n:translate="heading_browser_activities">Browse activities</h1> 
     31    <h1 i18n:translate="heading_browser_methods">Browse methods</h1> 
    3232     
    3333    <ul> 
     
    4141         
    4242        <li> 
    43             <a i18n:translate="label_browse_by_title" href="activities" class="byTextsFont">By title</a> 
     43            <a i18n:translate="label_browse_by_title" href="methods" class="byTextsFont">By title</a> 
    4444        </li> 
    4545 
    4646        <li> 
    47             <a i18n:translate="label_browse_by_title_cloud" href="activities" class="byTextsFont">By title cloud</a> 
     47            <a i18n:translate="label_browse_by_title_cloud" href="methods" class="byTextsFont">By title cloud</a> 
    4848        </li> 
    4949 
  • trunk/skins/lemill/member_view.pt

    r1317 r1385  
    139139                            (<span tal:replace="python:here.getResources(True, request, context.getContentTypes())"></span>) 
    140140                            | 
    141                             <a i18n:translate="" href="portfolio" tal:attributes="href python:'portfolio?Creator=%s&amp;filter=activities' % here.id">Activities</a> 
     141                            <a i18n:translate="" href="portfolio" tal:attributes="href python:'portfolio?Creator=%s&amp;filter=activities' % here.id">Methods</a> 
    142142                            (<span tal:replace="python:here.getResources(True, request, 'Activity')"></span>) 
    143143                            | 
  • trunk/skins/lemill/portlet_add_activity.pt

    r1141 r1385  
    88<div class="tb-portlet"> 
    99    <div class="portlet-title"> 
    10     <a href="#" tal:attributes="href string:$portal_url/activities/createObject?type_name=Activity"><img src="images/new_activity.png" alt="" class="smallicon" border="0" /></a> 
    11     <a href="#" i18n:translate="label_new_activity" tal:attributes="href string:$portal_url/activities/createObject?type_name=Activity" class="linkonbackground">New activity</a> 
     10    <a href="#" tal:attributes="href string:$portal_url/methods/createObject?type_name=Activity"><img src="images/new_activity.png" alt="" class="smallicon" border="0" /></a> 
     11    <a href="#" i18n:translate="label_new_method" tal:attributes="href string:$portal_url/methods/createObject?type_name=Activity" class="linkonbackground">New method</a> 
    1212    </div> 
    1313</div> 
     
    1616    <div class="portlet-title"> 
    1717    <img src="transparent.png" alt="" class="smallicon" /> 
    18     <tal:block i18n:translate="heading_my_activities">My activities</tal:block> 
     18    <tal:block i18n:translate="heading_my_methods">My methods</tal:block> 
    1919    </div> 
    2020<ul> 
    21     <li><a i18n:domain="plone" i18n:translate="label_published" href="#" tal:attributes="href string:${portal_url}/activities/published">Published</a></li> 
     21    <li><a i18n:domain="plone" i18n:translate="label_published" href="#" tal:attributes="href string:${portal_url}/methods/published">Published</a></li> 
    2222    <li><a i18n:translate="label_collections" href="#" tal:attributes="href string:${portal_url}/community/${user}/collections/redirect">Collections</a></li> 
    2323</ul> 
  • trunk/skins/lemill/resource_list_macro.pt

    r1369 r1385  
    195195     "> 
    196196     <p> 
    197   <tal:days condition="python:timedif['days']>=1"> 
     197  <tal:days condition="python:timedif['days']&gt;=1"> 
    198198    <span tal:condition="python:timedif['days']>1" i18n:translate="n_days"> 
    199199     <span i18n:name="n" tal:replace="timedif/days" /> 
     
    204204    </span> 
    205205  </tal:days> 
    206   <tal:hours condition="python:timedif['days']<1"> 
     206  <tal:hours condition="python:timedif['days']&lt;1"> 
    207207    <span tal:condition="python:timedif['hours']>1" i18n:translate="n_hours"> 
    208208     <span i18n:name="n" tal:replace="timedif/hours" /> 
     
    213213    </span> 
    214214  </tal:hours> 
    215   <tal:minutes condition="python:(timedif['days']<1) and (timedif['hours']<1)"> 
    216     <span tal:condition="python:timedif['minutes']>1" i18n:translate="n_minutes"> 
     215  <tal:minutes condition="python:(timedif['days']&lt;1) and (timedif['hours']&lt;1)"> 
     216    <span tal:condition="python:timedif['minutes']&gt;1" i18n:translate="n_minutes"> 
    217217     <span i18n:name="n" tal:replace="timedif/minutes" /> 
    218218     minutes 
     
    221221     1 minute 
    222222    </span> 
    223     <span tal:condition="python:timedif['minutes']<1" i18n:translate="less_than_a_minute"> 
     223    <span tal:condition="python:timedif['minutes']&lt;1" i18n:translate="less_than_a_minute"> 
    224224        less than a minute 
    225225    </span> 
  • trunk/tests/extractTranslations.py

    r1336 r1385  
    189189 
    190190        prefixes = ["My draft","My published"] 
    191         folders = ["content","activities","tools"] 
     191        folders = ["content","methods","tools"] 
    192192        community_folders = ["community","members","groups","blog posts","tips for use"] 
    193193        topics = ["tags","language"] 
     
    225225        for fol in folders+community_folders: 
    226226            msgid=" ".join(("Browse",fol,"made by")) 
    227             ctl['lemill'].add(msgid,msgid,references=['f.ex. Browse activities made by [username]']) 
     227            ctl['lemill'].add(msgid,msgid,references=['f.ex. Browse methods made by [username]']) 
    228228        # Some content types in plural form for browse subheadings 
    229229        show_by_elements = [x[1][1] for x in TYPE_NAMES.items() if x[0] in ("Learning resource", "LeMillReference", "Piece")] 
  • trunk/tests/testActivity.py

    r1238 r1385  
    3838        self.login('foobar') 
    3939        auth = 'foorbar:foobar' 
    40         ob=self.construct('Activity', 'TestActivity' ,self.portal.activities) 
     40        ob=self.construct('Activity', 'TestActivity' ,self.portal.methods) 
    4141        ob.edit(address=ADDRESS, description=DESCRIPTION, tags=TAGS) 
    4242        #ob.edit(location=LOCATION, address=ADDRESS, description=DESCRIPTION, tags=TAGS) 
     
    5151    def testAddActivityPortlet(self): 
    5252        auth="foobar:foobar" 
    53         path= self.portal.activities.absolute_url_path() 
     53        path= self.portal.methods.absolute_url_path() 
    5454        result=self.publish(path,basic=auth).getBody() 
    55         self.failUnless(re.search('New activity',result), 
     55        self.failUnless(re.search('New method',result), 
    5656            "Add activity portlet not found.") 
    5757 
     
    6060        auth="foobar:foobar" 
    6161        self.login('foobar') 
    62         ob=self.construct('Activity', 'TestActivity' ,self.portal.activities) 
     62        ob=self.construct('Activity', 'TestActivity' ,self.portal.methods) 
    6363        path= ob.absolute_url_path()         
    6464        result=self.publish(path,basic=auth).getBody() 
  • trunk/tests/testDeletePublish.py

    r1079 r1385  
    8989        result = self.publish(path, basic=auth).getBody() 
    9090        self.failIf(re.search('hidingtest', result), 'Deleted object visible in my drafts') 
    91         path = self.portal.activities.published.absolute_url_path() 
     91        path = self.portal.methods.published.absolute_url_path() 
    9292        result = self.publish(path, basic=auth).getBody() 
    9393        self.failIf(re.search('Browse content where', result), "Deleted object counted in 'browse other types' -links") 
  • trunk/tests/testFolderBrowsing.py

    r750 r1385  
    5656        self.failUnless(re.search(TAGS_later, result),"The popular browse-by choice is not visible in folder index.") 
    5757         
    58         path=self.portal.activities.absolute_url_path() 
     58        path=self.portal.methods.absolute_url_path() 
    5959        result=self.publish(path).getBody() 
    6060        self.failIf(re.search(TAGS_later, result), "The popular browse-by choice is visible in wrong folder.") 
  • trunk/tests/testResources.py

    r1298 r1385  
    4444        VALUE3='Body3' 
    4545        self.login('foobar') 
    46         ob=self.construct('Activity', 'TestActivity' ,self.portal.activities) 
     46        ob=self.construct('Activity', 'TestActivity' ,self.portal.methods) 
    4747         
    4848        ob.processForm(values={'title': TITLE, 'bodyText': VALUE1}) 
     
    8787        BODY1 = 'graf1' 
    8888        BODY2 = 'graf2' 
    89         folder=self.portal.activities 
     89        folder=self.portal.methods 
    9090        ob = self.construct('Activity', 'Foo1', folder) 
    9191        ob.processForm(values={'title': 'Foo1','bodyText': BODY1}) 
  • trunk/tests/testWorkflow.py

    r586 r1385  
    3333         
    3434        self.doc = self.construct('PresentationMaterial', 'doc',self.portal.content) 
    35         self.act = self.construct('Activity', 'act',self.portal.activities) 
     35        self.act = self.construct('Activity', 'act',self.portal.methods) 
    3636 
    3737    def testState(self): 
  • trunk/version.txt

    r1340 r1385  
    1 1.7 
     11.7.1 
Note: See TracChangeset for help on using the changeset viewer.