Commit 2d192f89 authored by Curtis Adam's avatar Curtis Adam

Sort cards by default by date created and not front text

parent 07f6c257
......@@ -337,7 +337,7 @@ Meteor.methods({
});
}
},
updateCard: function (card_id, subject, hint, front, back, lecture, centerTextElement, date, learningGoalLevel, backgroundStyle, learningIndex, learningUnit) {
updateCard: function (card_id, subject, hint, front, back, lecture, centerTextElement, learningGoalLevel, backgroundStyle, learningIndex, learningUnit) {
check(card_id, String);
check(subject, String);
check(hint, String);
......@@ -345,7 +345,6 @@ Meteor.methods({
check(back, String);
check(lecture, String);
check(centerTextElement, [Boolean]);
check(date, Date);
check(learningGoalLevel, Number);
check(backgroundStyle, Number);
check(learningIndex, String);
......@@ -379,7 +378,6 @@ Meteor.methods({
back: back,
lecture: lecture,
centerTextElement: centerTextElement,
date: date,
learningGoalLevel: learningGoalLevel,
backgroundStyle: backgroundStyle,
learningIndex: learningIndex,
......
......@@ -471,11 +471,11 @@ function getCardsetCards() {
query = Cards.find({cardset_id: {$in: Session.get('activeCardset').cardGroups}}, {
sort: {
subject: 1,
front: 1
date: 1
}
});
} else {
query = Cards.find({cardset_id: Session.get('activeCardset')._id}, {sort: {subject: 1, front: 1}});
query = Cards.find({cardset_id: Session.get('activeCardset')._id}, {sort: {subject: 1, date: 1}});
}
query.observeChanges({
removed: function () {
......@@ -514,7 +514,7 @@ function getPresentationCards(countCards = false) {
let query = {};
if (Session.get('chooseFlashcardsFilter')[0]) {
query.subject = 1;
query.front = 1;
query.date = 1;
}
if (countCards) {
return Cards.find({
......@@ -713,7 +713,7 @@ function saveCard(card_id, returnToCardset) {
}
});
} else {
Meteor.call("updateCard", card_id, subjectText, hintText, frontText, backText, lectureText, centerTextElement, date, Number(learningGoalLevel), Number(backgroundStyle), learningIndex, learningUnit);
Meteor.call("updateCard", card_id, subjectText, hintText, frontText, backText, lectureText, centerTextElement, Number(learningGoalLevel), Number(backgroundStyle), learningIndex, learningUnit);
Bert.alert(TAPi18n.__('savecardSuccess'), "success", 'growl-top-left');
if (returnToCardset) {
Router.go('cardsetdetailsid', {
......
......@@ -290,7 +290,7 @@ Template.cardsetList.helpers({
front: 1,
back: 1,
cardType: 1,
sort: {front: 1}
sort: {date: 1}
});
} else {
return Cards.find({
......@@ -303,7 +303,7 @@ Template.cardsetList.helpers({
front: 1,
back: 1,
cardType: 1,
sort: {front: 1}
sort: {date: 1}
});
}
},
......
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