Commit 89a8225f authored by Curtis Adam's avatar Curtis Adam

Update filter grid layout and infinite scroll messages

parent cf2f1068
......@@ -1254,8 +1254,11 @@
"reset": "Filter zurücksetzen"
},
"infinite-scroll": {
"remainingShort": "__current__ von __total__",
"remainingTranscripts": "__current__ von __total__ Mitschriften",
"remainingTranscriptsBonus": "__current__ von __total__ Bonus-Mitschriften",
"remainingCardsets": "__current__ von __total__ Karteien",
"remainingCourses": "__current__ von __total__ Kursen"
"remainingReps": "__current__ von __total__ Repetitorien"
},
"card": {
"navigationDisabled": "Karte wird gewechselt…",
......
......@@ -1256,8 +1256,11 @@
"reset": "Filter zurücksetzen"
},
"infinite-scroll": {
"remainingShort": "__current__ von __total__",
"remainingTranscripts": "__current__ von __total__ Mitschriften",
"remainingTranscriptsBonus": "__current__ von __total__ Bonus-Mitschriften",
"remainingCardsets": "__current__ von __total__ Karteien",
"remainingCourses": "__current__ von __total__ Kursen"
"remainingReps": "__current__ von __total__ Repetitorien"
},
"card": {
"navigationDisabled": "Karte wird gewechselt…",
......
......@@ -21,8 +21,8 @@
<div class="resultItemHeaderWrapper col-xs-12">
<div class="resultItemHeaderTopArea row">
{{#if isWorkloadRoute}}
{{> filterIndexItemTopWorkload (setGridSize "col-xs-3 col-sm-3")}}
{{> filterIndexItemTopTopic (setGridSize "col-xs-9 col-sm-5")}}
{{> filterIndexItemTopWorkload (setGridSize "col-xs-5 col-sm-3")}}
{{> filterIndexItemTopTopic (setGridSize "col-xs-7 col-sm-5")}}
{{> filterIndexItemTopAuthor (setGridSize "hidden-xs col-sm-4")}}
{{else}}
{{#if isPersonalRoute}}
......
......@@ -68,7 +68,7 @@
<div id="showMoreResults" class="showMoreResults col-xs-12 panel panel-default">
<div class="flex-content">
<div class="scrollArrow col-xs-12 infinite-scroll-icon glyphicon glyphicon-chevron-down">
<span class="resultCounter">{{getCurrentResults}}</span>
<span class="resultCounter"><span class="visible-xs">{{getCurrentResults true}}</span><span class="hidden-xs">{{getCurrentResults false}}</span></span>
</div>
</div>
</div>
......
......@@ -45,15 +45,29 @@ Template.infiniteScroll.helpers({
return Filter.getMaxItemCounter() < Cardsets.find(query).count();
}
},
getCurrentResults: function () {
getCurrentResults: function (shortVersion = false) {
let query = Filter.getFilterQuery();
if (Route.isTranscript() || Route.isTranscriptBonus()) {
query.cardType = 2;
Session.set('totalResults', Cards.find(query).count());
return TAPi18n.__('infinite-scroll.remainingCardsets', {
current: Filter.getMaxItemCounter(),
total: Session.get('totalResults')
});
if (shortVersion) {
return TAPi18n.__('infinite-scroll.remainingShort', {
current: Filter.getMaxItemCounter(),
total: Session.get('totalResults')
});
} else {
if (Route.isMyBonusTranscripts() || Route.isTranscriptBonus()) {
return TAPi18n.__('infinite-scroll.remainingTranscriptsBonus', {
current: Filter.getMaxItemCounter(),
total: Session.get('totalResults')
});
} else {
return TAPi18n.__('infinite-scroll.remainingTranscripts', {
current: Filter.getMaxItemCounter(),
total: Session.get('totalResults')
});
}
}
} else {
if (Session.get("selectingCardsetToLearn") && query.cardType === undefined) {
if (Route.isRepetitorienFilterIndex()) {
......@@ -63,10 +77,24 @@ Template.infiniteScroll.helpers({
}
}
Session.set('totalResults', Cardsets.find(query).count());
return TAPi18n.__('infinite-scroll.remainingCardsets', {
current: Filter.getMaxItemCounter(),
total: Session.get('totalResults')
});
if (shortVersion) {
return TAPi18n.__('infinite-scroll.remainingShort', {
current: Filter.getMaxItemCounter(),
total: Session.get('totalResults')
});
} else {
if (Route.isRepetitorienFilterIndex()) {
return TAPi18n.__('infinite-scroll.remainingReps', {
current: Filter.getMaxItemCounter(),
total: Session.get('totalResults')
});
} else {
return TAPi18n.__('infinite-scroll.remainingCardsets', {
current: Filter.getMaxItemCounter(),
total: Session.get('totalResults')
});
}
}
}
}
});
......
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