Show
Ignore:
Timestamp:
02/22/08 15:02:26 (2 years ago)
Author:
JensDiemer
Message:

A new way to setup contextrobots?
I am not really convinced of it yet.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/PyLucid/system/context_processors.py

    r1435 r1440  
    1717    http://www.djangoproject.com/documentation/templates_python/#writing-your-own-context-processors 
    1818    """ 
    19     context_extras = {} 
    20  
    21     #___________________________________________________________________________ 
    22  
    23     context_extras['powered_by'] = mark_safe( 
    24         '<a href="http://www.pylucid.org">PyLucid v%s</a>' \ 
     19    return { 
     20        "powered_by": mark_safe( 
     21            '<a href="http://www.pylucid.org">PyLucid v%s</a>' \ 
    2522                                                        % PYLUCID_VERSION_STRING 
    26     ) 
    27  
    28     #___________________________________________________________________________ 
    29  
    30     # The module_manager set "must_login": 
    31     if getattr(request, "must_login", False): 
    32         context_extras["robots"] = "NONE,NOARCHIVE" 
    33     else: 
    34         context_extras["robots"] = "index,follow" 
    35  
    36     #___________________________________________________________________________ 
    37  
    38     return context_extras 
    39  
     23        ), 
     24        # This value would be changed in index._render_cms_page(), if the 
     25        # plugin manager or any plugin set request.anonymous_view = False 
     26        "robots": "index,follow", 
     27    } 
    4028 
    4129 
     
    5341        txt = "%s [%s]" % (_("Log out"), request.user.username) 
    5442    else: 
    55         url = URLs.commandLink("auth", "login/?next=%s" % request.path) 
     43#        url = URLs.commandLink("auth", "login/?next=%s" % request.path) 
     44        url = URLs.commandLink("auth", "login") 
    5645        txt = _("Log in") 
    5746 
    58     context["login_link"] = mark_safe( 
    59         '<a href="%s">%s</a>' % (url, txt) 
    60     ) 
    61      
     47    context["login_link"] = mark_safe('<a href="%s">%s</a>' % (url, txt)) 
     48 
    6249    # Put the language information into the context, if it exists. 
    6350    # see: http://www.djangoproject.com/documentation/i18n/ 
     
    6653    else: 
    6754        context['django_language']='' 
    68  
    6955 
    7056