Commit 3c218af5 authored by Curtis Adam's avatar Curtis Adam

Display the create transcript button for the my bonus statistics view

parent 7ebbad15
......@@ -178,6 +178,18 @@ if (Meteor.isServer) {
this.ready();
}
});
Meteor.publish("cardsetTranscriptMyBonus", function (card_id) {
if (this.userId) {
let card = TranscriptBonus.findOne({card_id: card_id}, {fields: {cardset_id: 1, _id: 1, owner: 1}});
if (UserPermissions.isAdmin() || UserPermissions.isOwner(card.owner)) {
return Cardsets.find({_id: card.cardset_id});
} else {
this.ready();
}
} else {
this.ready();
}
});
Meteor.publish("cardsetTranscriptBonusReview", function (cardset_id) {
if (this.userId) {
let cardset = Cardsets.findOne({_id: cardset_id}, {fields: {_id: 1, owner: 1}});
......
......@@ -256,7 +256,7 @@ Template.registerHelper('isMyBonusTranscriptsRoute', function () {
Template.registerHelper('isBonusTranscriptsRoute', function () {
return Route.isMyBonusTranscripts() || Route.isTranscriptBonus() || Route.isPresentationTranscriptBonusCardset() || Route.isPresentationTranscriptReview();
return Route.isMyBonusTranscripts() || Route.isTranscriptBonus() || Route.isPresentationTranscriptBonusCardset() || Route.isPresentationTranscriptBonus() || Route.isPresentationTranscriptReview();
});
Template.registerHelper('isPersonalTranscriptsRoute', function () {
......
......@@ -764,7 +764,7 @@ Router.route('/presentation/transcripts/bonus/:card_id', {
name: 'presentationTranscriptBonus',
template: 'presentation',
subscriptions: function () {
return [Meteor.subscribe('transcriptCard', this.params.card_id), Meteor.subscribe('myTranscriptBonus'), Meteor.subscribe('cardsetTranscriptBonus', this.params._id)];
return [Meteor.subscribe('transcriptCard', this.params.card_id), Meteor.subscribe('myTranscriptBonus'), Meteor.subscribe('cardsetTranscriptMyBonus', this.params.card_id)];
},
data: function () {
if (ServerStyle.gotTranscriptsEnabled()) {
......
......@@ -5,4 +5,9 @@
{{#each transcriptBonus}}
{{> cardsetIndexTranscriptStatisticsItemInfo}}
{{/each}}
{{#if isMyBonusTranscriptsRoute}}
{{#unless transcriptBonus}}
{{> noResults}}
{{/unless}}
{{/if}}
</template>
......@@ -35,8 +35,9 @@
{{#if isActiveRoute regex='transcriptsBonus'}}
{{> cardsetIndexTranscriptNavigation}}
{{#if isViewActive 1}}
<br>
<br>
<div class="col-xs-12">
{{> filterItemCreateTranscriptButton}}
</div>
{{> cardsetIndexTranscriptStatistics}}
{{else}}
{{> filterIndexTranscripts}}
......@@ -77,7 +78,9 @@
{{> deleteTranscriptForm}}
<span class="filter-index-buttons empty-button-placeholder">
{{#if isTranscriptRoute}}
{{> filterItemCreateTranscriptButton}}
<div class="col-xs-12">
{{> filterItemCreateTranscriptButton}}
</div>
{{/if}}
{{#if isCardsetTranscriptBonusRoute}}
{{> cardsetIndexTranscriptSubmissionsItemReviewButton}}
......
......@@ -115,9 +115,6 @@ Template.filterIndex.helpers({
}
});
Template.filterIndex.onCreated(function () {
Session.set('transcriptViewingMode', 2);
});
/*
* ############################################################################
......
......@@ -2,6 +2,7 @@ import {Template} from "meteor/templating";
import {Meteor} from "meteor/meteor";
import {NavigatorCheck} from "../../../../../../../api/navigatorCheck";
import "./bonus.html";
import {Session} from "meteor/session";
/*
* ############################################################################
......@@ -9,6 +10,13 @@ import "./bonus.html";
* ############################################################################
*/
Template.filterIndexPool.events({
'click #navbar-transcripts-bonus': function () {
Session.set('transcriptViewingMode', 1);
}
});
Template.mainNavigationTopItemTranscriptsItemBonus.helpers({
isSmartPhoneAndOwnsNoCards: function () {
if (NavigatorCheck.isSmartphone()) {
......
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