Ignore:
Timestamp:
02/06/07 16:15:37 (13 years ago)
Author:
jukka
Message:

Fixed #1128, refactored portlets with sane condition-statements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/skins/lemill/portlet_activity_actions.pt

    r1261 r1345  
    44<body> 
    55<div metal:define-macro="portlet" id="portlet-material-actions"  
    6         tal:define="no_edit_links here/REQUEST/version|nothing; 
    7                     path_end python:here.REQUEST['URL'].split('/')[-1]; 
    8                     is_History python:path_end=='history_view'; 
    9                     is_Translation python:path_end=='show_translations';"> 
     6        tal:define="path_end python:here.REQUEST['URL'].split('/')[-1]; 
     7                    is_History python:path_end=='history_view' or here.REQUEST.get('version',0); 
     8                    is_Translation python:path_end=='show_translations'; 
     9                    is_owner here/amIOwner; 
     10                    can_moderate here/canIModerate;"> 
    1011 
    1112<tal:visible condition="python:wf_state!='deleted'"> 
    12     <div class="tb-portlet" metal:use-macro="here/portlet_material_actions/macros/image_div"/> 
     13    <div class="tb-portlet" metal:define-macro="image_div"> 
     14        <p style="text-align: center;" tal:condition="python: is_History or is_Translation"><a href="" tal:define="myUrl python: context.absolute_url()" tal:attributes="href string: ${myUrl}/view"><img src="images/default_learningresource.png" tal:attributes="src here/getCoverImageURL; alt python:here.meta_type" style="padding: 39px 0px 29px 0px;" /></a></p> 
     15        <p style="text-align: center;" tal:condition="python: not (is_History or is_Translation)"><img src="images/default_learningresource.png" tal:attributes="src here/getCoverImageURL; alt python:here.meta_type" style="padding: 39px 0px 29px 0px;" /></p> 
     16        <tal:editable tal:condition="not:is_History"> 
     17        <ul metal:define-slot="image_edit" tal:condition="is_editable"> 
     18            <li > 
     19                <a  href="" tal:attributes="href string:${here_url}/change_coverimage"><tal:block i18n:translate="label_change_cover_image">Change cover image</tal:block>...</a> 
     20            </li> 
     21        </ul> 
     22        </tal:editable> 
     23    </div> 
    1324 
     25    <tal:history condition="is_History"> 
     26    <div class="tb-portlet" metal:use-macro="here/portlet_material_actions/macros/history_div"/> 
     27    </tal:history> 
     28     
    1429    <tal:hide condition="not:is_History"> 
    1530    <div class="tb-portlet" metal:use-macro="here/portlet_material_actions/macros/edit_div"/> 
Note: See TracChangeset for help on using the changeset viewer.