Changeset 1297


Ignore:
Timestamp:
01/19/07 13:19:03 (13 years ago)
Author:
jukka
Message:

A better way to solve link paths in browse results.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SectionFolder.py

    r1285 r1297  
    299299        return "" 
    300300 
     301    def getSectionFolder(self): 
     302        """ return this """ 
     303        return self 
     304         
     305 
    301306    def getTopicLinks(self, topic, here_url, rfilter, search_url): 
    302307        """ Figures out what links should be displayed in this topic page """         
  • trunk/skins/lemill/resource_list_macro.pt

    r1293 r1297  
    77             <tal:block i18n:translate="label_tags">Tags</tal:block>: 
    88                 <tal:block tal:repeat="tag python:tags[:20]"  tal:omit-tag=""> 
    9                     <a href="#" tal:attributes="href python:obj_fine_url[:obj_fine_url.rfind('/')] + '/tags?getTags=' + tag + suffix" tal:content="tag">PLACEHOLDER</a><span tal:condition="not:repeat/tag/end" tal:omit-tag="">, </span> 
     9                    <a href="#" tal:attributes="href string:${this_section}/tags?getTags=${tag}${suffix}" tal:content="tag">PLACEHOLDER</a><span tal:condition="not:repeat/tag/end" tal:omit-tag="">, </span> 
    1010                 </tal:block> 
    1111 </metal:tag_macro> 
     
    2020     members_url context/community/members/absolute_url | nothing; 
    2121     real_obj obj/getObject; 
    22      tags obj/getTags | nothing; 
    2322     "> 
    2423 
     
    5958     <li class="browse_info" tal:condition="python:location_country or location_area"> 
    6059             <tal:block i18n:translate="label_location">Location</tal:block>: 
    61                  <a href="#" tal:attributes="href string:${portal_url}/community/country?getLocation_area=${location_area}" tal:content="location_area">Area</a><tal:comma condition="python: location_country and location_area">, </tal:comma><a href="#" tal:attributes="href string:${portal_url}/community/country?getLocation_country=${location_country}" tal:content="location_country">Country</a> 
     60                 <a href="#" tal:attributes="href string:${community_section}/country?getLocation_area=${location_area}" tal:content="location_area">Area</a><tal:comma condition="python: location_country and location_area">, </tal:comma><a href="#" tal:attributes="href string:${community_section}/country?getLocation_country=${location_country}" tal:content="location_country">Country</a> 
    6261     </li>         
    6362     <li class="browse_info" tal:condition="interests"> 
    6463         <div><tal:block i18n:translate="label_interests">Interests</tal:block>: 
    6564             <tal:block tal:repeat="interests python:interests[:20]"  tal:omit-tag=""> 
    66                 <a href="#" tal:attributes="href string:${portal_url}/community/interests?getInterests=${interests}" tal:content="interests">PLACEHOLDER</a><span tal:condition="not:repeat/interests/end" tal:omit-tag="">, </span> 
     65                <a href="#" tal:attributes="href string:${community_section}/interests?getInterests=${interests}" tal:content="interests">PLACEHOLDER</a><span tal:condition="not:repeat/interests/end" tal:omit-tag="">, </span> 
    6766             </tal:block> 
    6867         </div> 
     
    160159 
    161160     <li class="browse_info" tal:condition="showAuthor"><span i18n:translate="label_authors">Authors</span>: 
    162 <tal:loop tal:repeat="author authors" condition="not:ref_author"> 
     161        <tal:loop tal:repeat="author authors" condition="not:ref_author"> 
    163162<tal:def tal:define="homefolder python:mtool.getHomeFolder(author);homeurl homefolder/absolute_url|string:"> 
    164163<tal:cond tal:condition="homeurl"> 
     
    171170</tal:loop> 
    172171<span tal:condition="ref_author" tal:content="ref_author"></span> 
    173 </li> 
    174 <li class="browse_info" tal:condition="tags"><span metal:use-macro="here/resource_list_macro/macros/show_tags"/></li> 
    175          <li class="browse_info" tal:condition="lang"> 
    176              <tal:block i18n:domain="plone" i18n:translate="label_language">Language</tal:block>: <span tal:replace="python:here.script_getPrettyLanguage(lang)"></span></li> 
    177      <li class="browse_info"  
     172    </li> 
     173    <li class="browse_info" tal:condition="tags"><span metal:use-macro="here/resource_list_macro/macros/show_tags"/></li> 
     174    <li class="browse_info" tal:condition="lang"> 
     175        <tal:block i18n:domain="plone" i18n:translate="label_language">Language</tal:block>: <span tal:replace="python:here.script_getPrettyLanguage(lang)"></span></li> 
     176    <li class="browse_info"  
    178177         tal:condition="python:context.getId()=='recent'"> 
    179178         <tal:block i18n:domain="plone" i18n:translate="modified">Modified</tal:block>: 
    180179         <span tal:replace="modDate"></span> 
    181      </li> 
     180    </li> 
    182181    </ul> 
    183182   </div> 
     
    210209 
    211210<tal:condition define="object_list object_list | batch" condition="python:len(object_list) > 0"> 
    212 <ul id="resource_list" class="expanded"> 
     211<ul id="resource_list" class="expanded"  
     212    tal:define="this_section python:context.getSectionFolder().absolute_url(); 
     213        community_section python:'/'.join((portal_url,'community')); 
     214        content_section python:'/'.join((portal_url,'content'))"> 
    213215    <li tal:repeat="obj object_list" class="resultobject"> 
    214216    <tal:block define="obj_url obj/getURL | obj/absolute_url; 
Note: See TracChangeset for help on using the changeset viewer.