[virtualcommons-developer] commit/vcweb: alllee: ensuring experimenterNotes is set in the experimen
Status: Beta
Brought to you by:
alllee
|
From: <com...@bi...> - 2013-03-21 10:37:53
|
1 new commit in vcweb: https://bitbucket.org/virtualcommons/vcweb/commits/02909e4e92ea/ changeset: 02909e4e92ea user: alllee date: 2013-03-21 11:37:33 summary: ensuring experimenterNotes is set in the experiment view model dict affected #: 2 files diff -r bda736d07dac7751c58cdf1d533d033aaa047b92 -r 02909e4e92ea99ac360cb0d0354605d9f7bca9c8 vcweb/core/models.py --- a/vcweb/core/models.py +++ b/vcweb/core/models.py @@ -855,8 +855,7 @@ experiment_dict['allRoundData'] = self.all_round_data() experiment_dict['chatMessages'] = [chat_message.to_dict() for chat_message in self.all_chat_messages] experiment_dict['messages'] = [unicode(log) for log in self.activity_log_set.order_by('-date_created')] - if self.is_round_in_progress: - experiment_dict['experimenterNotes'] = self.current_round_data.experimenter_notes + experiment_dict['experimenterNotes'] = self.current_round_data.experimenter_notes if self.is_round_in_progress else '' return experiment_dict def as_dict(self, *args, **kwargs): diff -r bda736d07dac7751c58cdf1d533d033aaa047b92 -r 02909e4e92ea99ac360cb0d0354605d9f7bca9c8 vcweb/core/templates/experimenter/monitor.html --- a/vcweb/core/templates/experimenter/monitor.html +++ b/vcweb/core/templates/experimenter/monitor.html @@ -182,9 +182,10 @@ }, { experiment_id: {{ experiment.pk }}, notes: notes }); } +// FIXME: code duplication here, prime candidate for refactoring model.update = function(localModel, evt) { $('#progress-modal').modal('show'); - Dajaxice.vcweb.core.get_experiment_model(update(model), {pk: {{experiment.pk}}}); + Dajaxice.vcweb.core.get_experiment_model(function (data) { ko.mapping.fromJS(data, model); $('#progress-modal').modal('hide');}, {pk: {{experiment.pk}}}); } model.confirmExperimentAction = function(m, evt) { element = evt.target; @@ -218,7 +219,7 @@ }); return model; } - function confirmExperimentControllerAction(element, m, callback) { + function confirmExperimentControllerAction(element, experimentModel, callback) { confirmAction(element, function(confirmed, action) { $('#progress-modal').modal('show'); Dajaxice.vcweb.core.experiment_controller(function(data) { @@ -244,10 +245,6 @@ } }); } - function update(experimentModel) { - return function(data) { - } - } function initialize(experimentModelJson) { var experimentModel = new ExperimentModel(experimentModelJson); // var experimentModel = new ExperimentModel(); 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. |