Changeset 528


Ignore:
Timestamp:
07/28/06 15:32:34 (13 years ago)
Author:
jukka
Message:

Fixed #554, spent 1h. There is now more topics (smart folders) under every section: content/pieces contains all pieces, content/contents all contents, content/materials all materials etc. Calling them with extra arguments makes nice browsing: for example community/members/?getLocation_country=Finland gives members from finland.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ConfigurationMethods.py

    r509 r528  
    330330                    folder = getattr(portal, foldername.lower()) 
    331331                    for topic_conf in generated_topics: 
    332                         # Create topics 
     332                        # Create topics with specific queries 
    333333                        if hasattr(folder.aq_base, topic_conf['id']): 
    334334                            folder._delObject(topic_conf['id']) 
    335                             #print "deleted %s" % topic_conf['id'] 
    336335                        addObject(folder, topic_conf['id'], 'Topic', topic_conf['title']) 
    337                         #print 'Created topic '+topic_conf['id']+' in '+str(folder) 
    338336                        # Set up properties for topics 
    339337                        topic = getattr(folder, topic_conf['id']) 
  • trunk/LeMillTool.py

    r418 r528  
    3535    toolicon = 'skins/lemill/tool.gif' 
    3636    __allow_access_to_unprotected_subobjects__ = 1 
    37  
    38  
    39     security.declarePublic('public_getSortCriterion') 
    40     def public_getSortCriterion(self, topic): 
    41         """ Topics have this useful getSortCriterion -method, but it's available only if allowed to change content. Publicize it."""  
    42         return topic.getSortCriterion() 
    4337 
    4438    security.declarePublic('createUniqueGroupId') 
  • trunk/SectionFolder.py

    r527 r528  
    2727from DateTime import DateTime 
    2828import re, datetime 
     29from AccessControl import ClassSecurityInfo 
     30 
    2931 
    3032communityschema= ATFolderSchema + Schema(( 
     
    4547    archetype_name = "Section Folder" 
    4648    meta_type = "Section Folder" 
    47  
     49    security = ClassSecurityInfo() 
     50     
    4851    # Override initializeArchetype to turn on syndication by default 
    4952    def initializeArchetype(self, **kwargs): 
     
    295298        return str(result) 
    296299 
     300    security.declarePublic('public_getSortCriterion') 
     301    def public_getSortCriterion(self): 
     302        """ Topics have this useful getSortCriterion -method, but it's available only if allowed to change content."""  
     303        return self.getSortCriterion() 
     304 
    297305class ContentFolder(SectionFolder): 
    298306 
  • trunk/config.py

    r509 r528  
    124124SECTION_TOPICS = { 
    125125    'Activities': 
    126     [(('Activity',), (age_group, language, tags, drafts, published))], 
     126    [(('Activity',), (age_group, language, tags, drafts, published, {'id':'activities', 'title':'Activities'}))], 
    127127    'Tools': 
    128     [(('Tool',), (language, tags, drafts, published))], 
     128    [(('Tool',), (language, tags, drafts, published,{'id':'tools', 'title':'Tools'}))], 
    129129    'Content': 
    130     [(CONTENT_TYPES, (language, tags, published)), 
    131     (MATERIAL_TYPES, (age_group, drafts))], 
     130    [(CONTENT_TYPES, (language, tags, published, {'id':'content', 'title':'Content'})), 
     131    (MATERIAL_TYPES, (age_group, drafts,  {'id':'materials', 'title':'Materials'})), (('Piece',), ({'id':'pieces', 'title':'Pieces'},))], 
    132132    'Community': 
    133     [(('GroupBlog',), (group_name_topic, tags, group_language_skills)), 
    134     (('MemberFolder',), (language_skills, name_topic, location_topic, skills, interests))] 
     133    [(('GroupBlog',), (group_name_topic, tags, group_language_skills,  {'id':'groups', 'title':'Groups'})), 
     134    (('MemberFolder',), (language_skills, name_topic, location_topic, skills, interests,  {'id':'members', 'title':'Members'}))] 
    135135} 
    136136 
  • trunk/skins/lemill/lemill_browse_results.pt

    r520 r528  
    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 python: context.lemill_tool.public_getSortCriterion(here).field or 'Date';  
     17                 sort_order_method here/public_getSortCriterion/field | string:Date;  
    1818                 use_view_action site_properties/typesUseViewActionInListings; 
    1919                 contentFilter contentFilter|request/contentFilter|nothing; 
  • trunk/skins/lemill/member_view.pt

    r524 r528  
    7575                interests member_folder/getInterests | nothing; 
    7676                biography member_folder/getBiography | nothing; 
    77                 activity_score member_folder/getActivity_score | nothing"> 
     77                activity_score member_folder/getActivity_score | nothing; 
     78                members_url context/community/members/absolute_url | nothing;"> 
    7879 
    7980            <a name="documentContent"></a> 
     
    148149                <span tal:condition="python: location_country and location_country!='No country specified'" tal:omit-tag=""> 
    149150                    <p><tal:block i18n:translate="label_country">Country</tal:block>: 
    150                         <a href="#" tal:attributes="href string:$here_url/search?SearchableText=${location_country}&amp;portal_type=MemberFolder" tal:content="location_country">Country</a> 
     151                        <a href="#" tal:attributes="href string:$members_url/?getLocation_country=${location_country}" tal:content="location_country">Country</a> 
    151152                    </p> 
    152153                </span> 
     
    154155                <span tal:condition="location_area" tal:omit-tag=""> 
    155156                    <p><tal:block i18n:translate="label_area">Area</tal:block>: 
    156                         <a href="#" tal:attributes="href string:$here_url/search?SearchableText=${location_area}&amp;portal_type=MemberFolder" tal:content="location_area">Area</a> 
     157                        <a href="#" tal:attributes="href string:$members_url/?getLocation_area=${location_area}" tal:content="location_area">Area</a> 
    157158                    </p> 
    158159                </span> 
     
    161162                    <p><tal:block i18n:translate="label_language_skills">Preferred languages</tal:block>: 
    162163                        <span tal:repeat="languagename language_skills" tal:omit-tag=""> 
    163                            <a href="#" tal:attributes="href string:$here_url/search?getLanguage_skills=${languagename}&amp;portal_type=MemberFolder" tal:content="python:here.script_getPrettyLanguage(languagename)">PLACEHOLDER</a> 
     164                           <a href="#" tal:attributes="href string:$members_url/?getLanguage_skills=${languagename}" tal:content="python:here.script_getPrettyLanguage(languagename)">PLACEHOLDER</a> 
    164165                           <span tal:condition="not: repeat/languagename/end" tal:omit-tag="">, </span>  
    165166                        </span> 
     
    170171                    <p><tal:block i18n:translate="label_skills">Skills</tal:block>: 
    171172                        <span tal:repeat="skill skills" tal:omit-tag=""> 
    172                            <a href="#" tal:attributes="href string:$here_url/search?getTags=${skill}&amp;portal_type=MemberFolder" tal:content="skill">PLACEHOLDER</a> 
     173                           <a href="#" tal:attributes="href string:$members_url/?getTags=${skill}" tal:content="skill">PLACEHOLDER</a> 
    173174                           <span tal:condition="not: repeat/skill/end" tal:omit-tag="">, </span>  
    174175                        </span> 
     
    179180                    <p><tal:block i18n:translate="label_interests">Interests</tal:block>: 
    180181                        <span tal:repeat="interest interests" tal:omit-tag=""> 
    181                            <a href="#" tal:attributes="href string:$here_url/search?getTags=${interest}&amp;portal_type=MemberFolder" tal:content="interest">PLACEHOLDER</a> 
     182                           <a href="#" tal:attributes="href string:$members_url/?getTags=${interest}" tal:content="interest">PLACEHOLDER</a> 
    182183                           <span tal:condition="not: repeat/interest/end" tal:omit-tag="">, </span>  
    183184                        </span> 
  • trunk/skins/lemill/piece_view.pt

    r524 r528  
    1515        <!-- body macro where all the fields are --> 
    1616        <metal:body define-macro="body"> 
    17  
    18         <div metal:use-macro="here/document_byline/macros/byline"> 
    19             Get the byline - contains details about author and modification date. 
    20         </div> 
    2117                 
    2218    <tal:block tal:condition="context/isImage"> 
  • trunk/skins/lemill/resource_list_macro.pt

    r522 r528  
    2222     messenger real_obj/getMessenger1 | nothing; 
    2323     language_skills obj/getLanguage_skills | nothing; 
     24     members_url context/community/members/absolute_url | nothing 
    2425     "> 
    2526 
     
    5152          <span tal:condition="location_country"  tal:omit-tag=""> 
    5253             <tal:block i18n:translate="label_country">Country</tal:block>: 
    53                  <a href="#" tal:attributes="href string:$portal_url/search?getLocation_country=${location_country}" tal:content="location_country">Country</a> 
     54                 <a href="#" tal:attributes="href string:$members_url/?getLocation_country=${location_country}" tal:content="location_country">Country</a> 
    5455         </span> 
    5556 
    5657         <span tal:condition="location_area"  tal:omit-tag=""> 
    5758             <tal:block i18n:translate="label_area">Area</tal:block>: 
    58                  <a href="#" tal:attributes="href string:$portal_url/search?getLocation_area=${location_area}" tal:content="location_area">Area</a> 
     59                 <a href="#" tal:attributes="href string:$members_url/?getLocation_area=${location_area}" tal:content="location_area">Area</a> 
    5960         </span> 
    6061         
Note: See TracChangeset for help on using the changeset viewer.