app/soc/views/home.py
changeset 512 aae25d2b4464
parent 500 44ea4620c5c0
child 513 3c1e16637ad7
equal deleted inserted replaced
511:52557918ec8f 512:aae25d2b4464
    37 
    37 
    38 
    38 
    39 DEF_HOME_PUBLIC_TMPL = 'soc/home/public.html'
    39 DEF_HOME_PUBLIC_TMPL = 'soc/home/public.html'
    40 
    40 
    41 @decorators.view
    41 @decorators.view
    42 def public(request, page_name=None, partial_path=None, link_name=None, 
    42 def public(request, page_name=None, partial_path=None, link_id=None, 
    43            entity_type='HomeSettings',
    43            entity_type='HomeSettings',
    44            template=DEF_HOME_PUBLIC_TMPL):
    44            template=DEF_HOME_PUBLIC_TMPL):
    45   """How the "general public" sees a "home" page.
    45   """How the "general public" sees a "home" page.
    46 
    46 
    47   Args:
    47   Args:
    48     request: the standard django request object.
    48     request: the standard django request object.
    49     page_name: the page name displayed in templates as page and header title
    49     page_name: the page name displayed in templates as page and header title
    50     path: path (entire "scoped" portion combined with the link_name)
    50     path: path (entire "scoped" portion combined with the link_id)
    51       used to retrieve the Group's "home" settings
    51       used to retrieve the Group's "home" settings
    52     template: the template path to use for rendering the template
    52     template: the template path to use for rendering the template
    53 
    53 
    54   Returns:
    54   Returns:
    55     A subclass of django.http.HttpResponse with generated template.
    55     A subclass of django.http.HttpResponse with generated template.
    56   """
    56   """
    57   # create default template context for use with any templates
    57   # create default template context for use with any templates
    58   context = helper.responses.getUniversalContext(request)
    58   context = helper.responses.getUniversalContext(request)
    59   
    59   
    60   settings = models.site_settings.logic.getFromFields(
    60   settings = models.site_settings.logic.getFromFields(
    61       partial_path=partial_path, link_name=link_name)
    61       partial_path=partial_path, link_id=link_id)
    62 
    62 
    63   if settings:
    63   if settings:
    64     context['home_settings'] = settings
    64     context['home_settings'] = settings
    65     
    65     
    66     # check if ReferenceProperty to home Document is valid
    66     # check if ReferenceProperty to home Document is valid