Changeset 5871 for main


Ignore:
Timestamp:
17 Mar 2011, 21:18:36 (14 years ago)
Author:
Henrik Bettermann
Message:

Customize order of member listing.

Write-protect position field which is used for member list order.

Location:
main/waeup.plonetheme/trunk/waeup/plonetheme
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.plonetheme/trunk/waeup/plonetheme/adapter.py

    r5870 r5871  
    11from plone.app.users.browser.personalpreferences import UserDataPanelAdapter
     2from Products.CMFCore.utils import getToolByName
    23
    34class EnhancedUserDataPanelAdapter(UserDataPanelAdapter):
    45    """
    56    """
     7   
    68    def get_position(self):
    79        return self.context.getProperty('position', '')
    810    def set_position(self, value):
     11        membership = getToolByName(self.context, 'portal_membership')
     12        if not membership.checkPermission('Manage portal', self.context):
     13            return
    914        return self.context.setMemberProperties({'position': value})
    1015    position = property(get_position, set_position)
  • main/waeup.plonetheme/trunk/waeup/plonetheme/locales/de/LC_MESSAGES/waeup.po

    r5870 r5871  
    5656msgstr "Projektmitglieder"
    5757
    58 #. Default: "Your WAeUP position"
     58#. Default: "Your WAeUP position (write-protected)"
    5959#: .././userdataschema.py:28
    6060msgid "help_position"
    61 msgstr "Deine Position im WAeUP"
     61msgstr "Deine Position im WAeUP (schreibgeschützt)"
    6262
    6363#. Default: "Position"
  • main/waeup.plonetheme/trunk/waeup/plonetheme/locales/en/LC_MESSAGES/waeup.po

    r5870 r5871  
    5656msgstr ""
    5757
    58 #. Default: "Your WAeUP position"
     58#. Default: "Your WAeUP position (write-protected)"
    5959#: .././userdataschema.py:28
    6060msgid "help_position"
  • main/waeup.plonetheme/trunk/waeup/plonetheme/locales/fr/LC_MESSAGES/waeup.po

    r5870 r5871  
    5757msgstr "Membres"
    5858
    59 #. Default: "Your WAeUP position"
     59#. Default: "Your WAeUP position (write-protected)"
    6060#: .././userdataschema.py:28
    6161msgid "help_position"
     
    6767msgstr ""
    6868
    69 #. Default: "Location:"
     69#. Default: "Location"
    7070#: .././skins/waeup_plonetheme_custom_templates/member_search_form.pt:87
    7171msgid "location"
     
    8888msgstr "mes préférences personnelles"
    8989
    90 #. Default: "Position:"
     90#. Default: "Position"
    9191#: .././skins/waeup_plonetheme_custom_templates/member_search_form.pt:89
    9292msgid "position"
  • main/waeup.plonetheme/trunk/waeup/plonetheme/locales/waeup.pot

    r5870 r5871  
    5151msgstr ""
    5252
    53 #. Default: "Your WAeUP position"
     53#. Default: "Your WAeUP position (write-protected)"
    5454#: .././userdataschema.py:28
    5555msgid "help_position"
     
    6161msgstr ""
    6262
    63 #. Default: "Location:"
     63#. Default: "Location"
    6464#: .././skins/waeup_plonetheme_custom_templates/member_search_form.pt:87
    6565msgid "location"
     
    8181msgstr ""
    8282
    83 #. Default: "Position:"
     83#. Default: "Position"
    8484#: .././skins/waeup_plonetheme_custom_templates/member_search_form.pt:89
    8585msgid "position"
  • main/waeup.plonetheme/trunk/waeup/plonetheme/skins/waeup_plonetheme_custom_templates/member_search_form.pt

    r5870 r5871  
    1313       tal:define="search_view here/@@pas_search;
    1414                   listing_allowed python: checkPermission('List portal members', here);
    15                    results python:listing_allowed and here.portal_membership.searchForMembers(request) or [];
     15                   results python:listing_allowed and here.portal_membership.searchForMembers();
     16                   dummy python:results.sort(key=lambda x: x.getProperty('position') or '9999');
    1617                   DateTime python:modules['DateTime'].DateTime;
    1718                   is_anonymous python:here.portal_membership.isAnonymousUser();
    1819                   is_manager python:test(here.portal_membership.checkPermission('Manage portal', here), 1, 0); ">
    1920
     21   
    2022    <h1 class="documentFirstHeading"
    2123        i18n:translate="heading_list_members">Project Members</h1>
     
    3739                             portal_url context/@@plone_portal_state/portal_url">
    3840
    39 
    40 
    4141            <table align="left" width=100%>
    4242            <tbody>
    43               <tal:repeat tal:define="Groups python:(('Nigeria','Nigerian Group'), ('Germany','German Group'), ('Ghana','Ghanaian Group'), ('Niger','Niger Group'))"
     43              <tal:repeat tal:define="Groups python:(('Nigeria','Nigerian Group'), ('Germany','German Group'), )"
    4444                          tal:repeat="Group Groups">
    4545              <tr><td colspan="5">
    4646                  <h2 style="padding: 0.5em 0em" tal:content="python:Group[1]" />
    4747              </td></tr>
    48              
    49            
    50              
     48
    5149              <tal:block tal:repeat="result results">
    5250
    53                     <tr tal:define="id result/getUserName | nothing;
     51                    <tr style="border: 10px solid white"
     52                        tal:define="id result/getUserName | nothing;
    5453                                    author python:pm.getMemberInfo(id) or {};
    5554                                    portrait python:pm.getPersonalPortrait(id);
     
    6059                      <td style="width: 8%; vertical-align:top;">
    6160                      <a href="#" tal:attributes="href portrait/absolute_url">
    62                       <img src="" alt="" class="portraitPhoto"  height="80"
     61                      <img src="" alt="" class="portraitPhoto"  width="60"
    6362                           style="float: left; margin: 0em;"
    6463                           tal:attributes="src portrait/absolute_url" />
     
    6665                      </td>
    6766   
    68                       <td style="width: 17%; vertical-align:top;">
     67                      <td style="width: 20%; vertical-align:top;">
    6968                       <span tal:condition="python: author['fullname']">
    7069                         <span tal:content="python: author['fullname']">name</span>
     
    8079                      </td>
    8180
    82                       <td style="width: 57%; padding: 0em 2em 0em 0em; vertical-align:top;">
     81                      <td style="width: 50%; padding: 0em 2em 0em 0em; vertical-align:top;">
    8382                       <span tal:content="author/description|nothing">Biography</span>
    8483                      </td> 
    8584                           
    86                       <td style="width: 18%; vertical-align:top;">
     85                      <td style="width: 22%; vertical-align:top;">
    8786                       <span i18n:translate="location">Location</span>: <span tal:content="author/location|nothing">Location</span>
    8887                       <br />
    89                        <span i18n:translate="position">Position</span>: <span tal:content="position">Position</span>
     88                       <span i18n:translate="position">Position</span>: <span tal:content="python: ' '.join(position.split()[1:])">Position</span>
    9089                       <div tal:condition="python: author['fullname'] and not is_anonymous">
    9190                         <a href="#" tal:attributes="href string:${portal_url}/author/${id}"
     
    107106                       </div>                                 
    108107                      </td>     
    109                      
    110108                   </tr>
    111 
    112109
    113110              </tal:block>
     
    117114
    118115            </div>
    119 
    120116            <div class="visualClear" id="clear-space-before-navigation"><!-- --></div>
    121 
    122 
    123117            <div class="visualClear" id="clear-space-after-navigation"><!-- --></div>
    124118
     
    133127
    134128</html>
    135 
  • main/waeup.plonetheme/trunk/waeup/plonetheme/userdataschema.py

    r5870 r5871  
    2727        title=_(u'label_position', default=u'Position'),
    2828        description=_(u'help_position',
    29                       default=u"Your WAeUP position"),
     29                      default=u"Your WAeUP position (write-protected)",
    3030        required=False)
    3131
Note: See TracChangeset for help on using the changeset viewer.