Added redirect to the StudentProject manage page for viewing SurveyRecords.
authorLennard de Rijk <ljvderijk@gmail.com>
Tue, 04 Aug 2009 21:29:49 +0200
changeset 2729 f7d4e2c3b697
parent 2728 e6e8a5530589
child 2730 d1cfed8da027
Added redirect to the StudentProject manage page for viewing SurveyRecords.
app/soc/templates/soc/grading_project_survey/list/row_manage_student_project.html
app/soc/templates/soc/project_survey/list/row_manage_student_project.html
app/soc/views/helper/list_info.py
--- a/app/soc/templates/soc/grading_project_survey/list/row_manage_student_project.html	Tue Aug 04 17:07:44 2009 +0200
+++ b/app/soc/templates/soc/grading_project_survey/list/row_manage_student_project.html	Tue Aug 04 21:29:49 2009 +0200
@@ -1,11 +1,10 @@
-<tr class="off" onmouseover="this.className='on'; do_redirect=true" onmouseout="this.className='off'"
- onclick="if (do_redirect) document.location.href='{{ list.redirect }}'" name="name">
+<tr class="off" onmouseover="this.className='on'" onmouseout="this.className='off'" name="name">
   <td><div class="title">{{ list.item.title }}</div></td>
   <td><div class="taken_by">{{ list.info.taken_by }}</div></td>
   <td><div class="taken_on">{{ list.info.taken_on }}</div></td>
   <td><div class="view_record">
   {% if list.info.record %}
-    Record Available (TBD: Record Showing)
+    <a href="{{ list.info.record_url }}">View Record</a>
   {% else %}
     No Record Available
   {% endif %} 
--- a/app/soc/templates/soc/project_survey/list/row_manage_student_project.html	Tue Aug 04 17:07:44 2009 +0200
+++ b/app/soc/templates/soc/project_survey/list/row_manage_student_project.html	Tue Aug 04 21:29:49 2009 +0200
@@ -1,11 +1,10 @@
-<tr class="off" onmouseover="this.className='on'; do_redirect=true" onmouseout="this.className='off'"
- onclick="if (do_redirect) document.location.href='{{ list.redirect }}'" name="name">
+<tr class="off" onmouseover="this.className='on'" onmouseout="this.className='off'" name="name">
   <td><div class="title">{{ list.item.title }}</div></td>
   <td><div class="taken_by">{{ list.info.taken_by }}</div></td>
   <td><div class="taken_on">{{ list.info.taken_on }}</div></td>
   <td><div class="links">
   {% if list.info.record %}
-    Record Available (TBD: Record Showing)
+    <a href="{{ list.info.record_url }}">View Record</a>
   {% else %}
     No Record Available
   {% endif %} 
--- a/app/soc/views/helper/list_info.py	Tue Aug 04 17:07:44 2009 +0200
+++ b/app/soc/views/helper/list_info.py	Tue Aug 04 21:29:49 2009 +0200
@@ -150,6 +150,8 @@
       # SurveyRecord has been found store the import data in info
       info['taken_by'] = record_entity.user.name
       info['taken_on'] = record_entity.modified
+      info['record_url'] = redirects.getViewSurveyRecordRedirect(record_entity,
+                                                                 survey_params)
     else:
       info['taken_by'] = DEF_NO_RECORD_AVAILABLE_MESSAGE
       info['taken_on'] = DEF_NO_RECORD_AVAILABLE_MESSAGE