# HG changeset patch # User Lennard de Rijk # Date 1247440546 -7200 # Node ID 9848682af61027bb801cd556e54fda517ccb39cc # Parent f37d7d564f88d5f07e6dc33786bf358cb7431a62 Added messages to the Records page when a task has been successfully started. diff -r f37d7d564f88 -r 9848682af610 app/soc/templates/soc/grading_survey_group/records.html --- a/app/soc/templates/soc/grading_survey_group/records.html Mon Jul 13 01:07:18 2009 +0200 +++ b/app/soc/templates/soc/grading_survey_group/records.html Mon Jul 13 01:15:46 2009 +0200 @@ -20,7 +20,7 @@ All records collected for this Grading Survey Group are shown on this page.

-{{ message }} +
{{ message }}
diff -r f37d7d564f88 -r 9848682af610 app/soc/views/models/grading_survey_group.py --- a/app/soc/views/models/grading_survey_group.py Mon Jul 13 01:07:18 2009 +0200 +++ b/app/soc/views/models/grading_survey_group.py Mon Jul 13 01:15:46 2009 +0200 @@ -243,6 +243,13 @@ return responses.errorResponse( error, request, template=params['error_public']) + # get the context for this webpage + context = responses.getUniversalContext(request) + responses.useJavaScript(context, params['js_uses_all']) + context['page_name'] = "%s for %s named '%s'" %( + page_name, params['name'], entity.name) + context['entity'] = entity + # get the POST request dictionary and check if we should take action post_dict = request.POST @@ -259,6 +266,8 @@ fields = {'last_update_started': datetime.datetime.now()} survey_group_logic.updateEntityProperties(entity, fields) + context['message'] = 'Updating GradingRecords successfully started' + if post_dict.get('update_projects'): # start the task to update all StudentProjects for the given group task_params = { @@ -268,6 +277,7 @@ new_task = taskqueue.Task(params=task_params, url=task_url) new_task.add() + context['message'] = 'Updating StudentProjects successfully started' template = params['records_template'] @@ -278,13 +288,6 @@ # TODO(ljvderijk) proper redirect to edit a record list_params['list_action'] = None - # get the context for this webpage - context = responses.getUniversalContext(request) - responses.useJavaScript(context, params['js_uses_all']) - context['page_name'] = "%s for %s named '%s'" %( - page_name, params['name'], entity.name) - context['entity'] = entity - fields = {'grading_survey_group': entity} # list all records with grading_decision set to pass