Changeset 1957


Ignore:
Timestamp:
08/20/07 14:33:41 (12 years ago)
Author:
jukka
Message:

Created cached versions for expensive top3-lists in section front pages. Metadata-files assign these scripts to RAMCache.

Location:
trunk/skins/lemill
Files:
8 added
4 edited

Legend:

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

    r1751 r1957  
    55<body> 
    66 
    7 <div metal:fill-slot="main" style="width:100%" tal:define="search_results python:here.getSearchObject(portal_type='Activity')"> 
     7<div metal:fill-slot="main" style="width:100%" tal:define="cached here/cached_section_methods; 
     8         search_results cached/search_results"> 
    89 
    910    <span tal:define="samples python:here.getSamples(search_results);" tal:condition="samples" tal:omit-tag=""> 
     
    3233     
    3334    <ul> 
    34         <li tal:define="results python:here.getTopResults(search_results, 'Language')"> 
     35        <li> 
    3536            <a i18n:translate="label_browse_by_language" href="language" class="byTextsFont">By language</a>: 
    36             <span tal:repeat="result results"> 
     37            <span tal:repeat="result cached/top3languages"> 
    3738                <a href="" tal:attributes="href python:'language?Language='+here.url_quote(result)" tal:content="python:here.script_getPrettyLanguage(result)">PLACEHOLDER</a>, 
    3839            </span> 
     
    4445        </li> 
    4546 
    46         <li tal:define="results python:here.getTopResults(search_results, 'getTags')"> 
     47        <li> 
    4748            <a i18n:translate="label_browse_by_tags" href="tags" class="byTextsFont">By tags</a>: 
    48             <span tal:repeat="result results"> 
     49            <span tal:repeat="result cached/top3tags"> 
    4950                <a href="" tal:attributes="href python:'tags?getTags='+here.url_quote(result)" tal:content="result">PLACEHOLDER</a>, 
    5051            </span> 
  • trunk/skins/lemill/lemill_community_view.pt

    r1919 r1957  
    55<body> 
    66 
    7 <div metal:fill-slot="main" style="width:100%" tal:define="people_results python:here.getSearchObject(portal_type='MemberFolder'); 
    8                         group_results python:here.getSearchObject(portal_type='GroupBlog');  
    9                         search_results python:people_results+group_results;"> 
     7<div metal:fill-slot="main" style="width:100%" tal:define="cached here/cached_section_community; 
     8         search_results cached/search_results"> 
    109     
    1110   <span tal:define="samples python:here.getSamples(search_results);" tal:condition="samples" tal:omit-tag=""> 
     
    3231     
    3332    <ul> 
    34         <li tal:define="results python:here.getTopResults(people_results, 'getLanguage_skills')"> 
     33        <li> 
    3534            <a i18n:translate="label_browse_by_language" href="language" class="byTextsFont">By language</a>: 
    36             <span tal:repeat="result results"> 
     35            <span tal:repeat="result cached/top3languages_people"> 
    3736                <a href="" tal:attributes="href python:'language?getLanguage_skills='+here.url_quote(result)" tal:content="python:here.script_getPrettyLanguage(result)">PLACEHOLDER</a>, 
    3837            </span> 
     
    4443        </li> 
    4544         
    46         <li tal:define="results python:here.getTopResults(people_results, 'getLocation_country')"> 
     45        <li> 
    4746            <a i18n:translate="label_browse_by_location" href="country" class="byTextsFont">By location</a>: 
    48             <span tal:repeat="result results"> 
     47            <span tal:repeat="result cached/top3countries"> 
    4948                <a href="" tal:attributes="href python:'country?getLocation_country='+here.url_quote(result)" tal:content="result">PLACEHOLDER</a>, 
    5049            </span> 
     
    5251        </li> 
    5352 
    54         <li tal:define="results python:here.getTopResults(people_results, 'getSkills')"> 
     53        <li> 
    5554            <a i18n:translate="label_browse_by_skills" href="skills" class="byTextsFont">By skills</a>: 
    56             <span tal:repeat="result results"> 
     55            <span tal:repeat="result cached/top3skills"> 
    5756                <a href="" tal:attributes="href python:'skills?getSkills='+here.url_quote(result)" tal:content="result">PLACEHOLDER</a>, 
    5857            </span> 
     
    6059        </li> 
    6160 
    62         <li tal:define="results python:here.getTopResults(people_results, 'getInterests')"> 
     61        <li> 
    6362            <a i18n:translate="label_browse_by_interests" href="interests" class="byTextsFont">By interests</a>: 
    64             <span tal:repeat="result results"> 
     63            <span tal:repeat="result cached/top3interests"> 
    6564                <a href="" tal:attributes="href python:'interests?getInterests='+here.url_quote(result)" tal:content="result">PLACEHOLDER</a>, 
    6665            </span> 
     
    6867        </li> 
    6968         
    70         <li tal:define="results python:here.getTopResults(people_results, 'getSubject_area')"> 
     69        <li> 
    7170            <a i18n:translate="label_browse_by_subject_area" href="subject_area" class="byTextsFont">By subject area</a>: 
    72             <span tal:repeat="result results"> 
     71            <span tal:repeat="result cached/top3subject_areas_people"> 
    7372                <a href="" tal:attributes="href python:'subject_area?getSubject_area='+here.url_quote(result)" tal:content="result" i18n:translate="">PLACEHOLDER</a>, 
    7473            </span> 
     
    8180     
    8281    <ul> 
    83         <li tal:define="results python:here.getTopResults(group_results, 'getLanguage_skills')"> 
     82        <li> 
    8483            <a i18n:translate="label_browse_by_language" href="g_language" class="byTextsFont">By language</a>: 
    85             <span tal:repeat="result results"> 
     84            <span tal:repeat="result cached/top3languages_groups"> 
    8685                <a href="" tal:attributes="href python:'g_language?getLanguage_skills='+here.url_quote(result)" tal:content="python:here.script_getPrettyLanguage(result)">PLACEHOLDER</a>, 
    8786            </span> 
     
    9392        </li> 
    9493 
    95         <li tal:define="results python:here.getTopResults(group_results, 'getTags')"> 
     94        <li> 
    9695            <a i18n:translate="label_browse_by_tags" href="tags" class="byTextsFont">By tags</a>: 
    97             <span tal:repeat="result results"> 
     96            <span tal:repeat="result cached/top3tags"> 
    9897                <a href="" tal:attributes="href python:'tags?getTags='+here.url_quote(result)" tal:content="result">PLACEHOLDER</a>, 
    9998            </span> 
     
    101100        </li> 
    102101             
    103         <li tal:define="results python:here.getTopResults(group_results, 'getSubject_area')"> 
     102        <li> 
    104103            <a i18n:translate="label_browse_by_subject_area" href="group_subject_area" class="byTextsFont">By subject area</a>:  
    105             <span tal:repeat="result results"> 
     104            <span tal:repeat="result cached/top3subject_areas_groups"> 
    106105                <a href="" tal:attributes="href python:'group_subject_area?getSubject_area='+here.url_quote(result)" tal:content="result" i18n:translate="">PLACEHOLDER</a>, 
    107106            </span> 
  • trunk/skins/lemill/lemill_content_view.pt

    r1777 r1957  
    55<body> 
    66 
    7 <div metal:fill-slot="main" style="width:100%" tal:define="piece_results python:here.getSearchObject(portal_type='Piece'); 
    8          material_results python:here.getSearchObject(portal_type=context.getMaterialTypes()); 
    9          search_results python:piece_results+material_results"> 
     7<div metal:fill-slot="main" style="width:100%" tal:define="cached here/cached_section_content; 
     8         material_results cached/material_results"> 
    109 
    1110    <h1 i18n:translate="heading_featured_content">Featured content</h1> 
     
    3029     
    3130    <ul> 
    32         <li tal:define="results python:here.getTopResults(search_results, 'Language')"> 
     31        <li> 
    3332            <a i18n:translate="label_browse_by_language" href="language" class="byTextsFont">By language</a>: 
    34             <span tal:repeat="result results"> 
     33            <span tal:repeat="result cached/top3languages"> 
    3534                <a href="" tal:attributes="href python:'language?Language=%s' % here.url_quote(result)" tal:content="python:here.script_getPrettyLanguage(result)">PLACEHOLDER</a>, 
    3635            </span> 
     
    4241        </li> 
    4342         
    44         <li tal:define="results python:here.getTopResults(material_results, 'getSubject_area')"> 
     43        <li> 
    4544            <a i18n:translate="label_browse_by_subject_area" href="subject_area" class="byTextsFont">By subject area</a>: 
    46             <span tal:repeat="result results"> 
     45            <span tal:repeat="result cached/top3subject_areas"> 
    4746                <a href="" tal:attributes="href python:'subject_area?getSubject_area=%s' % here.url_quote(result)" tal:content="result" i18n:translate="">PLACEHOLDER</a>, 
    4847            </span> 
     
    5049        </li> 
    5150 
    52         <li tal:define="results python:here.getTopResults(material_results, 'getTarget_group')"> 
     51        <li> 
    5352            <a i18n:translate="label_browse_by_target_group" href="target_group" class="byTextsFont">By target group</a>: 
    54             <span tal:repeat="result results"> 
     53            <span tal:repeat="result cached/top3target_groups"> 
    5554                <a href="" tal:attributes="href python:'target_group?getTarget_group=%s' % here.url_quote(result)" tal:content="result" i18n:translate="">PLACEHOLDER</a>, 
    5655            </span> 
     
    5857        </li> 
    5958         
    60         <li tal:define="results python:here.getTopResults(search_results, 'getTags')"> 
     59        <li> 
    6160            <a i18n:translate="label_browse_by_tags" href="tags" class="byTextsFont">By tags</a>: 
    62             <span tal:repeat="result results"> 
     61            <span tal:repeat="result cached/top3tags"> 
    6362                <a href="" tal:attributes="href python:'tags?getTags=%s' % here.url_quote(result)" tal:content="result">PLACEHOLDER</a>, 
    6463            </span> 
  • trunk/skins/lemill/lemill_tools_view.pt

    r1751 r1957  
    55<body> 
    66 
    7 <div metal:fill-slot="main" style="width:100%" tal:define="search_results python:here.getSearchObject(portal_type='Tool')"> 
     7<div metal:fill-slot="main" style="width:100%" tal:define="cached here/cached_section_tools; 
     8         search_results cached/search_results"> 
    89 
    910    <span tal:define="samples python:here.getSamples(search_results);" tal:condition="samples" tal:omit-tag=""> 
     
    1718     
    1819    <ul> 
    19         <li tal:define="results python:here.getTopResults(search_results, 'Language')"> 
     20        <li> 
    2021            <a i18n:translate="label_browse_by_language" href="language" class="byTextsFont">By language</a>: 
    21             <span tal:repeat="result results"> 
     22            <span tal:repeat="result cached/top3languages"> 
    2223                <a href="" tal:attributes="href python:'language?Language='+here.url_quote(result)" tal:content="python:here.script_getPrettyLanguage(result)">PLACEHOLDER</a>, 
    2324            </span> 
     
    2930        </li> 
    3031             
    31         <li tal:define="results python:here.getTopResults(search_results, 'getTags')"> 
     32        <li> 
    3233            <a i18n:translate="label_browse_by_tags" href="tags" class="byTextsFont">By tags</a>: 
    33             <span tal:repeat="result results"> 
     34            <span tal:repeat="result cached/top3tags"> 
    3435                <a href="" tal:attributes="href python:'tags?getTags='+here.url_quote(result)" tal:content="result">PLACEHOLDER</a>, 
    3536            </span> 
Note: See TracChangeset for help on using the changeset viewer.