Changeset 535


Ignore:
Timestamp:
07/28/06 18:26:43 (13 years ago)
Author:
vahur
Message:

fixing piece upload

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/FieldsWidgets.py

    r518 r535  
    321321            if v and v.filename: 
    322322                id = instance.generateUniqueId('Piece') 
    323                 new_id = instance.content.invokeFactory('Piece', id, title=instance.Title()+'-image') 
     323                portal_url = getToolByName(instance, 'portal_url') 
     324                new_id = portal_url.getPortalObject().content.invokeFactory('Piece', id, title=instance.Title()+'-image') 
    324325                new_piece = getattr(instance.content, new_id) 
    325326                uid = new_piece.UID() 
    326327                new_piece.edit(image=v, file=v, language='') 
    327328                new_values.append(uid) 
     329                 
     330                req = instance.REQUEST 
     331                ff = instance.getField('bodyText') 
     332                edit_chapter = req.get('edit_chapter', 1001) 
     333                ff.setPieces(instance, uid, int(edit_chapter)) 
    328334        old_values = value 
    329335        value = new_values 
  • trunk/PresentationMaterial.py

    r526 r535  
    113113        req = self.REQUEST 
    114114        title = self.Title() 
     115        portal_url = getToolByName(self, 'portal_url') 
    115116        ref_tool = getToolByName(self, 'reference_catalog') 
    116117        for i in range(0, 99): 
     
    121122            if pfile: 
    122123                id = self.generateUniqueId('Piece') 
    123                 new_id = self.content.invokeFactory('Piece', id, title=title+'-slide-'+str(i+1)) 
     124                 
     125                new_id = portal_url.getPortalObject().content.invokeFactory('Piece', id, title=title+'-slide-'+str(i+1)) 
    124126                new_piece = getattr(self.content, new_id) 
    125127                uid = new_piece.UID() 
  • trunk/skins/lemill/base_edit.cpt.metadata

    r518 r535  
    1414# This is for the special image ref stuff in Material 
    1515action.success.PresentationMaterial.uploadSlide = traverse_to:string:content_edit 
    16 action.success.MultimediaMaterial.uploadSlide = traverse_to:string:content_edit 
     16action.success.MultimediaMaterial.uploadPiece = traverse_to:string:content_edit 
    1717action.success.MultimediaMaterial.add_more_textareas = traverse_to:string:content_edit 
    1818action.success.MultimediaMaterial.removePiece = traverse_to:string:content_edit 
  • trunk/skins/lemill/validate_integrity.cpy.metadata

    r518 r535  
    77[actions] 
    88action.success = redirect_to_action:string:view 
    9 action.success.MultimediaMaterial.uploadSlide = redirect_to_action:string:edit 
     9action.success.MultimediaMaterial.uploadPiece = redirect_to_action:string:edit 
    1010action.success.MultimediaMaterial.form_submit = redirect_to_action:string:metadata 
    1111action.success.PresentationMaterial.uploadSlide = redirect_to_action:string:edit 
  • trunk/skins/lemill/widget_chapter.pt

    r518 r535  
    1515            <div tal:content="structure python:field.getChapter(context, chap)"></div> 
    1616            <tal:pieces repeat="piece python:field.getPieces(context, chap, True)"> 
    17                 <p><img src="" tal:attributes="src string:${piece/absolute_url}/image" /></p> 
     17                <p><img src="" tal:attributes="src string:${piece/absolute_url}/image_large" /></p> 
    1818            </tal:pieces> 
    1919        </tal:chapters> 
Note: See TracChangeset for help on using the changeset viewer.