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

Update filter grid layout and infinite scroll messages

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