Ignore:
Timestamp:
14 Jun 2007, 20:28:57 (17 years ago)
Author:
joachim
Message:

add a groups column

Location:
WAeUP_SRP/trunk/skins/waeup_directory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_directory/search_members.py

    r1886 r1899  
    1212from Products.CPSDirectory.BaseDirectory import SearchSizeLimitExceeded
    1313from Products.AdvancedQuery import Eq, Between, Le,In
     14try:
     15    from Products.zdb import set_trace
     16except:
     17    def set_trace():
     18        pass
    1419try:
    1520    aq_portal = context.portal_catalog.evalAdvancedQuery
     
    3237##                  {'id': id_field, 'title': 'label_user_name'},
    3338##                  ]
     39if dir.getId() == "members":
     40    result_fields.append({'id': 'groups', 'title': 'Group(s)'})
    3441
    3542return_fields = []
     
    5865    rendered = dir.member_search_errors(exception=e)
    5966    return rendered, 'results'
    60 
    6167for field, process_meth in process_fields.items():
    6268    meth = getattr(context, process_meth, None)
     
    9399                roles.append(r)
    94100    item[1]['roles'] = roles
    95 rendered = dir.search_members_results(results=results)
     101    if "groups" in return_fields:
     102        item[1]['groups'] = " ".join(item[1]['groups'])
     103       
     104rendered = dir.search_members_results(results=results,result_fields=result_fields)
    96105
    97106return rendered, 'results'
  • WAeUP_SRP/trunk/skins/waeup_directory/search_members_results.pt

    r953 r1899  
    1111  dirname here/getId;
    1212  title_field here/title_field;
    13   fields python:here.getDirectoryResultFields(dirname);
     13  fields options/result_fields;
    1414  isAdmin python:here.portal_membership.getAuthenticatedMember().has_role(['Manager',]);
    1515  cpsmcat nocall:here/translation_service;
     
    4040                </tal:block>
    4141                <td>
     42              <span tal:condition="repeat/field/start">
    4243                  <a href="."
    4344                    tal:attributes="href string:${portal_url}/member_view?id=${id}"
    4445                    ><strong tal:content="structure python:data.get(field['id'])">john</strong></a>
     46              </span>
     47              <span tal:condition="not:repeat/field/start"
     48                    tal:content="structure python:data.get(field['id'])" />
    4549                </td>
    4650              </tal:block>
Note: See TracChangeset for help on using the changeset viewer.