@@ -21,34 +21,34 @@ Meteor.startup(function () {
21
21
///////////////////////////////////////////////////////////////////////////////
22
22
// Party details sidebar
23
23
24
- Template . details . party = function ( ) {
24
+ Template [ ' details' ] . party = function ( ) {
25
25
return Parties . findOne ( Session . get ( "selected" ) ) ;
26
26
} ;
27
27
28
- Template . details . anyParties = function ( ) {
28
+ Template [ ' details' ] . anyParties = function ( ) {
29
29
return Parties . find ( ) . count ( ) > 0 ;
30
30
} ;
31
31
32
- Template . details . creatorName = function ( ) {
32
+ Template [ ' details' ] . creatorName = function ( ) {
33
33
var owner = Meteor . users . findOne ( this . owner ) ;
34
34
if ( owner . _id === Meteor . userId ( ) )
35
35
return "me" ;
36
36
return displayName ( owner ) ;
37
37
} ;
38
38
39
- Template . details . canRemove = function ( ) {
39
+ Template [ ' details' ] . canRemove = function ( ) {
40
40
return this . owner === Meteor . userId ( ) && attending ( this ) === 0 ;
41
41
} ;
42
42
43
- Template . details . maybeChosen = function ( what ) {
43
+ Template [ ' details' ] . maybeChosen = function ( what ) {
44
44
var myRsvp = _ . find ( this . rsvps , function ( r ) {
45
45
return r . user === Meteor . userId ( ) ;
46
46
} ) || { } ;
47
47
48
48
return what == myRsvp . rsvp ? "chosen btn-inverse" : "" ;
49
49
} ;
50
50
51
- Template . details . events ( {
51
+ Template [ ' details' ] . events ( {
52
52
'click .rsvp_yes' : function ( ) {
53
53
Meteor . call ( "rsvp" , Session . get ( "selected" ) , "yes" ) ;
54
54
return false ;
@@ -74,32 +74,32 @@ Template.details.events({
74
74
///////////////////////////////////////////////////////////////////////////////
75
75
// Party attendance widget
76
76
77
- Template . attendance . rsvpName = function ( ) {
77
+ Template [ ' attendance' ] . rsvpName = function ( ) {
78
78
var user = Meteor . users . findOne ( this . user ) ;
79
79
return displayName ( user ) ;
80
80
} ;
81
81
82
- Template . attendance . outstandingInvitations = function ( ) {
82
+ Template [ ' attendance' ] . outstandingInvitations = function ( ) {
83
83
var party = Parties . findOne ( this . _id ) ;
84
84
return Meteor . users . find ( { $and : [
85
85
{ _id : { $in : party . invited } } , // they're invited
86
86
{ _id : { $nin : _ . pluck ( party . rsvps , 'user' ) } } // but haven't RSVP'd
87
87
] } ) ;
88
88
} ;
89
89
90
- Template . attendance . invitationName = function ( ) {
90
+ Template [ ' attendance' ] . invitationName = function ( ) {
91
91
return displayName ( this ) ;
92
92
} ;
93
93
94
- Template . attendance . rsvpIs = function ( what ) {
94
+ Template [ ' attendance' ] . rsvpIs = function ( what ) {
95
95
return this . rsvp === what ;
96
96
} ;
97
97
98
- Template . attendance . nobody = function ( ) {
98
+ Template [ ' attendance' ] . nobody = function ( ) {
99
99
return ! this . public && ( this . rsvps . length + this . invited . length === 0 ) ;
100
100
} ;
101
101
102
- Template . attendance . canInvite = function ( ) {
102
+ Template [ ' attendance' ] . canInvite = function ( ) {
103
103
return ! this . public && this . owner === Meteor . userId ( ) ;
104
104
} ;
105
105
@@ -114,7 +114,7 @@ var coordsRelativeToElement = function (element, event) {
114
114
return { x : x , y : y } ;
115
115
} ;
116
116
117
- Template . map . events ( {
117
+ Template [ ' map' ] . events ( {
118
118
'mousedown circle, mousedown text' : function ( event , template ) {
119
119
Session . set ( "selected" , event . currentTarget . id ) ;
120
120
} ,
@@ -192,7 +192,7 @@ Template['map'].rendered = function () {
192
192
}
193
193
} ;
194
194
195
- Template . map . destroyed = function ( ) {
195
+ Template [ ' map' ] . destroyed = function ( ) {
196
196
this . handle && this . handle . stop ( ) ;
197
197
} ;
198
198
@@ -205,11 +205,11 @@ var openCreateDialog = function (x, y) {
205
205
Session . set ( "showCreateDialog" , true ) ;
206
206
} ;
207
207
208
- Template . page . showCreateDialog = function ( ) {
208
+ Template [ ' page' ] . showCreateDialog = function ( ) {
209
209
return Session . get ( "showCreateDialog" ) ;
210
210
} ;
211
211
212
- Template . createDialog . events ( {
212
+ Template [ ' createDialog' ] . events ( {
213
213
'click .save' : function ( event , template ) {
214
214
var title = template . find ( ".title" ) . value ;
215
215
var description = template . find ( ".description" ) . value ;
@@ -242,7 +242,7 @@ Template.createDialog.events({
242
242
}
243
243
} ) ;
244
244
245
- Template . createDialog . error = function ( ) {
245
+ Template [ ' createDialog' ] . error = function ( ) {
246
246
return Session . get ( "createError" ) ;
247
247
} ;
248
248
@@ -253,11 +253,11 @@ var openInviteDialog = function () {
253
253
Session . set ( "showInviteDialog" , true ) ;
254
254
} ;
255
255
256
- Template . page . showInviteDialog = function ( ) {
256
+ Template [ ' page' ] . showInviteDialog = function ( ) {
257
257
return Session . get ( "showInviteDialog" ) ;
258
258
} ;
259
259
260
- Template . inviteDialog . events ( {
260
+ Template [ ' inviteDialog' ] . events ( {
261
261
'click .invite' : function ( event , template ) {
262
262
Meteor . call ( 'invite' , Session . get ( "selected" ) , this . _id ) ;
263
263
} ,
@@ -267,14 +267,14 @@ Template.inviteDialog.events({
267
267
}
268
268
} ) ;
269
269
270
- Template . inviteDialog . uninvited = function ( ) {
270
+ Template [ ' inviteDialog' ] . uninvited = function ( ) {
271
271
var party = Parties . findOne ( Session . get ( "selected" ) ) ;
272
272
if ( ! party )
273
273
return [ ] ; // party hasn't loaded yet
274
274
return Meteor . users . find ( { $nor : [ { _id : { $in : party . invited } } ,
275
275
{ _id : party . owner } ] } ) ;
276
276
} ;
277
277
278
- Template . inviteDialog . displayName = function ( ) {
278
+ Template [ ' inviteDialog' ] . displayName = function ( ) {
279
279
return displayName ( this ) ;
280
280
} ;
0 commit comments