[virtualcommons-svn] commit/vcweb: alllee: reversing the order of the participant history wait page
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2011-06-22 06:50:01
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/d1eb9508411f/ changeset: d1eb9508411f user: alllee date: 2011-06-22 08:49:54 summary: reversing the order of the participant history wait page and experimenter monitor page so most current is on top affected #: 3 files (297 bytes) --- a/vcweb/core/ajax.py Tue Jun 21 23:23:35 2011 -0700 +++ b/vcweb/core/ajax.py Tue Jun 21 23:49:54 2011 -0700 @@ -111,7 +111,7 @@ 'transition_url': transition_url, 'status': status_block, 'experimentData': data_block, - 'active_round_number': experiment.current_round.sequence_number, + 'active_round_number': experiment.current_round_sequence_number, 'round_data_count': experiment.round_data.count(), 'error_message': error_message, }) --- a/vcweb/core/templates/experimenter/monitor.html Tue Jun 21 23:23:35 2011 -0700 +++ b/vcweb/core/templates/experimenter/monitor.html Tue Jun 21 23:49:54 2011 -0700 @@ -48,9 +48,9 @@ $('#statusDiv [title]').qtip(qtipOptions); $('#statusDiv').show('fast'); $('#experimentData').show('fast'); + console.log("active round number: " + active_round_number); if (round_data_count > 0) { $('#experimentData').accordion({ - active: active_round_number - 1, autoHeight: false }); } @@ -191,7 +191,7 @@ </div><div id='experimentData'> {% block data %} - {% for round_data in experiment.round_data.all %} + {% for round_data in experiment.round_data.all reversed %} <h3><a href='#'>{{ round_data }}</a></h3><div id='round_data_{{forloop.counter}}'> {% if round_data.group_data_values.count > 0 %} @@ -245,7 +245,6 @@ <div class='info ui-corner-all'><span class='ui-icon ui-icon-info icon-left'></span>No participant data for this round.</div> {% endif %} {% comment %} participant chats {% endcomment %} - {% if round_data.chat_messages.count > 0 %} <h4 class='collapsible'>Chat data</h4><div id='chat-div-{{round_data.pk}}' class='chat notice ui-corner-all'> {% for chat_message in round_data.chat_messages.all %} @@ -253,9 +252,13 @@ <a class='dark-yellow-highlight' name='{{chat_message.pk}}' title='{{chat_message.date_created}} {{chat_message.participant}}'> {{chat_message.date_created|date:"G:i:s"}}</a> | {{chat_message}} </div> + {% empty %} + <div class='ui-state-highlight' style='line-height: 1.5em;'> + <span class='ui-icon ui-icon-info vcweb-icon'></span> + <span class='dark-yellow-highlight'>{% now "G:i:s" %}</span> | No chat messages have been sent yet. + </div> {% endfor %} </div> - {% endif %} </div> {% empty %} <div class='alert ui-state-highlight ui-corner-all'><span class='ui-icon ui-icon-alert icon-left'></span>Round data is not yet available.</div> --- a/vcweb/forestry/views.py Tue Jun 21 23:23:35 2011 -0700 +++ b/vcweb/forestry/views.py Tue Jun 21 23:49:54 2011 -0700 @@ -13,6 +13,7 @@ from vcweb.forestry.models import get_resource_level, get_max_harvest_decision, get_forestry_experiment_metadata, set_harvest_decision, get_harvest_decision, get_group_harvest, get_regrowth from vcweb.forestry.forms import HarvestDecisionForm import logging +from collections import deque logger = logging.getLogger(__name__) @@ -67,7 +68,7 @@ def generate_participant_history(participant_group_relationship): group = participant_group_relationship.group experiment = group.experiment - participant_history = [] + participant_history = deque() for round_data in experiment.playable_round_data: logger.debug("generating participant history for %s", round_data) data = ParticipantRoundData() @@ -86,7 +87,7 @@ logger.error("Caught attribute error while trying to calculate original number of trees %s", e) pass data.final_number_of_trees = resource_level.value - participant_history.append(data) + participant_history.appendleft(data) if experiment.is_round_in_progress: last_round_data = participant_history[-1] if experiment.current_round == last_round_data.round_configuration: Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |