app/soc/views/user/roles.py
changeset 365 74dec172944e
parent 358 843d83b87282
child 482 839740b061ad
equal deleted inserted replaced
364:ab47d3f494b3 365:74dec172944e
    24 __authors__ = [
    24 __authors__ = [
    25   '"Todd Larsen" <tlarsen@google.com>',
    25   '"Todd Larsen" <tlarsen@google.com>',
    26   ]
    26   ]
    27 
    27 
    28 
    28 
    29 from google.appengine.api import users
    29 from soc.views.helper import decorators
    30 
    30 from soc.views.helper import responses
    31 from django import http
       
    32 
       
    33 from soc.views.helpers import response_helpers
       
    34 
    31 
    35 
    32 
       
    33 @decorators.view
    36 def dashboard(request, page=None, link_name=None,
    34 def dashboard(request, page=None, link_name=None,
    37               template='soc/user/roles/dashboard.html'):
    35               template='soc/user/roles/dashboard.html'):
    38   """A per-User dashboard of that User's Roles on the site.
    36   """A per-User dashboard of that User's Roles on the site.
    39 
    37 
    40   Args:
    38   Args:
    56   #   what the equivalent public.html template is?  Perhaps this
    54   #   what the equivalent public.html template is?  Perhaps this
    57   #   view needs to require that, for a foo/bar/dashboard.html
    55   #   view needs to require that, for a foo/bar/dashboard.html
    58   #   template, a corresponding foo/bar/public.html template must
    56   #   template, a corresponding foo/bar/public.html template must
    59   #   also exist...
    57   #   also exist...
    60 
    58 
    61   return response_helpers.respond(request,
    59   return responses.respond(request,
    62       template, {'template': template})
    60       template, {'template': template})
    63 
    61 
    64 
    62 
       
    63 @decorators.view
    65 def public(request, page=None, link_name=None,
    64 def public(request, page=None, link_name=None,
    66            template='soc/user/roles/public.html'):
    65            template='soc/user/roles/public.html'):
    67   """A "general public" view of a User's Roles on the site.
    66   """A "general public" view of a User's Roles on the site.
    68 
    67 
    69   Args:
    68   Args:
    79   #TODO(tlarsen): this module is currently a placeholder for future work
    78   #TODO(tlarsen): this module is currently a placeholder for future work
    80   
    79   
    81   # TODO: if link_name is empty or not a valid link_name on the site, display
    80   # TODO: if link_name is empty or not a valid link_name on the site, display
    82   # some sort of "user does not exist" page (a custom 404 page, maybe?).
    81   # some sort of "user does not exist" page (a custom 404 page, maybe?).
    83   
    82   
    84   return response_helpers.respond(request,
    83   return responses.respond(request,
    85       template, {'template': template})
    84       template, {'template': template})
    86