Commit ae5bead6 authored by Curtis Adam's avatar Curtis Adam

Add a new badge "Bonus" to the cardset overview and a title to all existing badges

parent fc49b15e
......@@ -56,6 +56,8 @@ $themes: (
$disabled_text: map-get($map, "disabled_text");
$shuffled_background: map-get($map, "shuffled_background");
$shuffled_text: map-get($map, "shuffled_text");
$bonus_background: map-get($map, "bonus_background");
$bonus_text: map-get($map, "bonus_text");
//navbar
$navbar_background: map-get($map, "navbar_background");
$navbar_text: map-get($map, "navbar_text");
......@@ -1891,6 +1893,11 @@ $themes: (
color: $shuffled_text !important;
}
.label-bonus {
background-color: $bonus_background !important;
color: $bonus_text !important;
}
.moduleRadioButtonLabel {
color: $white !important;
}
......
......@@ -77,6 +77,8 @@
"disabled_text": $mercury_approx,
"shuffled_background": black,
"shuffled_text": $white,
"bonus_background": $thm_red,
"bonus_text": $white,
//navbar
"navbar_background": black,
"navbar_text": white,
......
......@@ -79,6 +79,8 @@
"disabled_text": $mercury_approx,
"shuffled_background": black,
"shuffled_text": $white,
"bonus_background": $thm_red,
"bonus_text": $white,
//navbar
"navbar_background": $thm_gray,
"navbar_text": white,
......
......@@ -563,6 +563,10 @@
"long": "Gemischter Kartensatz",
"short": "Gemischt"
},
"bonus": {
"long": "Bonus-Lernphase",
"short": "Bonus"
},
"list": {
"back": "Zurück zur Karte"
}
......
......@@ -571,6 +571,10 @@
"long": "Shuffled Cardset",
"short": "Shuffled"
},
"bonus": {
"long": "Bonus",
"short": "Bonus"
},
"list": {
"back": "Back to the card"
}
......
......@@ -116,7 +116,13 @@ Template.registerHelper("getKindText", function (kind, displayType = 0) {
Template.registerHelper("getShuffleLabel", function (shuffled = false) {
if (shuffled) {
return '<span class="label label-shuffled" data-id="shuffled">' + TAPi18n.__('cardset.shuffled.short') + '</span>';
return '<span class="label label-shuffled" data-id="shuffled" title="' + TAPi18n.__('cardset.shuffled.long') + '">' + TAPi18n.__('cardset.shuffled.short') + '</span>';
}
});
Template.registerHelper("getBonusLabel", function (shuffled = false) {
if (shuffled) {
return '<span class="label label-bonus" data-id="bonus" title="' + TAPi18n.__('cardset.bonus.long') + '">' + TAPi18n.__('cardset.bonus.short') + '</span>';
}
});
......@@ -124,15 +130,15 @@ Template.registerHelper("getKind", function (kind, displayType = 0) {
if (displayType === 0) {
switch (DOMPurify.sanitize(kind, DOMPurifyConfig)) {
case "free":
return '<span class="label label-free" data-id="free">' + TAPi18n.__('access-level.free.short') + '</span>';
return '<span class="label label-free" data-id="free"title="' + TAPi18n.__('access-level.free.long') + '">' + TAPi18n.__('access-level.free.short') + '</span>';
case "edu":
return '<span class="label label-edu" data-id="edu">' + TAPi18n.__('access-level.edu.short') + '</span>';
return '<span class="label label-edu" data-id="edu"title="' + TAPi18n.__('access-level.edu.long') + '">' + TAPi18n.__('access-level.edu.short') + '</span>';
case "pro":
return '<span class="label label-pro" data-id="pro">' + TAPi18n.__('access-level.pro.short') + '</span>';
return '<span class="label label-pro" data-id="pro"title="' + TAPi18n.__('access-level.pro.long') + '">' + TAPi18n.__('access-level.pro.short') + '</span>';
case "personal":
return '<span class="label label-private" data-id="personal">' + TAPi18n.__('access-level.private.short') + '</span>';
return '<span class="label label-private" data-id="personal"title="' + TAPi18n.__('access-level.private.long') + '">' + TAPi18n.__('access-level.private.short') + '</span>';
case "demo":
return '<span class="label label-demo" data-id="demo">' + TAPi18n.__('access-level.demo.short') + '</span>';
return '<span class="label label-demo" data-id="demo"title="' + TAPi18n.__('access-level.demo.long') + '">' + TAPi18n.__('access-level.demo.short') + '</span>';
default:
return '<span class="label label-default">Undefined!</span>';
}
......
......@@ -336,7 +336,7 @@
<div class="row markdeepCardset">
<div class="col-xs-12 {{#if
learningActive}}col-md-4{{else}}col-sm-6 col-md-8{{/if}} markdeepCardsetContent">
<div class="cardsetLabels">{{{getKind kind 0}}} {{{getShuffleLabel this.shuffled}}}</div>
<div class="cardsetLabels">{{{getKind kind 0}}} {{{getShuffleLabel this.shuffled}}} {{{getBonusLabel this.learningActive}}}</div>
<h4 id="cardsetTitle">{{name}}</h4>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 infoBox">
......
......@@ -114,6 +114,7 @@
<div class="resultItemHeaderRightAreaTop col-xs-6 col-sm-12">
{{{getKind this.kind 0}}}
{{{getShuffleLabel this.shuffled}}}
{{{getBonusLabel this.learningActive}}}
</div>
<div class="resultItemHeaderRightAreaBottom col-xs-6 col-sm-12">
{{#if isActiveRoute regex="shuffle"}}
......
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