-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlista.js
39 lines (26 loc) · 1023 Bytes
/
lista.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
if (Meteor.isClient) {
Template.lista.helpers({
facturas: function () {
if (!Session.get("ocultaPagadas")) {
return facturas.find({pagado:false}, {sort: { fecha: 1 }});
}
else {
return facturas.find({}, {sort: { fecha: 1 }});
}
},
ocultaPagadas: function () {
return Session.get("ocultaPagadas")
},
});
Template.lista.events({
"click #pago": function () {
facturas.update(this._id, {$set:{pagado:!this.pagado, userverif: Meteor.user().username, fechaPago:new Date().toJSON().slice(0,10) }});
},
"click #editar": function(event, template){
// $('.ui.modal').modal('show');
},
"click #ocultaPagadas": function (){
Session.set("ocultaPagadas",!Session.get("ocultaPagadas"))
},
});
}