Commit 1e58dd75 authored by Curtis Adam's avatar Curtis Adam

Display the amount of submitted transcripts as cardset label

parent db54ceea
......@@ -562,6 +562,8 @@ $themes: (
$transcript_bonus_info_lecture_date_day_future_background: map-get($map, "transcript_bonus_info_lecture_date_day_future_background");
$transcript_bonus_info_lecture_date_day_hover_text: map-get($map, "transcript_bonus_info_lecture_date_day_hover_text");
$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");
//markdeep editor colors
$markdeep_help_text: map-get($map, "markdeep_help_text");
$markdeep_help_background: map-get($map, "markdeep_help_background");
......@@ -1692,6 +1694,11 @@ $themes: (
color: $primary !important;
}
.cardset-list-badge-transcript {
color: $transcript_bonus_submission_count_badge_text !important;
background-color: $transcript_bonus_submission_count_badge_background !important;
}
//navbar
//navbar all
......
......@@ -604,6 +604,8 @@
"transcript_bonus_info_lecture_date_day_future_background": rgba($thm_gray, 0.5),
"transcript_bonus_info_lecture_date_day_hover_text": black,
"transcript_bonus_info_lecture_date_day_hover_background": LightGoldenRodYellow,
"transcript_bonus_submission_count_badge_text": white,
"transcript_bonus_submission_count_badge_background": $thm_orange,
//markdeep editor colors
"markdeep_help_text": $white,
"markdeep_help_background": $thm_orange,
......
......@@ -28,6 +28,7 @@ import * as FilterConfig from "../../config/filter.js";
import {MainNavigation} from "../../api/mainNavigation";
import {BarfyStarsConfig} from "../../api/barfyStars.js";
import {Utilities} from "../../api/utilities";
import {TranscriptBonus} from "../../api/transcriptBonus";
Meteor.subscribe("collegesCourses");
......@@ -681,6 +682,17 @@ Template.registerHelper("getMomentsDateShort", function (date) {
return Utilities.getMomentsDateShort(date);
});
Template.registerHelper("getTranscriptSubmissions", function (cardset) {
if (Route.isMyBonusTranscripts() || Route.isTranscriptBonus()) {
let transcriptBonus = TranscriptBonus.findOne({card_id: cardset._id}, {fields: {cardset_id: 1}});
cardset = Cardsets.findOne({_id: transcriptBonus.cardset_id});
}
if (cardset.transcriptBonus !== undefined && cardset.transcriptBonus.stats !== undefined) {
return cardset.transcriptBonus.stats.submissions;
} else {
return 0;
}
});
// Returns the locale date
Template.registerHelper("getDateUpdated", function () {
......
......@@ -6,6 +6,11 @@
</span>
{{/unless}}
{{/unless}}
{{#if gotTranscriptBonus this._id}}
<span class="badge cardset-list-badge-transcript" title="{{_ "transcriptForm.info.submissions"}}">
{{getTranscriptSubmissions this}}
</span>
{{/if}}
{{{getKind this.kind 0}}}
{{{getShuffleLabel this.shuffled}}}
{{{getBonusLabel this.learningActive}}}
......
......@@ -37,6 +37,9 @@
<br>{{getBonusLectureDeadline}}
</span>
{{/unless}}
<span class="hidden-sm">
{{> transcriptFormSubmissionBadge}}
</span>
{{/if}}
</div>
{{#if isCardsetTranscriptBonusRoute}}
......
......@@ -281,6 +281,15 @@
{{this.quantity}}
</span>
{{/unless}}
{{#if gotTranscriptBonus this._id}}
{{> transcriptFormSubmissionBadge}}
{{/if}}
</template>
<template name="transcriptFormSubmissionBadge">
<span class="badge resultBadge cardsetBadge cardset-list-badge-transcript" data-id="{{this._id}}" title="{{_ "transcriptForm.info.submissions"}}">
{{getTranscriptSubmissions this}}
</span>
</template>
<template name="noFilterResults">
......
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