# HG changeset patch # User Lennard de Rijk # Date 1249397847 -7200 # Node ID 0d9e4b0a9d3ca39fc7de996e6e453a10acd38aba # Parent 09b5bfc5707fc7fb877c75f1a028305767551f27 Added redirect for viewing SurveyRecords and enabled links in the Record list. Patch by: Lennard de Rijk and James Levy diff -r 09b5bfc5707f -r 0d9e4b0a9d3c app/soc/templates/soc/survey/list/records_heading.html --- a/app/soc/templates/soc/survey/list/records_heading.html Tue Aug 04 16:52:41 2009 +0200 +++ b/app/soc/templates/soc/survey/list/records_heading.html Tue Aug 04 16:57:27 2009 +0200 @@ -1,5 +1,5 @@ Taken By Taken On - Preview: {{ first_question|truncatewords:7 }} + Preview Question: {{ first_question|truncatewords:7 }} diff -r 09b5bfc5707f -r 0d9e4b0a9d3c app/soc/templates/soc/survey/list/records_row.html --- a/app/soc/templates/soc/survey/list/records_row.html Tue Aug 04 16:52:41 2009 +0200 +++ b/app/soc/templates/soc/survey/list/records_row.html Tue Aug 04 16:57:27 2009 +0200 @@ -1,5 +1,5 @@ + onclick="if (do_redirect) document.location.href='{{ list.redirect }}'" name="name">
diff -r 09b5bfc5707f -r 0d9e4b0a9d3c app/soc/views/helper/redirects.py --- a/app/soc/views/helper/redirects.py Tue Aug 04 16:52:41 2009 +0200 +++ b/app/soc/views/helper/redirects.py Tue Aug 04 16:57:27 2009 +0200 @@ -421,6 +421,22 @@ entity.key().id_or_name()) +def getViewSurveyRecordRedirect(entity, params): + """Returns the redirect for view a Survey Record + for the given Survey Record. + + Args: + entity: a Survey Record entity + params: params for a Survey view + + """ + + return '/%s/record/%s?id=%s' % ( + params['url_name'], + entity.survey.key().id_or_name(), + entity.key().id_or_name()) + + def getEditGradingRecordRedirect(entity, params): """Returns the redirect for editing a given GradingRecord. """ @@ -449,3 +465,10 @@ return None return getPublicRedirect(tos_doc, {'url_name': 'document'}) + + +def getSubscribeRedirect(entity, params): + """Redirects to subscription XML doc for an entity + """ + return'/%s/subscribe/%s' % ( + params['url_name'], entity.key().name())