Changeset 3032 for trunk


Ignore:
Timestamp:
05/27/10 12:22:30 (10 years ago)
Author:
jukka
Message:

Fixed #1961

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MemberFolder.py

    r3026 r3032  
    337337        # Setting Access permission 
    338338        self.manage_permission(ACCESS_CONTENT, ('Manager','Owner','Member','Authenticated','Anonymous'), acquire=0) 
     339 
     340    def getMessages(self): 
     341        """ Memberfolder messages should remind about missing country and language """ 
     342        messages=CommonMixIn.getMessages(self) 
     343        if self.canIEdit() and not (self.getLanguage_skills() and self.getLocation_country() and self.getLocation_country()!='No country specified'): 
     344            messages.append('missing_member_info')             
     345        return messages 
    339346 
    340347    def setFullname(self, value): 
     
    413420        return DisplayList(tuple(countries_root)) # not sure, but DisplayList might require tuples not lists. 
    414421 
     422 
     423 
     424    security.declareProtected(MODIFY_CONTENT, 'updateCountry') 
     425    def updateCountry(self,country): 
     426        """ Just change country, called from javascript """ 
     427        self.setLocation_country(country) 
     428        self.at_post_edit_script() 
     429        lt=getToolByName(self, 'lemill_tool') 
     430        lt.addPortalMessage(_('Thank you!')) 
     431        return self.REQUEST.RESPONSE.redirect(self.absolute_url()) 
    415432     
    416433    def getLanguagelist(self): 
  • trunk/skins/lemill/base_view.pt

    r3029 r3032  
    2525            <div metal:use-macro="here/document_byline/macros/byline" /> 
    2626            <tal:messages repeat="message here/getMessages"> 
    27                 <div metal:use-macro="python:path('here/macros_messages/macros/'+message)" /> 
     27                <div metal:use-macro="python:path('here/macros_messages/macros/%s|nothing' % message)" /> 
    2828            </tal:messages> 
    2929        </metal:header>                                                                 
  • trunk/skins/lemill/macros_messages.pt

    r3029 r3032  
    2929$('select#lang').change(function() {this.form.submit();}); 
    3030</script> 
     31</metal:language_missing> 
    3132 
    32 </metal:language_missing> 
     33<metal:missing_member_info define-macro="missing_member_info"> 
     34    <div class="portalMessage" tal:define="lang context/getLanguage_skills; country context/getLocation_country; country python:test((not country) or country=='No country specified', '', country)"> 
     35    <tal:both condition="python: not (lang or country)" i18n:translate="text_language_country_missing"> 
     36    Please <a href="personalize_form">fill your country and language preferences</a>, so that the LeMill community can find you. 
     37    </tal:both> 
     38    <tal:language condition="python: country and not lang" i18n:translate="text_language_missing"> 
     39    Please <a href="personalize_form">fill your language preferences</a>, so that LeMill knows which resources to show you. 
     40    </tal:language> 
     41    <tal:country condition="python: lang and not country">  
     42    <form tal:attributes="action string:${here_url}/updateCountry" id="countryUpdater" method="post"> 
     43      <span i18n:translate="text_country_missing">Please select your country, so that the LeMill community can find you:</span> 
     44      <select name="country" id="country">  
     45        <option tal:attributes="value co" tal:content="co" tal:repeat="co context/getCountrylist" /> 
     46      </select> 
     47    </form> 
     48    <script type="text/javascript"> 
     49$('select#country').change(function() {this.form.submit();}); 
     50</script> 
     51    </tal:country> 
     52    </div>    
     53</metal:missing_member_info> 
    3354   
    3455  </body> 
  • trunk/skins/lemill/member_view.pt

    r2967 r3032  
    2323 
    2424        <tal:haveAuthor condition="nocall:member_folder"> 
     25 
     26        <tal:messages repeat="message here/getMessages"> 
     27            <div metal:use-macro="python:path('here/macros_messages/macros/%s|nothing' % message)" /> 
     28        </tal:messages> 
     29 
    2530 
    2631        <div id="content" tal:omit-tag="" 
Note: See TracChangeset for help on using the changeset viewer.