Changeset 1705


Ignore:
Timestamp:
05/04/07 15:39:09 (12 years ago)
Author:
jukka
Message:

Worked on #1341, spent 4h. Collections and mmedia/presentation/pilotmaterials recognize deleted content and won't show empty instead

or with collections message DELETED next to link. We need placeholder images instead of empty spaces, finish the ticket when agreed
on them.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/ConfigurationMethods.py

    r1704 r1705  
    178178    folder = getattr(portal,trash_folder.lower()) 
    179179    folder.manage_permission(ADD_CONTENT_PERMISSION, ('Member',), acquire=1) 
    180     folder.manage_permission(LIST_FOLDER_CONTENTS, ('Member',), acquire=1) 
    181     folder.manage_permission(ADD_TOPICS, ('Member',), acquire=1) 
    182     folder.manage_permission('View', ('Manager', 'Anonymous',), acquire=1) 
    183180 
    184181def setupGroups(self, portal): 
  • trunk/LeMillReference.py

    r1695 r1705  
    170170        return False 
    171171 
    172     def pretty_title_or_id(self): 
    173         """Return modified title.""" 
    174         return '[R] ' + self.Title() 
    175  
    176172    def manage_afterAdd(self, item, container): 
    177173        Material.manage_afterAdd(self, item, container) 
  • trunk/Piece.py

    r1684 r1705  
    222222        elif self.isMovie(): 
    223223            return 'images/default_movieclip.png' 
     224        elif self.isImage(): 
     225            return 'images/default_learningresource.png' # img for deleted piece missing 
    224226        else: 
    225227            # images should always have coverimages and this method shouldn't even get called 
  • trunk/skins/lemill/collection_edit.cpt

    r1686 r1705  
    158158        <table width="100%" border="0" cellpadding="4" cellspacing="0"> 
    159159            <tr tal:repeat="obj resources"> 
     160               <tal:defines define="start repeat/obj/start; 
     161                                   end repeat/obj/end; 
     162                                   deleted python:context.portal_workflow.getInfoFor(obj,'review_state',None) == 'deleted'"> 
    160163                <td class="coverimage_cell_small"><img src="" alt="" class="coverimage_small" tal:attributes="src obj/getCoverImageURL; alt obj/title_or_id | nothing" /></td> 
    161                         <td><a href="" tal:attributes="href obj/absolute_url" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a></td> 
     164                        <td> 
     165                        <a href="" tal:attributes="href obj/absolute_url" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a> 
     166                         <span tal:condition="deleted" i18n:translate="deleted_object_marker">DELETED</span> 
     167                        </td> 
    162168                  
    163169                    <td width="270" align="right"> 
    164                     <a href="" tal:condition="not:repeat/obj/start" tal:attributes="href python:'%s/moveUpContent?objid=%s' % (here.absolute_url(), obj.id)" i18n:translate="label_move_up">Move up</a><span tal:condition="repeat/obj/start" i18n:translate="label_move_up">Move up</span> | 
    165                     <a href="" tal:condition="not:repeat/obj/end" tal:attributes="href python:'%s/moveDownContent?objid=%s' % (here.absolute_url(), obj.id)" i18n:translate="label_move_down">Move down</a><span tal:condition="repeat/obj/end" i18n:translate="label_move_down">Move down</span> | 
     170                    <a href="" tal:condition="python: not start and not deleted" tal:attributes="href python:'%s/moveUpContent?objid=%s' % (here.absolute_url(), obj.id)" i18n:translate="label_move_up">Move up</a><span tal:condition="python:start or deleted" i18n:translate="label_move_up">Move up</span> | 
     171                    <a href="" tal:condition="python: not end and not deleted" tal:attributes="href python:'%s/moveDownContent?objid=%s' % (here.absolute_url(), obj.id)" i18n:translate="label_move_down">Move down</a><span tal:condition="python:end or deleted" i18n:translate="label_move_down">Move down</span> | 
    166172                    <a href="" tal:attributes="href python:'%s/delContent?objid=%s' % (here.absolute_url(), obj.id)" i18n:translate="" i18n:domain="plone">Delete</a> 
    167173                    </td> 
    168                  
     174               </tal:defines> 
    169175            </tr> 
    170176        </table> 
  • trunk/skins/lemill/collection_view.cpt

    r1669 r1705  
    3030            <tr tal:repeat="obj resources"> 
    3131                <td class="coverimage_cell_small"><img src="" alt="" class="coverimage_small" tal:attributes="src obj/getCoverImageURL; alt obj/title_or_id | nothing" /></td> 
    32                         <td><a href="" tal:attributes="href obj/absolute_url" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a></td> 
    33                 <!--tal:editing_allowed tal:condition="isOwner">  
    34                     <td class="button_cell" ><a href="" tal:condition="not:repeat/obj/start" tal:attributes="href python:'%s/moveUpContent?objid=%s' % (here.absolute_url(), obj.id)"><img src="images/button_move_up.png" alt="Move up" /></a></td> 
    35                     <td class="button_cell" ><a href="" tal:condition="not:repeat/obj/end" tal:attributes="href python:'%s/moveDownContent?objid=%s' % (here.absolute_url(), obj.id)"><img src="images/button_move_down.png" alt="Move down" /></a></td> 
    36                     <td class="button_cell"><a href="" tal:attributes="href python:'%s/delContent?objid=%s' % (here.absolute_url(), obj.id)"><img src="images/button_remove.png" alt="Remove from collection" /></a></td> 
    37                 </tal:editing_allowed--> 
     32                        <td><a href="" tal:attributes="href obj/absolute_url" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a> 
     33                         <span tal:condition="python:context.portal_workflow.getInfoFor(obj,'review_state',None) == 'deleted'" i18n:translate="deleted_object_marker">DELETED</span>                         
     34                        </td> 
    3835            </tr> 
    3936        </table> 
     
    4542            <tr tal:repeat="obj resources"> 
    4643                <td class="coverimage_cell_small"><img src="" alt="" class="coverimage_small" tal:attributes="src obj/getCoverImageURL; alt obj/title_or_id | nothing" /></td> 
    47                         <td><a href="" tal:attributes="href obj/absolute_url" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a></td> 
    48                 <!--tal:editing_allowed tal:condition="isOwner">  
    49                     <td class="button_cell" /> 
    50                     <td class="button_cell" /> 
    51                     <td class="button_cell"><a href="" tal:attributes="href python:'%s/delMethods?objid=%s' % (here.absolute_url(), obj.id)"><img src="images/button_remove.png" alt="Remove from collection" /></a></td> 
    52                 </tal:editing_allowed--> 
     44                        <td><a href="" tal:attributes="href obj/absolute_url" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a> 
     45                         <span tal:condition="python:context.portal_workflow.getInfoFor(obj,'review_state',None) == 'deleted'" i18n:translate="deleted_object_marker">DELETED</span>                         
     46                        </td> 
    5347            </tr> 
    5448        </table> 
     
    6054            <tr tal:repeat="obj resources"> 
    6155                <td class="coverimage_cell_small"><img src="" alt="" class="coverimage_small" tal:attributes="src obj/getCoverImageURL; alt obj/title_or_id | nothing" /></td> 
    62                         <td><a href="" tal:attributes="href obj/absolute_url" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a></td> 
    63                 <!--tal:editing_allowed tal:condition="isOwner">  
    64                     <td class="button_cell" /> 
    65                     <td class="button_cell" /> 
    66                     <td class="button_cell"><a href="" tal:attributes="href python:'%s/delTools?objid=%s' % (here.absolute_url(), obj.id)"><img src="images/button_remove.png" alt="Remove from collection" /></a></td> 
    67                 </tal:editing_allowed--> 
     56                        <td><a href="" tal:attributes="href obj/absolute_url" tal:content="obj/title_or_id">Media Computer - From Math to Augmentation</a> 
     57                         <span tal:condition="python:context.portal_workflow.getInfoFor(obj,'review_state',None) == 'deleted'" i18n:translate="deleted_object_marker">DELETED</span>                         
     58                        </td> 
    6859            </tr> 
    6960        </table> 
  • trunk/skins/lemill/find_related_stories.py

    r1391 r1705  
    2222    'sort_order': 'descending'} 
    2323results = portal_catalog.searchResults(query) 
     24results = [x for x in results if x.review_state!='deleted'] 
    2425return results 
  • trunk/skins/lemill/slideshow_view.pt

    r1515 r1705  
    104104           <div class="imageElement" tal:define="piece python:field.getObjectByUID(context,slica[0]); 
    105105                                        pieceurl piece/image_slide/absolute_url | nothing; 
    106                                         thumburl piece/image_small/absolute_url | nothing;"> 
     106                                        thumburl piece/image_small/absolute_url | nothing; 
     107                                        deleted context.portal_workflow.getInfoFor(piece,'review_state',None) == 'deleted'"> 
    107108                <h3 tal:content="python:slica[1]" />     
    108109                <p></p>     
    109                 <a href="#" title="open image" class="open"></a> 
    110                 <img src="#" class="full" tal:attributes="src pieceurl" />         
    111                 <img src="#" class="thumbnail" tal:attributes="src thumburl" />         
     110                <a href="#" title="open image" class="open"></a> 
     111                <tal:not_deleted condition="not:deleted"> 
     112                    <img src="#" class="full" tal:attributes="src pieceurl" />         
     113                    <img src="#" class="thumbnail" tal:attributes="src thumburl" />         
     114                </tal:not_deleted> 
     115                <tal:deleted condition="deleted"> 
     116                    <img src="#" class="full" tal:attributes="src piece/getDefaultIcon" />         
     117                    <img src="#" class="thumbnail" tal:attributes="src piece/getDefaultIcon" />                                                 
     118                </tal:deleted> 
    112119           </div> 
    113120        </tal:slides> 
  • trunk/skins/lemill/widget_chapter.pt

    r1669 r1705  
    1919                <div tal:condition="UID" tal:omit-tag=""> 
    2020                <tal:inner_defs define="piece python:field.getObjectByUID(context, UID);"> 
    21                 <tal:we_got_piece condition="piece"> 
     21                <tal:we_got_piece condition="python:piece and not context.portal_workflow.getInfoFor(piece,'review_state',None) == 'deleted'"> 
    2222                <tal:image condition="piece/isImage">  
    2323                    <a href="" tal:attributes="href piece/absolute_url | here_url"> 
     
    127127 
    128128           <div tal:condition="UID" tal:omit-tag=""> 
    129             <tal:defs define="piece python:field.getObjectByUID(context,UID);"> 
    130             <tal:we_got_piece condition="piece"> 
     129            <tal:defs define="piece python:field.getObjectByUID(context,UID); 
     130            deleted python:piece and context.portal_workflow.getInfoFor(piece,'review_state',None) == 'deleted'"> 
     131            <tal:we_got_piece condition="python:piece and not deleted"> 
    131132                <tal:audio tal:condition="piece/isAudio"> 
    132133                    <div style="height:20px" class="visualClear">&nbsp;</div> 
     
    310311                                piece_uid UID | python:0; 
    311312                                piece_desc piece/getDescription | string:; 
    312                                 isAudio piece/isAudio | python:0"> 
     313                                isAudio piece/isAudio | python:0; 
     314                                deleted python:context.portal_workflow.getInfoFor(piece,'review_state',None) == 'deleted'"> 
    313315                    <div class="piece-edit-box" id="piece-edit-box" 
    314                         tal:attributes="style python:test(piece_id!=0 and not isAudio, 'background-image:url(\''+str(piece_id)+'/image_large\')', ''); 
     316                        tal:attributes="style python:test(piece_id!=0 and not isAudio and not deleted, 'background-image:url(\''+str(piece_id)+'/image_large\')', ''); 
    315317                        id python:'piece-edit-box-%s' % index; ">  
    316318                        <div style="height:20px" class="visualClear">&nbsp;</div> 
    317319 
    318                         <div style="height:50px" class="visualClear" tal:condition="isAudio"> 
     320                        <div style="height:50px" class="visualClear" tal:condition="python: isAudio and not deleted"> 
    319321                           <metal:block metal:use-macro="here/macros_audioplayer/macros/audioplayer" /> 
    320322                            <div style="height:20px" class="visualClear">&nbsp;</div> 
  • trunk/skins/lemill/widget_pilot.pt

    r1605 r1705  
    7474                </div> 
    7575                <div tal:condition="UID" tal:omit-tag=""> 
    76                  <tal:piece define="piece python:field.getObjectByUID(context,UID);"> 
    77                  <tal:haspiece condition="piece"> 
     76                 <tal:piece define="piece python:field.getObjectByUID(context,UID); 
     77                 deleted python:piece and context.portal_workflow.getInfoFor(piece,'review_state',None) == 'deleted'"> 
     78 
     79                 <tal:haspiece condition="python:piece and not deleted"> 
    7880                   <label tal:condition="piece/isImage"><tal:block i18n:translate="label_background_image">Background image</tal:block>:</label> 
    7981                    <div tal:condition="piece/isImage" class="piece-edit-box"> 
     
    9092                    <div class="visualClear" style="height:20px">&nbsp;</div> 
    9193                 </tal:haspiece> 
    92                  <tal:hasnotpiece condition="not:piece"> 
     94                 <tal:hasnotpiece condition="python: not piece or deleted"> 
    9395                    <div tal:condition="python:field.isImageUID(chapter)" class="piece-edit-box"> 
    9496                        &nbsp; 
     
    203205                <tal:defs define="piece python:field.getObjectByUID(context,UID); 
    204206                    image piece/isImage | python:field.isImageUID(UID); 
    205                     audio piece/isAudio | python:field.isAudioUID(UID); "> 
     207                    audio piece/isAudio | python:field.isAudioUID(UID); 
     208                    deleted python:context.portal_workflow.getInfoFor(piece,'review_state',None) == 'deleted' "> 
    206209 
    207210 
     
    211214 
    212215                <div class="piece-edit-box"> 
    213                   <tal:have_piece condition="piece"> 
     216                  <tal:have_piece condition="python:piece and not deleted"> 
    214217                  <img src="" tal:define="pieceurl piece/image_large/absolute_url" 
    215218                              tal:attributes="src pieceurl" /> 
     
    221224            <tal:audio condition="audio"> 
    222225              <label><tal:block i18n:translate="label_voiceover_audio">Voiceover audio</tal:block>:</label> 
    223               <tal:pieceexists condition="piece"> 
     226              <tal:pieceexists condition="python:piece and not deleted"> 
    224227              <br/> 
    225228              <metal:audioplayer use-macro="here/macros_audioplayer/macros/audioplayer"/> 
     
    263266                    image piece/isImage | python:field.isImageUID(UID); 
    264267                    audio piece/isAudio | python:field.isAudioUID(UID); "> 
     268 
    265269 
    266270            <tal:image condition="image"> 
     
    448452                                piece_uid UID | python:0; 
    449453                                piece_desc piece/getDescription | string:; 
    450                                 isAudio piece/isAudio | python:0"> 
     454                                isAudio piece/isAudio | python:0; 
     455                                deleted python:context.portal_workflow.getInfoFor(piece,'review_state',None) == 'deleted' "> 
    451456                    <div id="piece-edit-box"  
    452457                    tal:attributes="id python:'piece-edit-box-%s' % index; ">  
    453458 
    454                         <div style="height:50px" class="visualClear" tal:condition="isAudio"> 
     459                        <div style="height:50px" class="visualClear" tal:condition="python:isAudio and not deleted"> 
    455460                           <metal:block metal:use-macro="here/macros_audioplayer/macros/audioplayer" /> 
    456461 
     
    546551                                piece_id piece/getId | python:0; 
    547552                                piece_uid UID | python:0; 
    548                                 piece_desc piece/getDescription | string:"> 
     553                                piece_desc piece/getDescription | string:; 
     554                                deleted python:context.portal_workflow.getInfoFor(piece,'review_state',None) == 'deleted' "> 
    549555                    <div class="piece-edit-box" id="piece-edit-box" 
    550                         tal:attributes="style python:test(piece_id!=0, 'background-image:url(\''+str(piece_id)+'/image_large\')', ''); 
     556                        tal:attributes="style python:test(piece_id!=0 and not deleted, 'background-image:url(\''+str(piece_id)+'/image_large\')', ''); 
    551557                        id python:'piece-edit-box-%s' % index; ">  
    552558                        <div style="height:20px" class="visualClear">&nbsp;</div> 
  • trunk/skins/lemill/widget_slides.pt

    r1675 r1705  
    2020            </div> 
    2121            <div tal:condition="UID" class="presentation-edit-box"> 
    22                 <a href="" tal:condition="piece" tal:define="piece python:field.getObjectByUID(context,UID); 
    23                                         pieceurl piece/image_large/absolute_url | nothing"  
     22                <a href="" tal:condition="python:piece and not deleted" tal:define="piece python:field.getObjectByUID(context,UID); 
     23                                        pieceurl piece/image_large/absolute_url | nothing; 
     24                                        deleted python:context.portal_workflow.getInfoFor(piece,'review_state',None) == 'deleted' "  
    2425                                      tal:attributes="href piece/getURL | piece/absolute_url"> 
    2526                <img src="" tal:attributes="src pieceurl" class="media_piece" alt="piece/title_or_id" /> 
     
    272273                                piece_id piece/getId | python:0; 
    273274                                piece_uid UID | python:0; 
    274                                 piece_desc piece/getDescription | string:"> 
     275                                piece_desc piece/getDescription | string:; 
     276                                deleted python:context.portal_workflow.getInfoFor(piece,'review_state',None) == 'deleted' "> 
    275277                    <div class="piece-edit-box" id="piece-edit-box" 
    276                         tal:attributes="style python:test(piece_id!=0, 'background-image:url(\''+str(piece_id)+'/image_large\')', ''); 
     278                        tal:attributes="style python:test(piece_id!=0 and not deleted, 'background-image:url(\''+str(piece_id)+'/image_large\')', ''); 
    277279                        id python:'piece-edit-box-%s' % index; ">  
    278280                        <div style="height:20px" class="visualClear">&nbsp;</div> 
Note: See TracChangeset for help on using the changeset viewer.