Commit e43929aa authored by Curtis Adam's avatar Curtis Adam

Display a infobox entry and label for wordcloud cardsets

parent 298dd9bc
......@@ -82,6 +82,8 @@ $themes: (
$button_navbar_collapse_text: map-get($map, "button_navbar_collapse_text");
$lecturer_authorized_background: map-get($map, "lecturer_authorized_background");
$lecturer_authorized_text: map-get($map, "lecturer_authorized_text");
$wordcloud_label_background: map-get($map, "wordcloud_label_background");
$wordcloud_label_text: map-get($map, "wordcloud_label_text");
$card_counter_background: map-get($map, "card_counter_background");
$card_counter_text: map-get($map, "card_counter_text");
$transcript_counter_background: map-get($map, "transcript_counter_background");
......@@ -2761,6 +2763,14 @@ $themes: (
}
}
.label-wordcloud {
background-color: $wordcloud_label_background !important;
color: $wordcloud_label_text !important;
i:hover {
color: $wordcloud_label_text !important;
}
}
.label-count-cards {
background-color: $card_counter_background !important;
color: $card_counter_text!important;
......
......@@ -117,6 +117,8 @@
"button_navbar_collapse_text": white,
"lecturer_authorized_background": $thm_green,
"lecturer_authorized_text": white,
"wordcloud_label_background": $thm_orange,
"wordcloud_label_text": white,
"card_counter_background": $btn_inactive,
"card_counter_text": white,
"transcript_counter_background": $thm_orange,
......
......@@ -461,7 +461,9 @@ Meteor.methods({
cardType: 1,
difficulty: 1,
learningActive: 1,
transcriptBonus: 1
transcriptBonus: 1,
wordcloud: 1,
lecturerAuthorized: 1
}
}).fetch();
}
......
......@@ -53,6 +53,8 @@ export let Icons = class Icons {
switch (type) {
case "lecturerAuthorized":
return config.labels.lecturerAuthorized;
case "wordcloud":
return config.labels.wordcloud;
default:
return "";
}
......
......@@ -55,7 +55,8 @@ let topNavigation = {
};
let labels = {
"lecturerAuthorized": "<i class='fa fa-graduation-cap'></i>"
"lecturerAuthorized": "<i class='fa fa-graduation-cap'></i>",
"wordcloud": "<i class='fa fa-cloud'></i>"
};
//Only used for the active route display on mobile. Will be carried over to desktop after the main template got refactored.
......
......@@ -417,6 +417,12 @@ Template.registerHelper("getLecturerAuthorizedLabel", function (cardset) {
}
});
Template.registerHelper("getWordcloudLabel", function (cardset) {
if (cardset.wordcloud !== undefined && cardset.wordcloud === true) {
return '<span class="label label-wordcloud" data-id="wordcloud" title="' + TAPi18n.__('serverStatistics.modal.table.header.wordcloud.default') + '">' + Icons.labels("wordcloud") + '</span>';
}
});
Template.registerHelper("getTranscriptBonusLabel", function (cardset) {
if ((cardset.transcriptBonus !== undefined && cardset.transcriptBonus.enabled) || Route.isMyBonusTranscripts() || Route.isTranscriptBonus() || Route.isPresentationTranscriptBonus() || Route.isPresentationTranscriptBonusCardset()) {
return '<span class="label label-transcript-bonus" data-id="bonus-transcript" title="' + TAPi18n.__('cardset.transcriptBonus.long') + '">' + TAPi18n.__('cardset.transcriptBonus.short') + '</span>';
......
......@@ -36,4 +36,5 @@
{{> cardsetInfoBoxItemDateUpdated}}
{{> cardsetInfoBoxItemActiveLearners}}
{{> cardsetInfoBoxItemRatings}}
{{> cardsetInfoBoxItemWordcloud}}
</template>
......@@ -15,6 +15,7 @@ import "./item/price.js";
import "./item/purchased.js";
import "./item/ratings.js";
import "./item/reviewer.js";
import "./item/wordcloud.js";
import "./cardset.html";
import {CardsetVisuals} from "../../../../api/cardsetVisuals";
......
<template name="cardsetInfoBoxItemWordcloud">
{{#if this.wordcloud}}
<tr>
<td colspan="2">{{_ "serverStatistics.modal.table.header.wordcloud.default"}}</td>
</tr>
{{/if}}
</template>
//------------------------ IMPORTS
import "./wordcloud.html";
......@@ -15,6 +15,7 @@
{{/unless}}
{{/if}}
{{{getLecturerAuthorizedLabel this}}}
{{{getWordcloudLabel this}}}
{{#unless isTranscriptRoute}}
{{#unless isBonusTranscriptsRoute}}
{{{getKind this.kind 0}}}
......
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