Commit 64a509e7 authored by Curtis Adam's avatar Curtis Adam

Add cardset stats to show learn statistic view

parent c739cb97
......@@ -128,7 +128,9 @@
"notification": "Benachrichtigungen",
"mailNotificationCheckbox": "E-Mail",
"webNotificationCheckbox": "Web",
"notificationError": "Es muss mindestens eine Benachrichtigungsart ausgewählt werden!"
"notificationError": "Es muss mindestens eine Benachrichtigungsart ausgewählt werden!",
"card": "Karte",
"cards": "Karten"
},
"confirmEndLearn-form": {
"title": "Lernphase beenden",
......
......@@ -130,7 +130,9 @@
"webNotificationRadio": "Browser",
"mailNotificationCheckbox": "E-Mail",
"webNotificationCheckbox": "Web",
"notificationError": "Please choose at least one way of notification!"
"notificationError": "Please choose at least one way of notification!",
"card": "Card",
"cards": "Cards"
},
"confirmEndLearn-form": {
"title": "Stop Learn-Phase",
......
......@@ -67,7 +67,10 @@ Router.route('/cardset/:_id/editors', {
Router.route('/cardset/:_id/stats', {
name: 'cardsetstats',
template: 'cardsetLearnActivityStatistic'
template: 'cardsetLearnActivityStatistic',
data: function () {
return Cardsets.findOne({_id: this.params._id});
}
});
Router.route('/cardsetlist', function () {
......@@ -78,8 +81,7 @@ Router.route('/cardsetlist/:_id', {
name: 'cardsetlistid',
template: 'cardset',
data: function () {
var currentCardset = this.params._id;
return Cardsets.findOne({_id: currentCardset});
return Cardsets.findOne({_id: this.params._id});
}
});
......
......@@ -1163,20 +1163,46 @@
<template name="cardsetLearnActivityStatistic">
<div class="container">
<div class="row">
<div id="cardsetInfoDetail" class="col-md-5">
<div class="panel panel-default cardsetInfo">
<div class="panel-body">
<h4>{{this.name}}</h4>
<hr>
<div class="col-xs-6">
<strong>{{_ "set-list.learnphase"}}:</strong><br>
<strong>{{_ "pool.activeLearners"}}:</strong><br>
<strong>{{_ "confirmLearn-form.maxCards"}}:</strong><br>
<strong>{{_ "confirmLearn-form.daysBeforeReset"}}:</strong><br>
<strong>{{_ "confirmLearn-form.learningStart"}}:</strong><br>
<strong>{{_ "confirmLearn-form.learningEnd"}}:</strong><br>
<button id="exportCSV" class="btn btn-success btn-raised btn-default">{{_
"box_export"}}</button>
</div>
<div class="col-xs-6">
{{getLearningStatus}}<br>
{{this.learners}}<br>
{{getWorkload}}<br>
{{getDeadline}}<br>
{{getDate this.LearningStart}}<br>
{{getDate this.LearningEnd}}
</div>
</div>
</div>
</div>
</div>
<div style="overflow-x:auto;">
<button id="exportCSV" class="btn btn-default btn-raised btn-default">{{_
"box_export"}}</button>
<table class="table table-striped table-hover ">
<tbody>
<tr class="active">
<th>{{_ "panel-body.givenname"}}</th>
<th>{{_ "panel-body.birthname"}}</th>
<th>{{_ "panel-body.email"}}</th>
<th>{{_ "subject1"}}</th>
<th>{{_ "subject2"}}</th>
<th>{{_ "subject3"}}</th>
<th>{{_ "subject4"}}</th>
<th>{{_ "subject5"}}</th>
<th>{{_ "subject1"}} [{{this.learningInterval.[0]}}]</th>
<th>{{_ "subject2"}} [{{this.learningInterval.[1]}}]</th>
<th>{{_ "subject3"}} [{{this.learningInterval.[2]}}]</th>
<th>{{_ "subject4"}} [{{this.learningInterval.[3]}}]</th>
<th>{{_ "subject5"}} [{{this.learningInterval.[4]}}]</th>
<th>{{_ "subject6"}}</th>
</tr>
{{#each getCardsetStats}}
......
......@@ -728,6 +728,30 @@ Template.cardsetSidebar.helpers({
Template.cardsetLearnActivityStatistic.helpers({
getCardsetStats: function () {
return Session.get("cardsetStats");
},
getDate: function (date) {
return moment(date).format("DD.MM.YYYY");
},
getDeadline: function () {
if (this.daysBeforeReset === 1) {
return this.daysBeforeReset + " " + TAPi18n.__('panel-body-experience.day');
} else {
return this.daysBeforeReset + " " + TAPi18n.__('panel-body-experience.day_plural');
}
},
getLearningStatus: function () {
if (this.learningEnd.getTime() > new Date().getTime()) {
return TAPi18n.__('set-list.activeLearnphase');
} else {
return TAPi18n.__('set-list.inactiveLearnphase');
}
},
getWorkload: function () {
if (this.maxCards === 1) {
return this.maxCards + " " + TAPi18n.__('confirmLearn-form.card');
} else {
return this.maxCards + " " + TAPi18n.__('confirmLearn-form.cards');
}
}
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment