# HG changeset patch # User Daniel Diniz # Date 1246193108 -7200 # Node ID f6d45459b6b4ea93014abb893da80fe6f6cafba4 # Parent 0ba41e115dbceebadcaefce487d63248dc5a2fd1 Added redirect for use in Surveys. Also some minor style changes. Patch by: Daniel Diniz Reviewed by: Lennard de Rijk diff -r 0ba41e115dbc -r f6d45459b6b4 app/soc/views/helper/redirects.py --- a/app/soc/views/helper/redirects.py Sun Jun 28 14:40:55 2009 +0200 +++ b/app/soc/views/helper/redirects.py Sun Jun 28 14:45:08 2009 +0200 @@ -110,15 +110,17 @@ return '/%s/home/%s' % ( params['url_name'], entity.key().id_or_name()) + def getReviewRedirect(entity, params): """Returns the redirect to review the specified entity. """ - + return '/%s/review/%s' % ( params['url_name'], entity.key().id_or_name()) + def getReviewOverviewRedirect(entity, params): - """Returns the redirect to the review_overview using the + """Returns the redirect to the review_overview using the keyname of the specified entity. """ @@ -345,6 +347,27 @@ return '/document/list/%s/%s' % (prefix, entity.key().id_or_name()) +def getCreateSurveyRedirect(entity, prefix): + """Returns the redirect for new documents. + """ + + return '/survey/create/%s/%s' % (prefix, entity.key().id_or_name()) + + +def getListSurveysRedirect(entity, prefix): + """Returns the redirect for listing documents. + """ + + return '/survey/list/%s/%s' % (prefix, entity.key().id_or_name()) + + +def getListSurveyResultsRedirect(entity, prefix): + """Returns the redirect for listing documents. + """ + + return '/survey/list_results/%s/%s' % (prefix, entity.key().id_or_name()) + + def getToSRedirect(presence): """Returns link to 'show' the ToS Document if it exists, None otherwise.