Changeset 1162


Ignore:
Timestamp:
11/29/06 18:12:10 (13 years ago)
Author:
jukka
Message:

Worked on #992, links work and tags for user are almost there.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/PresentationMaterial.py

    r1071 r1162  
    125125        return sorted 
    126126 
     127    def getSlide(self, slidenr, count_captions=False): 
     128        """ fetch the referenced piece. if count_captions=True, then suppose that slidenr is actual chapterindex,  
     129        otherwise assume that  captions are not included in slidenr """ 
     130        if not count_captions: 
     131            slidenr=slidenr*2 
     132        chpsfield=self.getField('bodyText') 
     133        chps=chpsfield.get(self) 
     134        if slidenr<len(chps): 
     135            piece=chpsfield.getObjectByUID(self, chps[slidenr]) 
     136            return piece 
     137        else: 
     138            return 0 
     139 
     140    def createPieces(self, REQUEST): 
     141        """ does the job for script_createPieces """ 
     142        chapters= self.getField('bodyText').get(self) 
     143        clen=len(chapters) 
     144         
     145        n_pieces= int(REQUEST.get('n_pieces',10)) 
     146        print n_pieces 
     147        for n in range(n_pieces): 
     148            file = REQUEST.get('bodyText_file_%s' % n)     
     149            if clen<n*2: 
     150                chapters[n*2]=file 
     151            else: 
     152                chapters.append(file) 
     153                chapters.append('') 
     154         
     155        # use the field's set method to do the actual creation 
     156        self.getField('bodyText').set(self, chapters) 
     157         
    127158             
    128159registerType(PresentationMaterial, PROJECTNAME) 
  • trunk/SectionFolder.py

    r1159 r1162  
    811811                res.append(source) 
    812812        return res 
     813 
     814    def filterContent(self, results, show_what='resources'): 
     815        if show_what=='content': 
     816            allowed=CONTENT_TYPES 
     817        elif show_what=='activities': 
     818            allowed=('Activity',) 
     819        elif show_what=='tools': 
     820            allowed=('Tool',) 
     821        else: return results 
     822        return filter(lambda x: x.portal_type in allowed, results) 
     823 
    813824         
    814825registerType(ContentFolder, PROJECTNAME) 
  • trunk/config.py

    r1134 r1162  
    197197# Folder:((allowed content types), (pregenerated topics)) 
    198198SECTION_TOPICS = { 
    199     'Activities': 
    200     [(('Activity',), (tc('language'), tc('tags'), tc('published'), {'id':'activities', 'title':'Activities', 'getmethod':'sortable_title'}))], 
     199    'Activities': # folder where these topics should be created 
     200    [(('Activity',), (tc('language'), tc('tags'), tc('published'), {'id':'activities', 'title':'Activities', 'getmethod':'sortable_title'}))], # list of topics to be created 
    201201    'Tools': 
    202202    [(('Tool',), (tc('language'), tc('tags'), tc('published'),{'id':'tools', 'title':'Tools', 'getmethod':'sortable_title'}))], 
     
    211211    (('MemberFolder',), (tc('language_skills'), tc('location_topic'), tc('skills'), tc('interests'),  {'id':'members', 'title':'Members','getmethod':'getSortable_nicename'})), 
    212212    (('Story',), ({'id':'stories', 'title':'Stories', 'getmethod':'sortable_title'}, {'id':'my_stories', 'title':'My stories', 'getmethod':'sortable_title', 'criterions':[('ATCurrentAuthorCriterion','Creator',''),('ATSelectionCriterion','review_state','public')]})), 
    213     (('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')]}))] 
     213    (('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')]})), 
     214    (ALL_CONTENT_TYPES, ({'id':'portfolio', 'title':'Portfolio', 'getmethod':'getTags'},))] 
    214215} 
    215216 
  • trunk/skins/lemill/lemill_browse_results.pt

    r1134 r1162  
    2424         can_l10n_topic_values python:topic_name in ('target group','subject area'); 
    2525                 topic_get_method python:here.public_getSortCriterion(here); 
    26          do_tagcloud python:(not searchterm and topic_get_method) and not (here.id in ('drafts','published','my_blogposts','my_stories','recent')); 
     26         do_tagcloud python:(not searchterm and topic_get_method) and (not here.id in ('drafts','published','my_blogposts','my_stories','recent')) or (here.id=='portfolio' and len(searchterm)<2 and not filter); 
    2727                 type_criterion python:here.crit__Type_ATPortalTypeCriterion.value; 
    2828                 wrw python:here.whatResourceWhereDictionary(); 
     
    4141    <h1 tal:condition="python:here.id=='drafts'" i18n:translate="" tal:content="string:My draft ${parent_folder}"></h1> 
    4242    <h1 tal:condition="python:here.id=='published'" i18n:translate="" tal:content="string:My published ${parent_folder}"></h1> 
    43  
    44     <h1 tal:condition="python:here.id not in ('drafts','published')"> 
     43    <h1 tal:condition="python:here.id=='portfolio' and filter"><span i18n:translate="" tal:content="python:filter.capitalize()">Content</span> <span i18n:translate="by_author"> by <span i18n:name="authors_name" tal:content="searchterm/Creator">author</span></span></h1> 
     44    <h1 tal:condition="python:here.id=='portfolio' and not filter" i18n:translate="show_tags_used_by_n">Show tags used by <span i18n:name="authors_name" tal:content="searchterm/Creator">author</span></h1> 
     45    <h1 tal:condition="python:here.id not in ('drafts','published','portfolio')"> 
    4546        <tal:cond tal:condition="python: tagcloud_type!='hits'" i18n:translate="" tal:content="string:Browse ${topic_name}"></tal:cond>  
    4647        <tal:cond tal:condition="python:tagcloud_type=='hits'"> 
     
    136137        </span> 
    137138 
    138 <tal:other_results condition="python: topic_name not in ('draft','recent')"> 
     139<tal:other_results condition="python: topic_name not in ('draft','recent','portfolio')"> 
    139140    <p/> 
    140141    <div tal:define="frc python:here.fullResultCount(request, topic_name, topic_get_method, request_opened);" tal:omit-tag=""> 
  • trunk/skins/lemill/member_view.pt

    r1159 r1162  
    153153 
    154154                        <div> 
    155                             <a i18n:translate="">Content</a> 
     155                            <a i18n:translate="" href="portfolio" tal:attributes="href python:'portfolio?Creator=%s&filter=content' % here.id">Content</a> 
    156156                            (<span tal:replace="python:here.getResources(True, request, context.getMaterialTypes())"></span>) 
    157157                            | 
    158                             <a i18n:translate="">Activities</a> 
     158                            <a i18n:translate="" href="portfolio" tal:attributes="href python:'portfolio?Creator=%s&filter=activities' % here.id">Activities</a> 
    159159                            (<span tal:replace="python:here.getResources(True, request, 'Activity')"></span>) 
    160160                            | 
    161                             <a i18n:translate="">Tools</a> 
     161                            <a i18n:translate="" href="portfolio" tal:attributes="href python:'portfolio?Creator=%s&filter=tools' % here.id">Tools</a> 
    162162                            (<span tal:replace="python:here.getResources(True, request, 'Tool')"></span>) 
    163163                            | 
    164                             <a i18n:translate="">Collections</a> 
     164                            <a i18n:translate="" href="collections">Collections</a> 
    165165                            (<span tal:replace="python:len(here.getCollections())"></span>) 
    166166                            | 
    167                             <a i18n:translate="">Tips for use</a> 
     167                            <a i18n:translate="" href="stories">Tips for use</a> 
    168168                            (<span tal:replace="python:len(here.getStories())"></span>) 
    169169                        </div> 
  • trunk/skins/lemill/script_chapterController.cpy

    r1136 r1162  
    116116 
    117117 
    118 if just_uploaded==[] and 'upload' in button: 
     118if just_uploaded==[] and '.upload' in button: 
    119119        kwargs['portal_status_message']=context.translate('No file to upload', domain="lemill") 
    120120elif len(just_uploaded)==1: 
     
    125125# 8) set the next_action  
    126126 
    127 if just_uploaded==[]: 
     127if just_uploaded==[] and 'mass_uploader' not in button: 
    128128    kwargs['next_action']='redirect_to:string:%s?edit=%s#%s' % (edit_page,edit_nr,edit_nr) 
    129  
     129elif 'mass_uploader' in button: 
     130    session['return_page']={'edit_page':edit_page, 'edit_nr':edit_nr} 
     131    kwargs['next_action']='redirect_to:string:slide_uploader' 
    130132else: 
    131133    session['return_page']={'edit_page':edit_page, 'edit_nr':edit_nr} 
  • trunk/skins/lemill/validate_integrity.cpy.metadata

    r1136 r1162  
    1616action.success.MultimediaMaterial = redirect_to_action:string:view 
    1717action.success.PresentationMaterial.uploadSlide = traverse_to:string:script_chapterController 
     18action.success.PresentationMaterial.mass_uploader = traverse_to:string:script_chapterController 
    1819action.success.PresentationMaterial.presentation_form_submit = redirect_to_action:string:metadata 
    1920action.success.PresentationMaterial.delSlide = traverse_to:string:script_chapterController 
  • trunk/skins/lemill/widget_slides.pt

    r1150 r1162  
    4545        <input type="hidden" name="translation" id="translation" value="0" tal:attributes="value translation"/> 
    4646        <input tal:condition="not:engineer" type="hidden" name="insert_point" id="insert_point" value="-1" /> 
     47 
     48        <div class="visualClear" style="height:20px">&nbsp;</div> 
     49 
     50        <input class="context" 
     51            tabindex="" 
     52            type="submit" 
     53            name="form.button.mass_uploader" 
     54            value="   Upload many slides   " i18n:domain="lemill" 
     55            i18n:attributes="value label_upload_many_slides;" 
     56            tal:attributes="tabindex tabindex/next;" 
     57            /> 
     58 
     59 
    4760 
    4861       <tal:chapters repeat="chapter value"> 
Note: See TracChangeset for help on using the changeset viewer.