Changeset 3063 for trunk


Ignore:
Timestamp:
10/25/10 18:00:39 (9 years ago)
Author:
jukka
Message:

Fixes in community front page.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LeMillCatalogTool.py

    r3061 r3063  
    463463            keywords['getState']=keywords['state'] 
    464464            del keywords['state'] 
     465        if 'country' in keywords: 
     466            keywords['getLocation_country']=keywords['country'] 
    465467        if 'type' in keywords: 
    466468            if keywords['type']=='lr': 
     
    499501            if 'base' in keywords and keywords['base']=='language': 
    500502                found=True                 
    501             else: 
    502                 for compensating in ['SearchableText','listCreators','getTarget_group','getTags','getSubject_area','created','getLatestEdit']: 
     503            elif 'portal_type' in keywords and ('MemberFolder' in keywords['portal_type'] or 'GroupBlog' in keywords['portal_type']): 
     504                found=True 
     505            else: 
     506                for compensating in ['SearchableText','listCreators','getTarget_group','getTags','getSubject_area','created','getLatestEdit', 'getLocation_country']: 
    503507                    if compensating in keywords: 
    504508                        found=True 
     
    761765            title_cloud=False 
    762766            if base=='language': 
    763                 link_root='%s?language=' % link_base         
     767                link_root='%s?language=' % link_base 
    764768                cloud_index='Language' 
     769                if 'type' in src: 
     770                    if 'GroupBlog' in src['type'] or 'MemberFolder' in src['type']: 
     771                        cloud_index='getLanguage_skills'      
    765772            elif base=='tags': 
    766773                link_root='%s?%stags=' % (link_base, lang_part)        
     
    772779                link_root='%s?%starget_group=' % (link_base, lang_part)        
    773780                cloud_index='getTarget_group' 
     781            elif base=='country': 
     782                link_root='%s?%scountry=' % (link_base, lang_part) 
     783                cloud_index='getLocation_country' 
    774784            elif base=='title': 
    775785                resultlist=self.fastMetadata(results, ('sortable_title','getScore','getNicename', 'path'), cut=100) 
     
    804814    ########### Front page top lists ############ 
    805815     
    806     def getTopFive(self, results=None, key_index=None, link_body='', clean=False): 
     816    def getTopFive(self, results=None, key_index=None, link_body='', clean=False, cache_key=''): 
    807817        """ Returns top five results for key_index (getTags, getSubject_area...) for certain language """ 
    808818        if clean or not hasattr(self, 'top5results'): 
    809819            self.top5results={'content':{}, 'methods':{}, 'tools':{}, 'community':{}} 
    810820        data=self.top5results 
     821        cache_key=cache_key or key_index 
    811822        path=self.REQUEST['ACTUAL_URL'].split('/') 
    812823        for section in ['content','methods','tools','community',None]: 
     
    816827            return [] 
    817828        ilanguage=getToolByName(self, 'portal_languages').getLanguageCookie() or 'en' 
    818         if key_index in data[section]: 
    819             top5lists=data[section][key_index] 
     829        if cache_key in data[section]: 
     830            top5lists=data[section][cache_key] 
    820831        else: 
    821832            top5lists={} 
    822             data[section][key_index]=top5lists 
     833            data[section][cache_key]=top5lists 
    823834        if ilanguage in top5lists: 
    824835            return top5lists[ilanguage] 
  • trunk/skins/lemill/lemill_community_view.pt

    r3061 r3063  
    3232        <dt><a i18n:translate="label_languages" href="cloud?base=language&amp;type=MemberFolder">Languages</a></dt> 
    3333        <dd><span tal:repeat="result context/top3people_languages | nothing"> 
    34             <a href="" tal:attributes="href python:'browse?language=%s' % here.url_quote(result)" tal:content="python:here.script_getPrettyLanguage(result)">PLACEHOLDER</a>, </span><a href="rebuildTop3s" tal:condition="context/amIManager">( rebuild top results )</a><a href="cloud?base=language">...</a> 
     34            <a href="" tal:attributes="href python:'browse?language=%s' % here.url_quote(result)" tal:content="python:here.script_getPrettyLanguage(result)">PLACEHOLDER</a>, </span><a href="rebuildTop3s" tal:condition="context/amIManager">( rebuild top results )</a><a href="cloud?base=language&amp;type=MemberFolder">...</a> 
    3535        </dd> 
    3636        <dt><a i18n:translate="label_country" href="" tal:attributes="href string:cloud?type=MemberFolder&amp;base=country">Country</a></dt> 
     
    5252        <dt><a i18n:translate="label_languages" href="cloud?base=language&amp;type=GroupBlog">Languages</a></dt> 
    5353        <dd><span tal:repeat="result context/top3group_languages | nothing"> 
    54             <a href="" tal:attributes="href python:'browse?language=%s' % here.url_quote(result)" tal:content="python:here.script_getPrettyLanguage(result)">PLACEHOLDER</a>, </span><a href="rebuildTop3s" tal:condition="context/amIManager">( rebuild top results )</a><a href="cloud?base=language">...</a> 
     54            <a href="" tal:attributes="href python:'browse?type=GroupBlog&amp;language=%s' % here.url_quote(result)" tal:content="python:here.script_getPrettyLanguage(result)">PLACEHOLDER</a>, </span><a href="rebuildTop3s" tal:condition="context/amIManager">( rebuild top results )</a><a href="cloud?base=language&amp;type=GroupBlog">...</a> 
    5555        </dd> 
    5656        <dt><a i18n:translate="label_subject_areas" href="" tal:attributes="href string:cloud?type=GroupBlog&amp;base=subject_area">Subject areas</a></dt> 
    57         <dd><span tal:repeat="result python:context.portal_catalog.getTopFive(results,'getSubject_area', 'browse?type=GroupBlog&amp;subject_area=')"> 
     57        <dd><span tal:repeat="result python:context.portal_catalog.getTopFive(results,'getSubject_area', 'browse?type=GroupBlog&amp;subject_area=', cache_key='group_subjects')"> 
    5858                <a href="" tal:attributes="href python:result[1]" tal:content="python:result[0]" i18n:translate="">PLACEHOLDER</a>, 
    5959            </span><a href="" tal:attributes="href string:cloud?type=GroupBlog&amp;base=subject_area">...</a> 
  • trunk/skins/lemill/member_view.cpt

    r3057 r3063  
    8383     
    8484            </tal:portfolio_samples> 
     85          <div class="clear"></div> 
    8586 
    8687            <h2 i18n:translate="label_about_me">About me</h2> 
    8788            <p tal:condition="biography" tal:replace="structure python:context.lemill_tool.parse_text(str(biography))"></p>  
     89            <p tal:condition="python: subjectarea"><tal:block i18n:translate="label_subject_areas">Subject areas</tal:block>: 
     90            <span tal:repeat="subject subjectarea" tal:omit-tag=""> 
     91                <a href="#" tal:attributes="href string:$members_url/browse?subject_area=${subject_short}" tal:define="subject_short python:subject.split()[0].lower()" i18n:translate="" tal:content="subject">PLACEHOLDER</a><span tal:condition="not: repeat/subject/end" tal:omit-tag="">, </span>  
     92            </span> 
     93            </p> 
     94 
    8895            <p tal:condition="python: location_country and location_country!='No country specified'"><tal:block i18n:translate="label_country">Country</tal:block>: 
    89             <a href="#" tal:attributes="href string:$members_url/country?location=${location_country}" tal:content="location_country">Country</a> 
     96            <a href="#" tal:attributes="href string:$members_url/browse?country=${location_country}" tal:content="location_country">Country</a> 
    9097            </p> 
    9198            <p tal:condition="location_area"><tal:block i18n:translate="label_area">Area</tal:block>: 
     
    94101            <p tal:condition="language_skills"><tal:block i18n:translate="label_language_skills">Preferred languages</tal:block>: 
    95102            <span tal:repeat="languagename language_skills" tal:omit-tag=""> 
    96                 <a href="#" tal:attributes="href string:$members_url/language?language_skills=${languagename}" tal:content="python:here.script_getPrettyLanguage(languagename)">PLACEHOLDER</a><span tal:condition="not: repeat/languagename/end" tal:omit-tag="">, </span>  
     103                <a href="#" tal:attributes="href string:$members_url/browse?language=${languagename}" tal:content="python:here.script_getPrettyLanguage(languagename)">PLACEHOLDER</a><span tal:condition="not: repeat/languagename/end" tal:omit-tag="">, </span>  
    97104            </span> 
    98105            </p> 
Note: See TracChangeset for help on using the changeset viewer.