From b5227482360756da4382dbf68a236cdea0d05d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csutor=C3=A1s=20Robin?= Date: Fri, 22 Sep 2017 15:26:46 +0200 Subject: [PATCH] showing others finalized #57 fix #29 --- app/controllers/evaluator.js | 34 +++++++++++----------------------- app/templates/evaluator.hbs | 9 ++++++--- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/app/controllers/evaluator.js b/app/controllers/evaluator.js index e0b6f3e..371bb81 100644 --- a/app/controllers/evaluator.js +++ b/app/controllers/evaluator.js @@ -15,13 +15,13 @@ export default Ember.Controller.extend({ 'Deliverable' ], rowIndecies: [ - 'neptun', + 'Event.StudentRegistration.User.neptun', 'displayName', 'uploadedAt', - 'deadline', - 'typeShortName', - 'exerciseCategoryName', - 'deliverableTemplateName' + 'deadlineFormatted', + 'Event.ExerciseSheet.ExerciseType.shortName', + 'DeliverableTemplate.EventTemplate.ExerciseCategory.type', + 'DeliverableTemplate.description' ], filteredDeliverablesSelect: [], headerGrading: [ @@ -133,21 +133,13 @@ export default Ember.Controller.extend({ offset: pageSize * this.get('page'), limit: pageSize }).then(deliverables => { + deliverables.forEach(x => { + x.set('uploadedAt', x.get('uploaded') ? dateformat([x.get('lastSubmittedDate')]) : 'No'); + x.set('deadlineFormatted', dateformat([x.get('deadline')])); + }); this.set('filteredDeliverablesSelect', [ ...this.get('filteredDeliverablesSelect'), - ...deliverables.map(x => { - return ({ - id: x.get('id'), - exerciseCategoryName: x.get('DeliverableTemplate.EventTemplate.ExerciseCategory.type'), - deliverableTemplateName: x.get('DeliverableTemplate.description'), - neptun: x.get('Event.StudentRegistration.User.neptun'), - displayName: x.get('Event.StudentRegistration.User.displayName'), - typeShortName: x.get('Event.ExerciseSheet.ExerciseType.shortName'), - uploadedAt: x.get('uploaded') ? dateformat([x.get('lastSubmittedDate')]) : 'No', - deadline: dateformat([x.get('deadline')]), - meta: x - }); - }) + ...deliverables.map(x => x) ]); this.set('page', this.get('page') + 1); }); @@ -170,7 +162,7 @@ export default Ember.Controller.extend({ } return false; }, - changeDeliverable({ meta: deliverable }) { + changeDeliverable(deliverable) { this.set('success', false); this.set('error', ''); deliverable.get('Event').then(event => { @@ -183,10 +175,6 @@ export default Ember.Controller.extend({ }); return false; }, - changeDeliverableFromGrading(deliverable) { - this.actions.changeDeliverable.apply(this, [{ meta: deliverable }]); - return false; - }, book() { this.set('success', false); this.set('error', ''); diff --git a/app/templates/evaluator.hbs b/app/templates/evaluator.hbs index b4b2934..cbfa69e 100644 --- a/app/templates/evaluator.hbs +++ b/app/templates/evaluator.hbs @@ -72,7 +72,7 @@ {{filter.value}} {{/power-select}} {{#if filteredDeliverables}} - {{table-component withoutNumber=true header=headerGrading body=filteredDeliverables rowIndecies=rowIndeciesGrading clickable=true changeEvent=(action 'changeDeliverableFromGrading') onClickRowAction='changeEvent'}} + {{table-component withoutNumber=true header=headerGrading body=filteredDeliverables rowIndecies=rowIndeciesGrading clickable=true changeEvent=(action 'changeDeliverable') onClickRowAction='changeEvent'}} {{else}}
Nothing to show.
{{/if}} @@ -81,8 +81,11 @@ - {{#unless (eq selectedDeliverable.Corrector.id model.user.id)}} -
Sorry, you have not been chosen for grading this. First select this for grading, go to the 'Select for grading' menu.
+ {{#unless (or (eq selectedDeliverable.Corrector.id model.user.id) selectedDeliverable.finalized)}} +
+ Sorry, you have not been chosen for grading this. First select this for grading, go to the 'Select for grading' menu. + Maybe the finalization has not been ended by other user. (BTW you should never see this message) +
{{else}} {{#unless selectedDeliverable.finalized}}