|
@@ -7,7 +7,11 @@ if (Meteor.isClient) {
|
|
|
});
|
|
|
|
|
|
Template.images.helpers({
|
|
|
- images: Images.find({}, { sort: { createdOn: -1, rating: -1 }}),
|
|
|
+ images: function () {
|
|
|
+ const createdBy = Session.get("userFilter");
|
|
|
+ const selector = createdBy ? { createdBy } : {};
|
|
|
+ return Images.find(selector, { sort: { createdOn: -1, rating: -1 }});
|
|
|
+ },
|
|
|
image_id: function () {
|
|
|
return "rating-" + this._id;
|
|
|
},
|
|
@@ -47,10 +51,12 @@ if (Meteor.isClient) {
|
|
|
{ $set: { rating: rating }}
|
|
|
);
|
|
|
},
|
|
|
- "click .js-show-image-form": function (event) {
|
|
|
+ "click .js-show-image-form": function () {
|
|
|
$("#image_add_form").modal("show");
|
|
|
+ },
|
|
|
+ "click .js-set-image-filter": function () {
|
|
|
+ Session.set("userFilter", this.createdBy);
|
|
|
}
|
|
|
-
|
|
|
});
|
|
|
|
|
|
Template.image_add_form.events({
|