Changeset 538


Ignore:
Timestamp:
07/30/06 01:16:03 (13 years ago)
Author:
jukka
Message:

Fixed #562, spent 1,5h.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SectionFolder.py

    r536 r538  
    197197            return [] 
    198198 
    199     def getUniques(self, search_results, index_type): 
     199    def getUniques(self, search_results, index_type='Date'): 
    200200        """ Should return unique values of search results in given index, results are list of index-metadata-like tuples in alphabetical order """ 
    201201        pc = getToolByName(self, 'portal_catalog') 
     
    292292 
    293293    security.declarePublic('public_getSortCriterion') 
    294     def public_getSortCriterion(self): 
     294    def public_getSortCriterion(self,topic): 
    295295        """ Topics have this useful getSortCriterion -method, but it's available only if allowed to change content."""  
    296         return self.getSortCriterion() 
     296        if topic.hasSortCriterion(): 
     297            return topic.getSortCriterion().field 
     298        else: 
     299            return False 
    297300 
    298301class ContentFolder(SectionFolder): 
  • trunk/config.py

    r536 r538  
    112112language = {'id':'language', 'title':'Language', 'orderby':'Language', 'reversed':False} 
    113113tags = {'id':'tags', 'title':'Tags', 'orderby':'getTags', 'reversed':False} 
    114 drafts = {'id':'drafts', 'title':'My drafts', 'orderby':'Date', 'reversed':False, 'criterions':[('ATCurrentAuthorCriterion','Creator',''),('ATSelectionCriterion','review_state','draft')]} 
    115 published = {'id':'published', 'title':'My published', 'orderby':'Date', 'reversed':False, 'criterions':[('ATCurrentAuthorCriterion','Creator',''),('ATSelectionCriterion','review_state','public')]} 
     114drafts = {'id':'drafts', 'title':'My drafts', 'criterions':[('ATCurrentAuthorCriterion','Creator',''),('ATSelectionCriterion','review_state','draft')]} 
     115published = {'id':'published', 'title':'My published', 'criterions':[('ATCurrentAuthorCriterion','Creator',''),('ATSelectionCriterion','review_state','public')]} 
    116116language_skills = {'id':'language', 'title':'Language', 'orderby':'getLanguage_skills', 'reversed':False} 
    117117group_language_skills = {'id':'group_language', 'title':'Language', 'orderby':'getLanguage_skills', 'reversed':False} 
  • trunk/skins/lemill/lemill_browse_results.pt

    r528 r538  
    1515                 parent_folder python:context.aq_inner.aq_parent.title_or_id().lower(); 
    1616                 sort_order python:context.title_or_id().lower(); 
    17                  sort_order_method here/public_getSortCriterion/field | string:Date;  
     17                 sort_order_method python:here.public_getSortCriterion(here);  
    1818                 use_view_action site_properties/typesUseViewActionInListings; 
    1919                 contentFilter contentFilter|request/contentFilter|nothing; 
     
    2929 
    3030 
    31     <h1 i18n:translate="heading_browse_results"> 
    32         Browse <span i18n:name="parent"> 
    33             <span tal:omit-tag="" i18n:translate="" tal:content="parent_folder"></span> 
    34         </span> 
    35         by <span i18n:name="crit"> 
    36             <span tal:content="sort_order"></span> 
    37         </span> 
    38         : <span i18n:name="value"> 
    39             <span tal:content="python:request.get(sort_order_method)"></span> 
    40         </span> 
     31    <h1 tal:condition="python: sort_order_method!=False and searchterm!={}"> 
     32    <span i18n:translate="heading_browse_results_with_criterion_and_searchterm"> 
     33        Browse <span i18n:name="parent" tal:content="parent_folder">folder</span> 
     34            by <span i18n:name="crit" tal:content="sort_order">criterion</span> 
     35            : <span i18n:name="value" tal:content="python:searchterm.values()[0]">searchterm</span> 
     36    </span> 
    4137    </h1> 
    42     <!-- 
    43     <h1 i18n:translate="heading_browse_results" tal:content="string:Browse local $parent_folder by $sort_order">Browse local content</h1> 
    44     --> 
     38 
     39    <h1 tal:condition="python: sort_order_method and not searchterm"> 
     40    <span i18n:translate="heading_browse_results_with_criterion"> 
     41        Browse <span i18n:name="parent" tal:content="parent_folder">folder</span> 
     42            by <span i18n:name="crit" tal:content="sort_order">criterion</span> 
     43    </span> 
     44    </h1> 
     45 
     46    <h1 tal:condition="python: not sort_order_method and not searchterm"> 
     47    <span i18n:translate="heading_browse_results_plain"> 
     48        Browse <span i18n:name="parent" tal:content="sort_order">folder</span> 
     49    </span> 
     50    </h1> 
    4551 
    4652    <div tal:condition="not: results"> 
     
    5864    </p> 
    5965 
    60     <strong i18n:domain="plone" i18n:translate="batch_x_items_matching_your_criteria"> 
    61       <span i18n:name="number" tal:omit-tag="" tal:content="python:len(results)">234</span> items matching your criteria. 
    62     </strong> 
    63  
    64     <tal:syndicate condition="syntool/isSiteSyndicationAllowed"> 
    65      <a href="" tal:attributes="href string:$here_url/search_rss?${request/QUERY_STRING}"> 
    66      <img i18n:domain="plone" i18n:attributes="title title_rss_feed; alt label_rss_feed;" 
    67              tal:attributes="src string:$portal_url/rss.gif" 
    68              src="rss.gif" 
    69              alt="RSS Feed" 
    70              title="RSS feed of these search results" /> 
    71      </a> 
    72     </tal:syndicate> 
    73  
    7466    <!-- Browse by values for keywords or similar fields--> 
    7567 
    76     <div class="tagcloud" tal:condition="python: not searchterm and sort_order_method!='Date'"> 
     68    <div class="tagcloud" tal:condition="python: not searchterm and sort_order_method"> 
    7769 
    7870        <style> 
     
    110102    </div> 
    111103 
    112     <div tal:condition="python: searchterm or sort_order_method=='Date'"> 
     104    <div tal:condition="python: searchterm or not sort_order_method"> 
     105 
     106 
     107    <strong i18n:domain="plone" i18n:translate="batch_x_items_matching_your_criteria"> 
     108      <span i18n:name="number" tal:omit-tag="" tal:content="python:len(results)">234</span> items matching your criteria. 
     109    </strong> 
     110 
     111    <tal:syndicate condition="syntool/isSiteSyndicationAllowed"> 
     112     <a href="" tal:attributes="href string:$here_url/search_rss?${request/QUERY_STRING}"> 
     113     <img i18n:domain="plone" i18n:attributes="title title_rss_feed; alt label_rss_feed;" 
     114             tal:attributes="src string:$portal_url/rss.gif" 
     115             src="rss.gif" 
     116             alt="RSS Feed" 
     117             title="RSS feed of these search results" /> 
     118     </a> 
     119    </tal:syndicate> 
     120 
    113121        <span tal:define="batch python:Batch(results, b_size, int(b_start), orphan=1); 
    114122                          link_pref string:$here_url/tags?getTags="> 
Note: See TracChangeset for help on using the changeset viewer.