app/soc/views/helper/surveys.py
changeset 2576 7a1138f8a0e2
parent 2564 81b36f56d61a
child 2658 34b414a80d42
--- a/app/soc/views/helper/surveys.py	Thu Jul 09 10:16:29 2009 +0200
+++ b/app/soc/views/helper/surveys.py	Thu Jul 09 10:39:30 2009 +0200
@@ -930,71 +930,6 @@
            'quant_radio': PickQuantRadio}
 
 
-class SurveyResults(widgets.Widget):
-  """Render List of Survey Results For Given Survey.
-  """
-
-  def render(self, survey, params, filter=filter, limit=1000, offset=0,
-             order=[], idx=0, context={}):
-    """ renders list of survey results
-
-    params:
-      survey: current survey
-      params: dict of params for rendering list
-      filter: filter for list results
-      limit: limit for list results
-      offset: offset for list results
-      order: order for list results
-      idx: index for list results
-      context: context dict for template
-    """
-
-    survey_logic = params['logic']
-    record_logic = survey_logic.getRecordLogic()
-    filter = {'survey': survey}
-    data = record_logic.getForFields(filter=filter, limit=limit, offset=offset,
-                              order=order)
-
-    params['name'] = "Survey Results"
-    content = {
-      'idx': idx,
-      'data': data,
-      'logic': record_logic,
-      'limit': limit,
-     }
-    updates = dicts.rename(params, params['list_params'])
-    content.update(updates)
-    contents = [content]
-
-    if len(content) == 1:
-      content = content[0]
-      key_order = content.get('key_order')
-
-    context['list'] = Lists(contents)
-
-    # TODO(ajaksu) is this the best way to build the results list?
-    for list_ in context['list']._contents:
-      if len(list_['data']) < 1:
-        return "<p>No Survey Results Have Been Submitted</p>"
-
-      list_['row'] = 'soc/survey/list/results_row.html'
-      list_['heading'] = 'soc/survey/list/results_heading.html'
-      list_['description'] = 'Survey Results:'
-
-    context['properties'] = survey.survey_content.orderedProperties()
-    context['entity_type'] = "Survey Results"
-    context['entity_type_plural'] = "Results"
-    context['no_lists_msg'] = "No Survey Results"
-
-    path = (survey.entity_type().lower(), survey.prefix,
-            survey.scope_path, survey.link_id)
-    context['grade_action'] = "/%s/grade/%s/%s/%s" % path
-
-    markup = loader.render_to_string('soc/survey/results.html',
-                                     dictionary=context).strip('\n')
-    return markup
-
-
 class HelperForm(object):
   """Thin wrapper for adding values to params['edit_form'].fields.
   """