Commit b330b115 authored by Curtis Adam's avatar Curtis Adam

Add transcript statistics to the my bonus transcripts view

parent 07e4e7fe
......@@ -587,10 +587,10 @@ $themes: (
$transcript_bonus_info_lecture_date_day_hover_background: map-get($map, "transcript_bonus_info_lecture_date_day_hover_background");
$transcript_bonus_submission_count_badge_text: map-get($map, "transcript_bonus_submission_count_badge_text");
$transcript_bonus_submission_count_badge_background: map-get($map, "transcript_bonus_submission_count_badge_background");
//transcript bonus user statistics colors
$transcript_bonus_user_statistics_name_background: map-get($map, "transcript_bonus_user_statistics_name_background");
$transcript_bonus_user_statistics_details_background: map-get($map, "transcript_bonus_user_statistics_details_background");
$transcript_bonus_user_statistics_details_text: map-get($map, "transcript_bonus_user_statistics_details_text");
//transcript bonus statistics info colors
$transcript_bonus_statistics_info_name_background: map-get($map, "transcript_bonus_statistics_info_name_background");
$transcript_bonus_statistics_info_details_background: map-get($map, "transcript_bonus_statistics_info_details_background");
$transcript_bonus_statistics_info_details_text: map-get($map, "transcript_bonus_statistics_info_details_text");
//markdeep editor colors
$markdeep_help_text: map-get($map, "markdeep_help_text");
$markdeep_help_background: map-get($map, "markdeep_help_background");
......@@ -3736,13 +3736,13 @@ $themes: (
border-color: $cube_border;
}
//transcript bonus user statistics colors
.transcript-bonus-user-statistics {
.transcript-bonus-statistics-info {
th {
background-color: $transcript_bonus_user_statistics_name_background !important;
background-color: $transcript_bonus_statistics_info_name_background !important;
}
td {
background-color: $transcript_bonus_user_statistics_details_background !important;
color: $transcript_bonus_user_statistics_details_text !important;
background-color: $transcript_bonus_statistics_info_details_background !important;
color: $transcript_bonus_statistics_info_details_text !important;
}
}
}
......
......@@ -630,10 +630,10 @@
"transcript_bonus_info_lecture_date_day_hover_background": LightGoldenRodYellow,
"transcript_bonus_submission_count_badge_text": white,
"transcript_bonus_submission_count_badge_background": $thm_orange,
//transcript bonus user statistics colors
"transcript_bonus_user_statistics_name_background": LightGoldenRodYellow,
"transcript_bonus_user_statistics_details_background": white,
"transcript_bonus_user_statistics_details_text": black,
//transcript bonus statistics info colors
"transcript_bonus_statistics_info_name_background": LightGoldenRodYellow,
"transcript_bonus_statistics_info_details_background": white,
"transcript_bonus_statistics_info_details_text": black,
//markdeep editor colors
"markdeep_help_text": $white,
"markdeep_help_background": $thm_orange,
......
......@@ -137,6 +137,12 @@ export let Filter = class Filter {
case "_id":
filter._id = content;
break;
case "cardset_id":
filter.cardset_id = content;
break;
case "user_id":
filter.user_id = content;
break;
case "transcriptBonus":
delete filter.learningActive;
filter['transcriptBonus.enabled'] = true;
......@@ -308,12 +314,16 @@ export let Filter = class Filter {
if (!Route.isWorkload() && activeFilter !== undefined && !Route.isTranscript() && !Route.isTranscriptBonus()) {
query.shuffled = activeFilter.shuffled;
}
if (FilterNavigation.gotRatingFilter(FilterNavigation.getRouteId()) && activeFilter.rating !== undefined) {
let ratingQuery = {rating: activeFilter.rating};
if (Route.isMyBonusTranscripts()) {
ratingQuery.user_id = Meteor.userId();
} else {
ratingQuery.cardset_id = Router.current().params._id;
if (FilterNavigation.gotRatingFilter(FilterNavigation.getRouteId())) {
let ratingQuery = {};
if (activeFilter.rating !== undefined) {
ratingQuery.rating = activeFilter.rating;
}
if (activeFilter.user_id !== undefined) {
ratingQuery.user_id = activeFilter.user_id;
}
if (activeFilter.cardset_id !== undefined) {
ratingQuery.cardset_id = activeFilter.cardset_id;
}
let cardsWithRating = _.uniq(TranscriptBonus.find(ratingQuery, {
fields: {card_id: 1}
......
......@@ -66,7 +66,7 @@ Meteor.methods({
if (target === 'lecturer') {
var lecturers = Roles.getUsersInRole('lecturer');
lecturers.forEach(function (lecturer) {
Meteor.call("createNotification", lecturer._id, type, text, link_id, 'user', receiver);
Meteor.call("createNotification", lecturer._id, type, text, link_id, 'stats.js', receiver);
});
} else if (target === 'admin') {
var admins = Roles.getUsersInRole([
......@@ -77,7 +77,7 @@ Meteor.methods({
Meteor.call("createNotification", admin._id, type, text, link_id, 'admin', receiver);
});
} else {
Meteor.call("createNotification", target, type, text, link_id, 'user', receiver);
Meteor.call("createNotification", target, type, text, link_id, 'stats.js', receiver);
}
},
......
......@@ -222,7 +222,7 @@ export let Route = class Route {
}
static isFilterIndex () {
return (this.isHome() || this.isPool() || this.isMyCardsets() || this.isRepetitorium() || this.isAllCardsets() || this.isWorkload() || this.isAllRepetitorien() || this.isPersonalRepetitorien() || this.isMyTranscripts() || this.isShuffle() || this.isEditShuffle() || this.isTranscriptBonus());
return (this.isHome() || this.isPool() || this.isMyCardsets() || this.isRepetitorium() || this.isAllCardsets() || this.isWorkload() || this.isAllRepetitorien() || this.isPersonalRepetitorien() || this.isMyTranscripts() || this.isMyBonusTranscripts() || this.isShuffle() || this.isEditShuffle() || this.isTranscriptBonus());
}
static isFirstTimeVisit () {
......
......@@ -119,7 +119,7 @@ export let ServerInventoryTools = class ServerInventoryTools {
return this.splitLargeNumbers(Counts.get('wordcloudProCounter'));
}
break;
case "user":
case "stats.js":
if (Meteor.settings.public.welcome.fakeStatistics) {
return this.splitLargeNumbers(inventory.curValue.user.total);
} else {
......
<template name="cardsetIndexTranscriptNavigationItemStatistics">
<div class="col-xs-12 col-sm-4">
<div class="col-xs-12 {{#if isCardsetTranscriptBonusRoute}}col-sm-4{{else}}col-sm-6{{/if}}">
<div id="showTranscriptStatistics" class="btn btn-raised btn-block {{#if isViewActive 1}}btn-primary{{else}}btn-default{{/if}}">
<span class="flex-content">
{{_ "transcriptForm.bonus.form.button.statistics"}}
......
<template name="cardsetIndexTranscriptNavigationItemSubmissions">
<div class="col-xs-12 col-sm-4">
<div class="col-xs-12 {{#if isCardsetTranscriptBonusRoute}}col-sm-4{{else}}col-sm-6{{/if}}">
<div id="showTranscriptSubmissions" class="btn btn-raised btn-block {{#if isViewActive 2}}btn-primary{{else}}btn-default{{/if}}">
<span class="flex-content">
{{_ "transcriptForm.bonus.form.button.list"}}
......
<template name="cardsetIndexTranscriptNavigation">
{{> cardsetIndexTranscriptNavigationItemStatistics}}
{{> cardsetIndexTranscriptNavigationItemSubmissions}}
{{> cardsetIndexTranscriptNavigationItemSettings}}
{{#if isCardsetTranscriptBonusRoute}}
{{> cardsetIndexTranscriptNavigationItemSettings}}
{{/if}}
<br>
</template>
<template name="cardsetIndexTranscriptStatisticsItemUserAccepted">
<template name="cardsetIndexTranscriptStatisticsItemBoxAccepted">
<tr>
<td>
{{{getBonusTranscriptRating 1}}}
{{#if (getSubmissions this.cardset_id this.user_id 1)}}
<a href=""
class="filterSubmissionsRating cards-filter-element"
data-id="{{this._id}}" data-rating="1">{{_
data-user="{{this.user_id}}" data-cardset="{{this.cardset_id}}" data-rating="1">{{_
"transcriptForm.bonus.statistics.accepted"}}:</a>
{{else}}
{{_ "transcriptForm.bonus.statistics.accepted"}}:
......
......@@ -3,11 +3,11 @@ import {TranscriptBonusList} from "../../../../../../../api/transcriptBonus";
/*
* ############################################################################
* cardsetIndexTranscriptStatisticsItemUserAccepted
* cardsetIndexTranscriptStatisticsItemBoxAccepted
* ############################################################################
*/
Template.cardsetIndexTranscriptStatisticsItemUserAccepted.helpers({
Template.cardsetIndexTranscriptStatisticsItemBoxAccepted.helpers({
getBonusTranscriptRating: function (type) {
return TranscriptBonusList.getBonusTranscriptRating(type);
},
......
<template name="cardsetIndexTranscriptStatisticsItemBoxAuthor">
<tr>
<th colspan="2">
<a href="" class="info-box-author" data-id="{{this.user_id}}">{{getAuthorName this.user_id}}</a>
</th>
</tr>
</template>
import "./author.html";
/*
* ############################################################################
* cardsetIndexTranscriptStatisticsItemBoxAuthor
* ############################################################################
*/
Template.cardsetIndexTranscriptStatisticsItemBoxAuthor.events({
'click .info-box-author': function (event) {
event.preventDefault();
Router.go('admin_user', {
_id: $(event.target).data('id')
});
}
});
<template name="cardsetIndexTranscriptStatisticsItemUserBonus">
<template name="cardsetIndexTranscriptStatisticsItemBoxBonus">
<tr>
<td>
<i class="transcript-achieved-bonus fas fa-award"></i>&nbsp;{{_ "transcriptForm.bonus.statistics.bonus"}}:
......
......@@ -3,11 +3,11 @@ import {TranscriptBonusList} from "../../../../../../../api/transcriptBonus";
/*
* ############################################################################
* cardsetIndexTranscriptStatisticsItemUserBonus
* cardsetIndexTranscriptStatisticsItemBoxBonus
* ############################################################################
*/
Template.cardsetIndexTranscriptStatisticsItemUserBonus.helpers({
Template.cardsetIndexTranscriptStatisticsItemBoxBonus.helpers({
getAchievedBonus: function (cardset_id, user_id) {
return TranscriptBonusList.getAchievedBonus(cardset_id, user_id);
}
......
<template name="cardsetIndexTranscriptStatisticsItemBoxCardset">
<tr>
<th colspan="2">
<a href="" class="info-box-cardset" data-id="{{this.cardset_id}}">{{getCardsetName this.cardset_id}}</a>
</th>
</tr>
</template>
import "./cardset.html";
import {Cardsets} from "../../../../../../../api/cardsets";
/*
* ############################################################################
* cardsetIndexTranscriptStatisticsItemBoxCardset
* ############################################################################
*/
Template.cardsetIndexTranscriptStatisticsItemBoxCardset.helpers({
getCardsetName: function (cardset_id) {
return Cardsets.findOne({_id: cardset_id}).name;
}
});
Template.cardsetIndexTranscriptStatisticsItemBoxCardset.events({
'click .info-box-cardset': function (event) {
event.preventDefault();
Router.go('cardsetdetailsid', {
_id: $(event.target).data('id')
});
}
});
<template name="cardsetIndexTranscriptStatisticsItemUserDenied">
<template name="cardsetIndexTranscriptStatisticsItemBoxDenied">
<tr>
<td>
{{{getBonusTranscriptRating 2}}}
{{#if (getSubmissions this.cardset_id this.user_id 1)}}
<a href="" class="filterSubmissionsRating cards-filter-element" data-id="{{this._id}}"
{{#if (getSubmissions this.cardset_id this.user_id 2)}}
<a href="" class="filterSubmissionsRating cards-filter-element" data-user="{{this.user_id}}" data-cardset="{{this.cardset_id}}"
data-rating="2">{{_
"transcriptForm.bonus.statistics.denied"}}:</a>
{{else}}
......
......@@ -3,11 +3,11 @@ import {TranscriptBonusList} from "../../../../../../../api/transcriptBonus";
/*
* ############################################################################
* cardsetIndexTranscriptStatisticsItemUserDenied
* cardsetIndexTranscriptStatisticsItemBoxDenied
* ############################################################################
*/
Template.cardsetIndexTranscriptStatisticsItemUserDenied.helpers({
Template.cardsetIndexTranscriptStatisticsItemBoxDenied.helpers({
getBonusTranscriptRating: function (type) {
return TranscriptBonusList.getBonusTranscriptRating(type);
},
......
<template name="cardsetIndexTranscriptStatisticsItemUserLastSubmission">
<template name="cardsetIndexTranscriptStatisticsItemBoxLastSubmission">
<tr>
<td>
<i class="far fa-calendar"></i>&nbsp;{{_ "transcriptForm.bonus.statistics.lastSubmission"}}:
......
......@@ -3,11 +3,11 @@ import {TranscriptBonus, TranscriptBonusList} from "../../../../../../../api/tra
/*
* ############################################################################
* cardsetIndexTranscriptStatisticsItemUserLastSubmission
* cardsetIndexTranscriptStatisticsItemBoxLastSubmission
* ############################################################################
*/
Template.cardsetIndexTranscriptStatisticsItemUserLastSubmission.helpers({
Template.cardsetIndexTranscriptStatisticsItemBoxLastSubmission.helpers({
lastSubmission: function (cardset_id, user_id) {
let bonusTranscript = TranscriptBonus.findOne({cardset_id: cardset_id, user_id: user_id}, {sort: {date: -1}});
if (bonusTranscript !== undefined) {
......
<template name="cardsetIndexTranscriptStatisticsItemUserPending">
<template name="cardsetIndexTranscriptStatisticsItemBoxPending">
<tr>
<td>
{{{getBonusTranscriptRating 0}}}
{{#if (getSubmissions this.cardset_id this.user_id 0)}}
<a href="" class="filterSubmissionsRating cards-filter-element" data-id="{{this._id}}"
<a href="" class="filterSubmissionsRating cards-filter-element" data-user="{{this.user_id}}" data-cardset="{{this.cardset_id}}"
data-rating="0">{{_ "transcriptForm.bonus.statistics.pending"}}:</a>
{{else}}
{{_ "transcriptForm.bonus.statistics.pending"}}:
......
......@@ -3,11 +3,11 @@ import {TranscriptBonusList} from "../../../../../../../api/transcriptBonus";
/*
* ############################################################################
* cardsetIndexTranscriptStatisticsItemUserPending
* cardsetIndexTranscriptStatisticsItemBoxPending
* ############################################################################
*/
Template.cardsetIndexTranscriptStatisticsItemUserPending.helpers({
Template.cardsetIndexTranscriptStatisticsItemBoxPending.helpers({
getBonusTranscriptRating: function (type) {
return TranscriptBonusList.getBonusTranscriptRating(type);
},
......
<template name="cardsetIndexTranscriptStatisticsItemUserSubmissions">
<template name="cardsetIndexTranscriptStatisticsItemBoxSubmissions">
<tr>
<td>
<i class="fas fa-clipboard"></i>&nbsp;
<i class="fas fa-clipboard"></i>
{{#if (getSubmissions this.cardset_id this.user_id undefined)}}
<a href="" class="filterTranscriptSubmissions cards-filter-element"
data-id="{{this._id}}">{{_ "transcriptForm.info.submissions"}}:</a>
data-user="{{this.user_id}}" data-cardset="{{this.cardset_id}}">{{_ "transcriptForm.info.submissions"}}:</a>
{{else}}
{{_ "transcriptForm.info.submissions"}}:
{{/if}}
......
......@@ -3,11 +3,11 @@ import {TranscriptBonusList} from "../../../../../../../api/transcriptBonus";
/*
* ############################################################################
* cardsetIndexTranscriptStatisticsItemUserSubmissions
* cardsetIndexTranscriptStatisticsItemBoxSubmissions
* ############################################################################
*/
Template.cardsetIndexTranscriptStatisticsItemUserSubmissions.helpers({
Template.cardsetIndexTranscriptStatisticsItemBoxSubmissions.helpers({
getSubmissions: function (cardset_id, user_id, type) {
return TranscriptBonusList.getSubmissions(cardset_id, user_id, type);
}
......
<template name="cardsetIndexTranscriptStatisticsItemInfo">
<div class="col-xs-12 col-sm-6 {{#if isCardsetTranscriptBonusRoute}}col-md-4 col-lg-3{{/if}} transcript-bonus-statistics-info">
<table class="table">
<thead>
{{#if isCardsetTranscriptBonusRoute}}
{{> cardsetIndexTranscriptStatisticsItemBoxAuthor}}
{{else}}
{{> cardsetIndexTranscriptStatisticsItemBoxCardset}}
{{/if}}
</thead>
<tbody>
{{> cardsetIndexTranscriptStatisticsItemBoxSubmissions}}
{{> cardsetIndexTranscriptStatisticsItemBoxPending}}
{{> cardsetIndexTranscriptStatisticsItemBoxAccepted}}
{{> cardsetIndexTranscriptStatisticsItemBoxDenied}}
{{> cardsetIndexTranscriptStatisticsItemBoxBonus}}
{{> cardsetIndexTranscriptStatisticsItemBoxLastSubmission}}
</tbody>
</table>
</div>
</template>
import "./user.html";
import "./user/accepted.js";
import "./user/author.js";
import "./user/bonus.js";
import "./user/denied.js";
import "./user/lastSubmission.js";
import "./user/pending.js";
import "./user/submissions.js";
import "./info.html";
import "./box/accepted.js";
import "./box/author.js";
import "./box/bonus.js";
import "./box/cardset.js";
import "./box/denied.js";
import "./box/lastSubmission.js";
import "./box/pending.js";
import "./box/submissions.js";
import {FilterNavigation} from "../../../../../../api/filterNavigation";
import {Filter} from "../../../../../../api/filter";
import {Route} from "../../../../../../api/route";
import {Session} from "meteor/session";
/*
* ############################################################################
* cardsetIndexTranscriptStatisticsItemUser
* cardsetIndexTranscriptStatisticsItemInfo
* ############################################################################
*/
Template.cardsetIndexTranscriptStatisticsItemUser.events({
Template.cardsetIndexTranscriptStatisticsItemInfo.events({
'click .filterTranscriptSubmissions': function (event) {
Session.set('transcriptViewingMode', 2);
Filter.setActiveFilter($(event.target).data('id'), "author", 30);
if (Route.isTranscriptBonus()) {
Filter.setActiveFilter($(event.target).data('user'), "user_id", 30);
} else {
Filter.setActiveFilter($(event.target).data('cardset'), "cardset_id", 30);
}
Filter.setActiveFilter(undefined, "rating", 30);
FilterNavigation.showDropdown();
},
'click .filterSubmissionsRating': function (event) {
Session.set('transcriptViewingMode', 2);
Filter.setActiveFilter($(event.target).data('id'), "author", 30);
if (Route.isTranscriptBonus()) {
Filter.setActiveFilter($(event.target).data('user'), "user_id", 30);
} else {
Filter.setActiveFilter($(event.target).data('cardset'), "cardset_id", 30);
}
Filter.setActiveFilter($(event.target).data('rating'), "rating", 30);
FilterNavigation.showDropdown();
}
......
<template name="cardsetIndexTranscriptStatisticsItemUserAuthor">
<tr>
<th colspan="2">
{{getAuthorName this.user_id}}
</th>
</tr>
</template>
<template name="cardsetIndexTranscriptStatistics">
{{> cardsetIndexTranscriptStatisticsItemCardset}}
{{#each transcriptBonusUser}}
{{> cardsetIndexTranscriptStatisticsItemUser}}
{{#if isCardsetTranscriptBonusRoute}}
{{> cardsetIndexTranscriptStatisticsItemCardset}}
{{/if}}
{{#each transcriptBonus}}
{{> cardsetIndexTranscriptStatisticsItemInfo}}
{{/each}}
</template>
import "./statistics.html";
import "./item/cardset.js";
import "./item/user.js";
import {TranscriptBonus, TranscriptBonusList} from "../../../../../api/transcriptBonus";
import "./item/info.js";
import {TranscriptBonus} from "../../../../../api/transcriptBonus";
import {Template} from "meteor/templating";
import {Filter} from "../../../../../api/filter";
import {FilterNavigation} from "../../../../../api/filterNavigation";
import {Cardsets} from "../../../../../api/cardsets";
import {Session} from "meteor/session";
import {Route} from "../../../../../api/route";
/*
* ############################################################################
......@@ -29,33 +31,31 @@ Template.cardsetIndexTranscriptStatistics.events({
});
Template.cardsetIndexTranscriptStatistics.helpers({
transcriptBonusUser: function () {
let transcriptBonusUsers = _.uniq(TranscriptBonus.find({cardset_id: Router.current().params._id}, {
fields: {user_id: 1}
}).fetch().map(function (x) {
return x.user_id;
}), true);
let users = Meteor.users.find({_id: {$in: transcriptBonusUsers}}, {sort: {"profile.birthname": 1}, fields: {_id: 1}}).fetch();
let list = [];
for (let i = 0; i < users.length; i++) {
list.push({user_id: users[i]._id, cardset_id: Router.current().params._id});
transcriptBonus: function () {
if (Route.isTranscriptBonus()) {
let transcriptBonusUsers = _.uniq(TranscriptBonus.find({cardset_id: Router.current().params._id}, {
fields: {user_id: 1}
}).fetch().map(function (x) {
return x.user_id;
}), true);
let users = Meteor.users.find({_id: {$in: transcriptBonusUsers}}, {sort: {"profile.birthname": 1}, fields: {_id: 1}}).fetch();
let list = [];
for (let i = 0; i < users.length; i++) {
list.push({user_id: users[i]._id, cardset_id: Router.current().params._id});
}
return list;
} else {
let transcriptBonusCardsets = _.uniq(TranscriptBonus.find({user_id: Meteor.userId()}, {
fields: {cardset_id: 1}
}).fetch().map(function (x) {
return x.cardset_id;
}), true);
let cardsets = Cardsets.find({_id: {$in: transcriptBonusCardsets}}, {sort: {"name": 1}, fields: {_id: 1}}).fetch();
let list = [];
for (let i = 0; i < cardsets.length; i++) {
list.push({user_id: Meteor.userId(), cardset_id: cardsets[i]._id});
}
return list;
}
return list;
},
getSubmissions: function (id, rating = undefined) {
let query = {cardset_id: Router.current().params._id, user_id: id};
if (rating !== undefined) {
query.rating = rating;
}
return TranscriptBonus.find(query).count();
},
lastSubmission: function (id) {
let bonusTranscript = TranscriptBonus.findOne({user_id: id}, {sort: {date: -1}});
if (bonusTranscript !== undefined) {
return TranscriptBonusList.getLectureName(bonusTranscript, false);
}
},
getBonusTranscriptRating: function (type) {
return TranscriptBonusList.getBonusTranscriptRating(type);
}
});
......@@ -21,6 +21,7 @@ Session.setDefault('transcriptViewingMode', 1);
Template.cardsetIndexTranscript.onCreated(function () {
Filter.resetActiveFilter();
Session.set('transcriptViewingMode', 1);
});
Template.cardsetIndexTranscript.helpers({
......
......@@ -36,14 +36,13 @@
}
}
}
}
.transcript-bonus-user-statistics {
padding: 10px 15px;
table {
th {
font-size: 16px;
}
.transcript-bonus-statistics-info {
padding: 10px 15px;
table {
th {
font-size: 16px;
}
}
}
......@@ -32,7 +32,18 @@
{{/if}}
{{#if isActiveRoute regex='transcriptsPersonal|transcriptsBonus'}}
{{> filterIndexTranscripts}}
{{#if isActiveRoute regex='transcriptsBonus'}}
{{> cardsetIndexTranscriptNavigation}}
{{#if isViewActive 1}}
<br>
<br>
{{> cardsetIndexTranscriptStatistics}}
{{else}}
{{> filterIndexTranscripts}}
{{/if}}
{{else}}
{{> filterIndexTranscripts}}
{{/if}}
{{/if}}
{{#if isCardsetTranscriptBonusRoute}}
{{> filterIndexTranscripts}}
......@@ -104,8 +115,8 @@
<template name="filterIndexCreate">
<span class="filter-index-buttons empty-button-placeholder">
{{#if isActiveRoute 'create'}}
{{> filterItemCreateCardsetButton}}
{{> filterItemImportCardsetButton}}
{{> filterItemCreateCardsetButton}}
{{> filterItemImportCardsetButton}}
{{/if}}
</span>
{{#if cardsetList 0}}
......
......@@ -49,9 +49,11 @@ import "../modal/deleteCardset.js";
import "../modal/deleteTranscript.js";
import "../modal/selectWorkload.js";
import "./index.html";
import {Meteor} from "meteor/meteor";
Session.setDefault('cardsetId', undefined);
Session.set('moduleActive', true);
Session.setDefault('transcriptViewingMode', 2);
/*
* ############################################################################
......@@ -98,6 +100,16 @@ Template.filterIndex.events({
}
});
Template.filterIndex.helpers({
isViewActive: function (id) {
return Session.get('transcriptViewingMode') === id;
}
});
Template.filterIndex.onCreated(function () {
Session.set('transcriptViewingMode', 2);
});
/*
* ############################################################################
* filterIndexPool
......
<template name="filterIndexItemCard">
<div class="resultItem col-xs-12">
{{#unless this.index}}
{{#if isBonusTranscriptsRoute}}
{{#if isCardsetTranscriptBonusRoute}}
{{> filterIndexItemTitleRowTopic (setGridSize "col-sm-4 col-md-5")}}
{{> filterIndexItemTitleRowAuthor (setGridSize "col-sm-4 col-md-3")}}
{{> filterIndexItemTitleRowDateCreated (setGridSize "col-sm-2")}}
......@@ -14,7 +14,7 @@
{{/unless}}
<div class="resultItemHeaderWrapper col-xs-12">
<div class="resultItemHeaderTopArea row">
{{#if isBonusTranscriptsRoute}}
{{#if isCardsetTranscriptBonusRoute}}
{{> filterIndexItemTopTopic (setGridSize "col-xs-6 col-sm-4 col-md-5")}}
{{> filterIndexItemTopAuthor (setGridSize "col-xs-6 col-sm-4 col-md-3")}}
{{> filterIndexItemTopDateCreated (setGridSize "hidden-xs col-sm-2")}}
......
......@@ -26,7 +26,7 @@ Template.mainNavigationTopItemProfile.helpers({
if (Roles.userIsInRole(Meteor.userId(), ['admin', 'editor'])) {
return Notifications.find({}).count();
} else {
return Notifications.find({read: false, target_type: 'user', target: Meteor.userId()}).count();
return Notifications.find({read: false, target_type: 'stats.js', target: Meteor.userId()}).count();
}
}
});
......@@ -42,7 +42,7 @@
{{/unless}}
{{/unless}}
{{#if isFilterIndex}}
{{#unless isPersonalTranscriptsRoute}}
{{#unless isMyTranscriptsRoute}}
{{#if gotCardsetsForFilter}}
<div class="navbar-header-item pull-right">
{{> mainNavigationTopItemFilterMobile}}
......@@ -72,15 +72,13 @@
{{> mainNavigationTopItemUseCasesDesktop}}
{{#unless isShuffleRoute}}
{{#unless isPersonalTranscriptsRoute}}
{{#unless isCardsetTranscriptBonusRoute}}
{{#if gotCardsetsForFilter}}
{{> mainNavigationTopItemSearch}}
{{/if}}
{{/unless}}
{{#if gotCardsetsForFilter}}
{{> mainNavigationTopItemSearch}}
{{/if}}
{{/unless}}
{{/unless}}