diff --git a/.gitignore b/.gitignore index df9d7e8..723e6e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ .idea/workspace.xml /.deploy/ +.idea diff --git a/.idea/dictionaries/Romeo.xml b/.idea/dictionaries/Romeo.xml deleted file mode 100644 index 71a9b28..0000000 --- a/.idea/dictionaries/Romeo.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - bcrypt - crypto - dfilename - enoent - flickity - iban - keypress - keyup - loggly - onbeforeunload - subdomain - tshirt - università - upsert - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 9a67242..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 3b31283..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml index 9a0e1e0..4c1cb28 100644 --- a/.idea/jsLibraryMappings.xml +++ b/.idea/jsLibraryMappings.xml @@ -1,8 +1,7 @@ - + - \ No newline at end of file diff --git a/.idea/libraries/meteor_packages_auto_import_browser.xml b/.idea/libraries/meteor_packages_auto_import_browser.xml index 98b4895..efd3e9a 100644 --- a/.idea/libraries/meteor_packages_auto_import_browser.xml +++ b/.idea/libraries/meteor_packages_auto_import_browser.xml @@ -2,1031 +2,1029 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - - + + - - - - - - - - - - - - - - - - - - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + - - - + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + - - - + - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - - - - - - - - - - - - - - - - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - + - - - + - + + + + + + + + - - - - - - - - - - - - - - - - - - - - + - - - + + - - - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 3668dc8..28a804d 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index b69cc6f..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/preferred-vcs.xml b/.idea/preferred-vcs.xml deleted file mode 100644 index 848cfc4..0000000 --- a/.idea/preferred-vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - ApexVCS - - \ No newline at end of file diff --git a/.idea/snowdays.iml b/.idea/snowdays.iml index 780810e..eac47bf 100644 --- a/.idea/snowdays.iml +++ b/.idea/snowdays.iml @@ -12,6 +12,7 @@ + \ No newline at end of file diff --git a/.idea/typescript-compiler.xml b/.idea/typescript-compiler.xml deleted file mode 100644 index 9242a56..0000000 --- a/.idea/typescript-compiler.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml deleted file mode 100644 index fb4dc33..0000000 --- a/.idea/watcherTasks.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/webResources.xml b/.idea/webResources.xml deleted file mode 100644 index 3432ba4..0000000 --- a/.idea/webResources.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.meteor/packages b/.meteor/packages index 37dadbe..c2be1bf 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -47,3 +47,4 @@ simply:tether froala:editor dynamic-import@0.2.0 jquery@1.11.10 +http diff --git a/README.md b/README.md index a552445..21fa94d 100644 --- a/README.md +++ b/README.md @@ -87,3 +87,22 @@ Finally, we also implemented a detailed view of the participant including all th - Romeo Bellon ([GitHub](https://github.com/mryraghi), [LinkedIn](https://www.linkedin.com/in/romeobellon/)) - Daniel Morandini ([GitHub](https://github.com/danielmorandini), [LinkedIn](https://www.linkedin.com/in/daniel-morandini-224a3586/)) - Alessandro Piccoli ([GitHub](https://github.com/alpicco)) + +# Getting Setup + +clone repo and install meteor ([Meteor](https://www.meteor.com/install)) + +`cd snowdays && meteor npm install` + +navigate to localhost:3000 + +# Seeing pages + +`mongoimport --db meteor --collection users --file imports/data_seeds/users.json --jsonArray --port 3001` + +`mongoimport --db meteor --collection participants --file imports/data_seeds/participants.json --jsonArray --port 3001` + +`mongoimport --db meteor --collection accommodations --file imports/data_seeds/accommodations.json --jsonArray --port 3001` + +`mongoimport --db meteor --collection buszones --file imports/data_seeds/buszone.json --jsonArray --port 3001` + diff --git a/imports/collections/accommodations.js b/imports/collections/accommodations.js new file mode 100644 index 0000000..98d6209 --- /dev/null +++ b/imports/collections/accommodations.js @@ -0,0 +1,121 @@ +import "babel-polyfill"; +import SimpleSchema from "simpl-schema"; +const Accommodations = new Mongo.Collection("accommodations"); +const Schemas = {}; + +Schemas.Accommodation = new SimpleSchema({ +_id: { + type: String, + regEx: SimpleSchema.RegEx.Id +}, +name: { + type: String, + optional: true +}, +address: { + type: String, + max: 30, +}, +coordinates: { + type: String, + max: 30, + index: 1, + optional: true +}, +busZone: { + type: String, + allowedValues: ['1', '2', '3'], + optional: true +}, +isManuallyAssign: { + type: Boolean, + defaultValue: false, + optional: true +}, +capacity: { + type: String, + max: 10, + optional: false +}, + isWG: { + type: Boolean, + optional: true + }, + history: { + type: Array, + optional: true, + autoValue: function () { + if (this.isUpdate) { + return { + $push: { + date: new Date, + updates: {} + } + }; + } else { + this.unset(); // Prevent user from supplying their own value + } + } + }, + 'history.$': { + type: Object, + }, + 'history.$.date': { + type: Date, + optional: true + }, + 'history.$.updates': { + type: Object, + optional: true + }, + 'history.$.updates.field': { + type: String, + optional: true + }, + 'history.$.updates.value': { + type: String, + optional: true + }, + token: { + type: String, + optional: true + }, + statusComplete: { + type: Boolean, + label: '', + defaultValue: false, + optional: true + }, + hasAcceptedTandC: { + type: Boolean, + defaultValue: false, + optional: true + }, + createdAt: { + type: Date, + defaultValue: new Date(), + denyUpdate: true, + optional: true + }, + updatedAt: { + type: Date, + autoValue: function () { + if (this.isUpdate) { + return new Date(); + } + }, + denyInsert: true, + optional: true + } +}, { + clean: { + filter: true, + autoConvert: true, + removeEmptyStrings: true, + trimStrings: true, + getAutoValues: true, + removeNullsFromArrays: true, + } +}); +Accommodations.attachSchema(Schemas.Accommodation); +export default Accommodations; \ No newline at end of file diff --git a/imports/collections/buszone.js b/imports/collections/buszone.js new file mode 100644 index 0000000..18a1cd8 --- /dev/null +++ b/imports/collections/buszone.js @@ -0,0 +1,107 @@ +import "babel-polyfill"; +import SimpleSchema from "simpl-schema"; + +const BusZones = new Mongo.Collection("buszones"); + +const Schemas = {}; + +Schemas.BusZone = new SimpleSchema({ + _id: { + type: String, + regEx: SimpleSchema.RegEx.Id + }, + name:{ + type: String, + }, + initial_capacity: { + type: String, + max: 30, + }, + current_capacity:{ + type:String + }, + lat:{ + type:String + }, + lng:{ + type:String + }, + history: { + type: Array, + optional: true, + autoValue: function () { + if (this.isUpdate) { + return { + $push: { + date: new Date, + updates: {} + } + }; + } else { + this.unset(); // Prevent user from supplying their own value + } + } + }, + 'history.$': { + type: Object, + }, + 'history.$.date': { + type: Date, + optional: true + }, + 'history.$.updates': { + type: Object, + optional: true + }, + 'history.$.updates.field': { + type: String, + optional: true + }, + 'history.$.updates.value': { + type: String, + optional: true + }, + token: { + type: String, + optional: true + }, + statusComplete: { + type: Boolean, + label: '', + defaultValue: false, + optional: true + }, + hasAcceptedTandC: { + type: Boolean, + defaultValue: false, + optional: true + }, + createdAt: { + type: Date, + defaultValue: new Date(), + denyUpdate: true, + optional: true + }, + updatedAt: { + type: Date, + autoValue: function () { + if (this.isUpdate) { + return new Date(); + } + }, + denyInsert: true, + optional: true + } +}, { + clean: { + filter: true, + autoConvert: true, + removeEmptyStrings: true, + trimStrings: true, + getAutoValues: true, + removeNullsFromArrays: true, + } +}); + +BusZones.attachSchema(Schemas.BusZone); +export default BusZones; \ No newline at end of file diff --git a/imports/collections/matchingresults.js b/imports/collections/matchingresults.js new file mode 100644 index 0000000..c6508a2 --- /dev/null +++ b/imports/collections/matchingresults.js @@ -0,0 +1,137 @@ +import "babel-polyfill"; +import SimpleSchema from "simpl-schema"; +import _ from "lodash"; + +const Matchingresults = new Mongo.Collection("matchingresults"); + +const Schemas = {}; + +Schemas.Matchingresults = new SimpleSchema({ +_id: { + type: String +}, +host: { + type: String, + optional: true +}, +hostPhoneNumber: { + type: String, + max: 30, +}, +Room: { + type: String, + max: 30, +}, +GuestFirstName: { + type: String, + max: 30, + index: 1, + optional: true +}, +GuestLastName: { + type: String, + max: 30, + index: 1, + optional: true +}, +GuestPhoneNumber: { + type: String, + max: 30, + index: 1, + optional: true +}, +GuestEmail: { + type: String, + max: 30, + index: 1, + optional: true +}, +University: { + type: String, + max: 30, + index: 1, + optional: true +}, +Accommodation: { + type: String, + max: 30, + index: 1, + optional: true +}, history: { + type: Array, + optional: true, + autoValue: function () { + if (this.isUpdate) { + return { + $push: { + date: new Date, + updates: {} + } + }; + } else { + this.unset(); // Prevent user from supplying their own value + } + } + }, + 'history.$': { + type: Object, + }, + 'history.$.date': { + type: Date, + optional: true + }, + 'history.$.updates': { + type: Object, + optional: true + }, + 'history.$.updates.field': { + type: String, + optional: true + }, + 'history.$.updates.value': { + type: String, + optional: true + }, + token: { + type: String, + optional: true + }, + statusComplete: { + type: Boolean, + label: '', + defaultValue: false, + optional: true + }, + hasAcceptedTandC: { + type: Boolean, + defaultValue: false, + optional: true + }, + createdAt: { + type: Date, + defaultValue: new Date(), + denyUpdate: true, + optional: true + }, + updatedAt: { + type: Date, + autoValue: function () { + if (this.isUpdate) { + return new Date(); + } + }, + denyInsert: true, + optional: true + } +}, { + clean: { + filter: true, + autoConvert: true, + removeEmptyStrings: true, + trimStrings: true, + getAutoValues: true, + removeNullsFromArrays: true, + } +}); +Matchingresults.attachSchema(Schemas.Matchingresults); +export default Matchingresults; \ No newline at end of file diff --git a/imports/collections/participants.js b/imports/collections/participants.js index fabbd2f..f5cf23f 100644 --- a/imports/collections/participants.js +++ b/imports/collections/participants.js @@ -117,6 +117,23 @@ Schemas.Day3 = new SimpleSchema({ }); Schemas.Requestor = new SimpleSchema({ + university: { + type: String, + optional: true + }, + request_capacity:{ + type: String, + optional: true + } +}); + + + +Schemas.Info = new SimpleSchema({ + requesting_number:{ + type: String, + optional: true + }, university: { type: String, optional: true @@ -430,6 +447,7 @@ Schemas.Participant = new SimpleSchema({ max: 200, optional: true }, + history: { type: Array, optional: true, diff --git a/imports/collections/users.js b/imports/collections/users.js index b8a3ed3..094f0b3 100644 --- a/imports/collections/users.js +++ b/imports/collections/users.js @@ -30,9 +30,14 @@ Schema.Profile = new SimpleSchema({ min: 128, optional: true }, + //linking array with the participants allowedParticipants: { type: Number }, + // participantsArray:{ + // type: Array, + // optional: true + // }, survey: { type: Boolean, defaultValue: false diff --git a/imports/data_seeds/accommodations.json b/imports/data_seeds/accommodations.json new file mode 100644 index 0000000..ca904ef --- /dev/null +++ b/imports/data_seeds/accommodations.json @@ -0,0 +1,1728 @@ +[ + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf71" + }, + "name":"HSB", + "address":"Bolzano", + "coordinates":"46.4982953,11.3547582", + "busZone":"3", + "capacity":24, + "isWG":false, + "updatedAt":{ + "$date":"2017-12-07T07:47:34.460Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:37:03.896Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:37:04.671Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:37:04.975Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:42:06.946Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:34.459Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf72" + }, + "name":"HAUSSB", + "address":"Bolzano", + "coordinates":"46.4982953,11.3547582", + "busZone":"3", + "capacity":24, + "isWG":false, + "updatedAt":{ + "$date":"2017-12-07T07:41:46.920Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:46.627Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:41:46.920Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf73" + }, + "name":"SALEETA_HSB", + "address":"Bolzano", + "coordinates":"46.4982953,11.3547582", + "busZone":"3", + "capacity":18, + "isWG":false, + "updatedAt":{ + "$date":"2017-12-07T07:41:47.398Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:47.108Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:41:47.397Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf74" + }, + "name":"RAINERUM", + "address":"Bolzano", + "coordinates":"46.4982953,11.3547582", + "busZone":"3", + "capacity":6, + "isWG":false, + "updatedAt":{ + "$date":"2017-12-07T07:41:47.913Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:47.626Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:41:47.912Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf75" + }, + "name":"GALILEI", + "address":"Bolzano", + "coordinates":"46.4982953,11.3547582", + "busZone":"3", + "capacity":78, + "isWG":false, + "updatedAt":{ + "$date":"2017-12-07T07:41:48.371Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:48.088Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:41:48.370Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf76" + }, + "name":"CARDUCCI", + "address":"Bolzano", + "coordinates":"46.4982953,11.3547582", + "busZone":"3", + "capacity":60, + "isWG":false, + "updatedAt":{ + "$date":"2017-12-07T07:41:48.841Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:48.548Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:41:48.841Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf77" + }, + "name":"via Rosmini, 67, Bolzano", + "address":"via Rosmini, 67, Bolzano", + "coordinates":"46.4990429,11.3477936", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:49.451Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:49.450Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf78" + }, + "name":"via Rosmini, 67, Bolzano", + "address":"via Rosmini, 67, Bolzano", + "coordinates":"46.4990429,11.3477936", + "busZone":"3", + "isWG":true, + "capacity":1, + "updatedAt":{ + "$date":"2017-12-07T07:41:49.741Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:49.741Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf79" + }, + "name":"Via Rosmini 67, Bolzano", + "address":"Via Rosmini 67, Bolzano", + "coordinates":"46.4990429,11.3477936", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:31.858Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:50.038Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:31.856Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf7a" + }, + + "name":"Via Rosmini, 67, Bolzano", + "address":"Via Rosmini, 67, Bolzano", + "coordinates":"46.4990429,11.3477936", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:50.334Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:50.333Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf7b" + }, + + "name":"via Castelweinegg, 21, Bolzano", + "address":"via Castelweinegg, 21, Bolzano", + "coordinates":"46.4822336,11.3486968", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:50.889Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:50.888Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf7c" + }, + "name":"via della Visitazione, 4d, Bolzano", + "address":"via della Visitazione, 4d, Bolzano", + "coordinates":"46.4964167,11.337919", + "busZone":"1", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:51.527Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:51.527Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf7d" + }, + "name":"via della Visitazione, 4d, Bolzano", + "address":"via della Visitazione, 4d, Bolzano", + "coordinates":"46.4964167,11.337919", + "busZone":"1", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:51.819Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:51.818Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf7e" + }, + + "name":"via Carducci, 2d, Bolzano", + "address":"via Carducci, 2d, Bolzano", + "coordinates":"46.4971381,11.3501219", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:52.124Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:52.124Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf7f" + }, + "name":"via Carducci, 2d, Bolzano", + "address":"via Carducci, 2d, Bolzano", + "coordinates":"46.4971381,11.3501219", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:52.516Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:52.516Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf80" + }, + + "name":"via Carducci, 2d, Bolzano", + "address":"via Carducci, 2d, Bolzano", + "coordinates":"46.4971381,11.3501219", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:53.065Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:53.065Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf81" + }, + "name":"Via Penegal, 2, Bolzano", + "address":"Via Penegal, 2, Bolzano", + "coordinates":"46.5021286,11.3348113", + "busZone":"1", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:32.411Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:53.866Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:32.408Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf82" + }, + "name":"Via Leonardo da vinci, 20, Bolzano", + "address":"Via Leonardo da vinci, 20, Bolzano", + "coordinates":"46.4991669,11.3488839", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:54.564Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:54.564Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf83" + }, + "name":"Via Leonardo da vinci 2/a, Bolzano", + "address":"Via Leonardo da vinci 2/a, Bolzano", + "coordinates":"46.499068,11.352302", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:55.242Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:55.242Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf84" + }, + "name":"Via Vintler 5, Bolzano", + "address":"Via Vintler 5, Bolzano", + "coordinates":"46.5011483,11.356119", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:33.031Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:55.946Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:33.031Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf85" + }, + "name":"Via Resia, 103 A, Bolzano", + "address":"Via Resia, 103 A, Bolzano", + "coordinates":"46.4857067,11.319481", + "busZone":"2", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:56.657Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:56.657Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf86" + }, + "name":"via san Osvaldo, 53, Bolzano", + "address":"via san Osvaldo, 53, Bolzano", + "coordinates":"46.5046738,11.3575808", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:57.274Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:57.274Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf87" + }, + "name":"via montello 26, Bolzano", + "address":"via montello 26, Bolzano", + "coordinates":"46.5046082,11.3436662", + "busZone":"1", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:57.957Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:57.957Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf88" + }, + "name":" Prato Isarco 16, Bolzano", + "address":" Prato Isarco 16, Bolzano", + "coordinates":"46.495188,11.44658", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:58.531Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:58.531Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf89" + }, + "name":"Batzenhaeuselgasse 5,appartement 14, Bolzano", + "address":"Batzenhaeuselgasse 5,appartement 14, Bolzano", + "coordinates":"46.5012966,11.3575361", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:59.157Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:59.157Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf8a" + }, + "name":"via dei Portici, 44, Bolzano", + "address":"via dei Portici, 44, Bolzano", + "coordinates":"46.4996,11.35421", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:59.748Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:59.747Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf8b" + }, + "name":"via della Torre 18, Bolzano", + "address":"via della Torre 18, Bolzano", + "coordinates":"46.5089,11.3438336", + "busZone":"1", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:42:00.277Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:42:00.276Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf8c" + }, + "name":"vicolo Sabbia, 5, Bolzano", + "address":"vicolo Sabbia, 5, Bolzano", + "coordinates":"46.50591,11.3506", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:33.567Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:42:01.075Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:33.567Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf8d" + }, + "name":"SALETTA", + "address":"Bolzano", + "coordinates":"46.4982953,11.3547582", + "busZone":"3", + "capacity":33, + "isWG":false, + "updatedAt":{ + "$date":"2017-12-07T07:42:01.879Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:42:01.264Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:42:01.878Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf8e" + }, + "name":"RIGLER", + "address":"Bolzano", + "coordinates":"46.4982953,11.3547582", + "busZone":"3", + "capacity":20, + "isWG":false, + "updatedAt":{ + "$date":"2017-12-07T07:42:02.361Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:42:02.053Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:42:02.360Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf8f" + }, + "name":"UNICITY", + "address":"Bolzano", + "coordinates":"46.4982953,11.3547582", + "busZone":"3", + "capacity":27, + "isWG":false, + "updatedAt":{ + "$date":"2017-12-07T07:42:03.057Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:42:02.547Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:42:03.056Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf90" + }, + "name":"via Diaz 13, Bolzano", + "address":"via Diaz 13, Bolzano", + "coordinates":"46.5022485,11.343918", + "busZone":"1", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:33.869Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:42:03.600Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:33.868Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf91" + }, + "name":"via Ortles, 23, Bolzano", + "address":"via Ortles, 23, Bolzano", + "coordinates":"46.4819934,11.3178838", + "busZone":"2", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:34.163Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:42:04.330Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:34.162Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf92" + }, + "name":"viale Druso 137, Bolzano", + "address":"viale Druso 137, Bolzano", + "coordinates":"46.4951131,11.3337869", + "busZone":"2", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:42:04.920Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:42:04.919Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf93" + }, + "name":"via Guttenberg, 2, Bolzano", + "address":"via Guttenberg, 2, Bolzano", + "coordinates":"46.49157,11.32072", + "busZone":"2", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:42:05.561Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:42:05.560Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf94" + }, + "name":"Annette von Menz Passage, 6, Bolzano", + "address":"Annette von Menz Passage, 6, Bolzano", + "coordinates":"46.4999015,11.3535118", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:42:06.150Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:42:06.150Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf95" + }, + "name":"Viale Trieste 22/a, Bolzano", + "address":"Viale Trieste 22/a, Bolzano", + "coordinates":"46.4927336,11.3450884", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:42:06.653Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:42:06.652Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf96" + }, + "name":"Viale Trieste 22/a, Bolzano", + "address":"Viale Trieste 22/a, Bolzano", + "coordinates":"46.4927336,11.3450884", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:34.748Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:33.828Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:34.748Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf97" + }, + + "name":"Via San Quirino 16, Bolzano", + "address":"Via San Quirino 16, Bolzano", + "coordinates":"46.4979576,11.3445114", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:35.349Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:34.383Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:35.348Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf98" + }, + + "name":"Via San Quirino 16, Bolzano", + "address":"Via San Quirino 16, Bolzano", + "coordinates":"46.4979576,11.3445114", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:35.669Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:34.693Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:35.669Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf99" + }, + + "name":"Via San Pietro 5/2, Bolzano", + "address":"Via San Pietro 5/2, Bolzano", + "coordinates":"46.5122207,11.3542684", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:36.216Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:35.323Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:36.216Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf9a" + }, + "name":"Vicolo Sabbia 7, Bolzano", + "address":"Vicolo Sabbia 7, Bolzano", + "coordinates":"46.5059108,11.3506096", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:36.744Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:35.909Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:36.743Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf9b" + }, + "name":"Via Gutemberg 2, Bolzano", + "address":"Via Gutemberg 2, Bolzano", + "coordinates":"46.49157,11.32072", + "busZone":"2", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:30.156Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:36.530Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:29.841Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:30.154Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf9c" + }, + + "name":"Via Rosmini, 55, Bolzano", + "address":"Via Rosmini, 55, Bolzano", + "coordinates":"46.4983945,11.3478905", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:37.298Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:37.114Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:37.298Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf9d" + }, + + "name":"Via Isarco 11/a, Bolzano", + "address":"Via Isarco 11/a, Bolzano", + "coordinates":"46.4960672,11.3537516", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:37.775Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:37.774Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf9e" + }, + + "name":"Via Isarco 11/a, Bolzano", + "address":"Via Isarco 11/a, Bolzano", + "coordinates":"46.4960672,11.3537516", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:38.081Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:38.081Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bf9f" + }, + "name":"Via rentsch 22b, Bolzano", + "address":"Via rentsch 22b, Bolzano", + "coordinates":"51.1513226,14.0239807", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:38.896Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:38.896Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfa0" + }, + "name":"viale druso 114d, Bolzano", + "address":"viale druso 114d, Bolzano", + "coordinates":"46.4957822,11.3185984", + "busZone":"2", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:39.492Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:39.489Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfa1" + }, + + "name":"corso italia 12, Bolzano", + "address":"corso italia 12, Bolzano", + "coordinates":"46.4995216,11.3396478", + "busZone":"1", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:40.065Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:40.065Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfa2" + }, + + "name":"via Carducci,12, Bolzano", + "address":"via Carducci,12, Bolzano", + "coordinates":"46.4960197,11.3504548", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:40.676Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:40.675Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfa3" + }, + "name":"via Carducci,12, Bolzano", + "address":"via Carducci,12, Bolzano", + "coordinates":"46.4960197,11.3504548", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:41.006Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:41.005Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfa4" + }, + "name":"corso italia 12, Bolzano", + "address":"corso italia 12, Bolzano", + "coordinates":"46.4995216,11.3396478", + "busZone":"1", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:41.302Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:41.301Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfa5" + }, + "name":"via della zecca, 9b, Bolzano", + "address":"via della zecca, 9b, Bolzano", + "coordinates":"46.5015152,11.3370154", + "busZone":"1", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:41.851Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:41.851Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfa6" + }, + "name":"Via della Torre 18, Bolzano", + "address":"Via della Torre 18, Bolzano", + "coordinates":"46.5089,11.3438336", + "busZone":"1", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:42.390Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:42.390Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfa7" + }, + + "name":"Via Raffaello Sernesi, 19, Bolzano", + "address":"Via Raffaello Sernesi, 19, Bolzano", + "coordinates":"46.4980261,11.3509091", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:43.004Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:43.004Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfa8" + }, + "name":"Via Raffaello Sernesi, 19, Bolzano", + "address":"Via Raffaello Sernesi, 19, Bolzano", + "coordinates":"46.4980261,11.3509091", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:43.310Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:43.310Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfa9" + }, + + "name":"Via Bassano del Grappa, 14, Bolzano", + "address":"Via Bassano del Grappa, 14, Bolzano", + "coordinates":"46.4890214,11.3344687", + "busZone":"2", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:43.857Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:43.857Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfaa" + }, + "name":"Via Parma 1D, Bolzano", + "address":"Via Parma 1D, Bolzano", + "coordinates":"46.4840713,11.3241594", + "busZone":"2", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:30.978Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:44.409Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:30.975Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfab" + }, + "_id:":698, + "name":"Via della Vigna, 52, Bolzano", + "address":"Via della Vigna, 52, Bolzano", + "coordinates":"46.4996089,11.3171536", + "busZone":"2", + "capacity":1, + "updatedAt":{ + "$date":"2017-12-07T07:41:44.968Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:44.966Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfac" + }, + "name":"Via Carducci 2c, Bolzano", + "address":"Via Carducci 2c, Bolzano", + "coordinates":"46.4971381,11.3501219", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:45.522Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:45.521Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfad" + }, + "name":"Via Parma 1D, Bolzano", + "address":"Via Parma 1D, Bolzano", + "coordinates":"46.4840713,11.3241594", + "busZone":"2", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:47:31.300Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:45.821Z" + }, + "updates":{ + + } + }, + { + "date":{ + "$date":"2017-12-07T07:47:31.297Z" + }, + "updates":{ + + } + } + ] + }, + { + "_id":{ + "$oid":"5a28e7acb657dad44576bfae" + }, + "name":"via Carducci,12, Bolzano", + "address":"via Carducci,12, Bolzano", + "coordinates":"46.4960197,11.3504548", + "busZone":"3", + "capacity":1, + "isWG":true, + "updatedAt":{ + "$date":"2017-12-07T07:41:46.127Z" + }, + "history":[ + { + "date":{ + "$date":"2017-12-07T07:41:46.126Z" + }, + "updates":{ + + } + } + ] + } +] \ No newline at end of file diff --git a/imports/data_seeds/buszone.json b/imports/data_seeds/buszone.json new file mode 100644 index 0000000..333f8b0 --- /dev/null +++ b/imports/data_seeds/buszone.json @@ -0,0 +1,23 @@ +[ + {"_id": 1, + "name": "Dominikanerplatz", + "initial_capacity": 150, + "current_capacity": 0, + "lat": 46.49785, + "lng": 11.3517 + }, + {"_id": 2, + "name": "Piazza Gries", + "initial_capacity": 30, + "current_capacity": 0, + "lat": 46.50305, + "lng": 11.33438 + }, + {"_id": 3, + "name": "UniverCity", + "initial_capacity": 20, + "current_capacity": 0, + "lat": 46.49253, + "lng": 11.32153 + } +] diff --git a/imports/data_seeds/participants.json b/imports/data_seeds/participants.json new file mode 100644 index 0000000..8981dc5 --- /dev/null +++ b/imports/data_seeds/participants.json @@ -0,0 +1 @@ +[{"_id": 1000, "firstName": "cathy", "lastName": "cathy", "university": "University of Tuebingen", "info": {"requesting_number": 6}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1001, "firstName": "anna", "lastName": "anna", "university": "Uni Salzburg", "info": {"requesting_number": 10}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1002, "firstName": "opal", "lastName": "opal", "university": "Goethe University", "info": {"requesting_number": 10}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1003, "firstName": "taylor", "lastName": "taylor", "university": "Universita di Milano", "info": {"requesting_number": 11}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1004, "firstName": "robert", "lastName": "robert", "university": "Universita di Torino", "info": {"requesting_number": 11}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1005, "firstName": "robert", "lastName": "robert", "university": "TU Munich", "info": {"requesting_number": 12}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1006, "firstName": "veola", "lastName": "veola", "university": "LMU", "info": {"requesting_number": 12}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1007, "firstName": "martin", "lastName": "martin", "university": "Nordakademie", "info": {"requesting_number": 13}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1008, "firstName": "deborah", "lastName": "deborah", "university": "Universita di Sassari", "info": {"requesting_number": 15}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1009, "firstName": "nicole", "lastName": "nicole", "university": "Zeppelin University", "info": {"requesting_number": 15}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1010, "firstName": "mary", "lastName": "mary", "university": "Johannes Gutenberg Universitat Mainz", "info": {"requesting_number": 16}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1011, "firstName": "malia", "lastName": "malia", "university": "Maastricht University", "info": {"requesting_number": 18}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1012, "firstName": "charles", "lastName": "charles", "university": "Frankfurt am Main", "info": {"requesting_number": 18}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1013, "firstName": "peter", "lastName": "peter", "university": "Frankfurt School", "info": {"requesting_number": 20}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1014, "firstName": "jennifer", "lastName": "jennifer", "university": "HEC Lausanne", "info": {"requesting_number": 21}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1015, "firstName": "william", "lastName": "william", "university": "Universita di Verona", "info": {"requesting_number": 21}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1016, "firstName": "mark", "lastName": "mark", "university": "Universita di Genova", "info": {"requesting_number": 23}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1017, "firstName": "eugene", "lastName": "eugene", "university": "University of Bayreuth", "info": {"requesting_number": 24}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1018, "firstName": "sarah", "lastName": "sarah", "university": "ESB", "info": {"requesting_number": 25}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1019, "firstName": "kenneth", "lastName": "kenneth", "university": "Universita di Trento", "info": {"requesting_number": 28}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1020, "firstName": "donald", "lastName": "donald", "university": "Universita di Bologna", "info": {"requesting_number": 36}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}, {"_id": 1021, "firstName": "heather", "lastName": "heather", "university": "WHU", "info": {"requesting_number": 41}, "gender": "F", "checkedIn": "false", "isVolleyPlayer": "false", "isFootballPlayer": "false", "hasPersonalID": "false", "hasStudentID": "false", "foodAllergies": "None", "statusComplete": "false", "hasAcceptedTandC": "false", "createdAt": "", "day1": {"bus1": "false", "bus2": "false", "meal1": "false", "meal2": "false"}, "day2": {"bus1": "false", "bus2": "false", "course": "false", "meal1": "false", "meal2": "false", "hasSkipass": "false", "drink1": "false"}, "day3": {"bus1": "false", "meal1": "false", "meal2": "false"}}] \ No newline at end of file diff --git a/imports/data_seeds/users.json b/imports/data_seeds/users.json new file mode 100644 index 0000000..fbe66fb --- /dev/null +++ b/imports/data_seeds/users.json @@ -0,0 +1,384 @@ +[ + { + "_id":1000, + "username":"javier_clay", + "email":"javier_clay@mail.com", + "password":"password", + "profile":{ + "first_name":"javier", + "last_name":"clay", + "allowed_participants":6, + "university":"University of Tuebingen", + "gender":"F", + "participantsArray":[ + 1, + 2, + 3, + 4, + 5, + 6 + ] + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1001, + "username":"richard_waters", + "email":"richard_waters@mail.com", + "password":"password", + "profile":{ + "first_name":"richard", + "last_name":"waters", + "allowed_participants":10, + "university":"Uni Salzburg", + "gender":"M" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1002, + "username":"james_soileau", + "email":"james_soileau@mail.com", + "password":"password", + "profile":{ + "first_name":"james", + "last_name":"soileau", + "allowed_participants":10, + "university":"Goethe University", + "gender":"F" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1003, + "username":"andrea_harris", + "email":"andrea_harris@mail.com", + "password":"password", + "profile":{ + "first_name":"andrea", + "last_name":"harris", + "allowed_participants":11, + "university":"Universita di Milano", + "gender":"M" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1004, + "username":"dorothy_green", + "email":"dorothy_green@mail.com", + "password":"password", + "profile":{ + "first_name":"dorothy", + "last_name":"green", + "allowed_participants":11, + "university":"Universita di Torino", + "gender":"F" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1005, + "username":"edward_spratley", + "email":"edward_spratley@mail.com", + "password":"password", + "profile":{ + "first_name":"edward", + "last_name":"spratley", + "allowed_participants":12, + "university":"TU Munich", + "gender":"M" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1006, + "username":"tracy_fleniken", + "email":"tracy_fleniken@mail.com", + "password":"password", + "profile":{ + "first_name":"tracy", + "last_name":"fleniken", + "allowed_participants":12, + "university":"LMU", + "gender":"F" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1007, + "username":"christopher_williams", + "email":"christopher_williams@mail.com", + "password":"password", + "profile":{ + "first_name":"christopher", + "last_name":"williams", + "allowed_participants":13, + "university":"Nordakademie", + "gender":"M" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1008, + "username":"mark_daquino", + "email":"mark_daquino@mail.com", + "password":"password", + "profile":{ + "first_name":"mark", + "last_name":"daquino", + "allowed_participants":15, + "university":"Universita di Sassari", + "gender":"F" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1009, + "username":"robert_hudgins", + "email":"robert_hudgins@mail.com", + "password":"password", + "profile":{ + "first_name":"robert", + "last_name":"hudgins", + "allowed_participants":15, + "university":"Zeppelin University", + "gender":"M" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1010, + "username":"david_velazquez", + "email":"david_velazquez@mail.com", + "password":"password", + "profile":{ + "first_name":"david", + "last_name":"velazquez", + "allowed_participants":16, + "university":"Johannes Gutenberg Universitat Mainz", + "gender":"F" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1011, + "username":"daniel_bushee", + "email":"daniel_bushee@mail.com", + "password":"password", + "profile":{ + "first_name":"daniel", + "last_name":"bushee", + "allowed_participants":18, + "university":"Maastricht University", + "gender":"M" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1012, + "username":"bessie_howard", + "email":"bessie_howard@mail.com", + "password":"password", + "profile":{ + "first_name":"bessie", + "last_name":"howard", + "allowed_participants":18, + "university":"Frankfurt am Main", + "gender":"F" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1013, + "username":"terence_loe", + "email":"terence_loe@mail.com", + "password":"password", + "profile":{ + "first_name":"terence", + "last_name":"loe", + "allowed_participants":20, + "university":"Frankfurt School", + "gender":"M" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1014, + "username":"chris_vanzandt", + "email":"chris_vanzandt@mail.com", + "password":"password", + "profile":{ + "first_name":"chris", + "last_name":"vanzandt", + "allowed_participants":21, + "university":"HEC Lausanne", + "gender":"F" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1015, + "username":"amber_wallace", + "email":"amber_wallace@mail.com", + "password":"password", + "profile":{ + "first_name":"amber", + "last_name":"wallace", + "allowed_participants":21, + "university":"Universita di Verona", + "gender":"M" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1016, + "username":"irene_severson", + "email":"irene_severson@mail.com", + "password":"password", + "profile":{ + "first_name":"irene", + "last_name":"severson", + "allowed_participants":23, + "university":"Universita di Genova", + "gender":"F" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1017, + "username":"terry_east", + "email":"terry_east@mail.com", + "password":"password", + "profile":{ + "first_name":"terry", + "last_name":"east", + "allowed_participants":24, + "university":"University of Bayreuth", + "gender":"M" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1018, + "username":"lisa_collett", + "email":"lisa_collett@mail.com", + "password":"password", + "profile":{ + "first_name":"lisa", + "last_name":"collett", + "allowed_participants":25, + "university":"ESB", + "gender":"F" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1019, + "username":"krista_carter", + "email":"krista_carter@mail.com", + "password":"password", + "profile":{ + "first_name":"krista", + "last_name":"carter", + "allowed_participants":28, + "university":"Universita di Trento", + "gender":"M" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1020, + "username":"roland_rodriguez", + "email":"roland_rodriguez@mail.com", + "password":"password", + "profile":{ + "first_name":"roland", + "last_name":"rodriguez", + "allowed_participants":36, + "university":"Universita di Bologna", + "gender":"F" + }, + "roles":[ + "external" + ], + "create":"true" + }, + { + "_id":1021, + "username":"warren_creager", + "email":"warren_creager@mail.com", + "password":"password", + "profile":{ + "first_name":"warren", + "last_name":"creager", + "allowed_participants":41, + "university":"WHU", + "gender":"M" + }, + "roles":[ + "external" + ], + "create":"true" + } +] \ No newline at end of file diff --git a/imports/startup/client/routes.js b/imports/startup/client/routes.js index a337c0a..8a6732b 100644 --- a/imports/startup/client/routes.js +++ b/imports/startup/client/routes.js @@ -1,8 +1,10 @@ import "../../ui/pages/home"; import "../../ui/pages/thankyou"; import "../../ui/pages/login"; -import "../../ui/pages/register"; import "../../ui/pages/admin"; +import "../../ui/pages/externals"; +import "../../ui/pages/participant"; +import "../../ui/pages/register"; import "../../ui/pages/externals/index"; import "../../ui/pages/participant/index"; import "../../ui/pages/event"; diff --git a/imports/ui/pages/admin/admin.add_new.html b/imports/ui/pages/admin/admin.add_new.html index 447e84e..658f370 100644 --- a/imports/ui/pages/admin/admin.add_new.html +++ b/imports/ui/pages/admin/admin.add_new.html @@ -3,7 +3,7 @@
-

Add new UniBZ

+

Add new UniBZ participant


@@ -156,5 +156,60 @@

Add new contact person

+
+
+
+

Add new Accommodation

+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ + +
+
+ + +
+
+
+ {{#if isManually}} +
+
+ + +
+
+ {{/if}} +
+ + +
+
+
\ No newline at end of file diff --git a/imports/ui/pages/admin/admin.add_new.js b/imports/ui/pages/admin/admin.add_new.js index 2a4c034..59115fb 100644 --- a/imports/ui/pages/admin/admin.add_new.js +++ b/imports/ui/pages/admin/admin.add_new.js @@ -1,6 +1,10 @@ import "./admin.add_new.html"; import _ from "lodash"; +Template.AdminAddNewSection.onCreated(function () { + Session.set('manually', true); +}); + Template.AdminAddNewSection.events({ 'submit #admin_add_new_unibz_form': function (event, template) { event.preventDefault(); @@ -89,5 +93,55 @@ Template.AdminAddNewSection.events({ template.find("#admin_add_new_cp_form").reset(); } }); + }, + 'change #automatic': function (event, template) { + Session.set('manually', false); + }, + 'change #isManually': function (event, template) { + Session.set('manually', true); + }, + 'submit #admin_add_new_accommodation': function (event, template) { + event.preventDefault(); + + // get form values + let target = event.target; + let accommodationName = target.accommodation_name.value; + let accommodationAddress = target.accommodation_address.value; + let busZone = target.bus_zone ? target.bus_zone.value : ''; + let capacity = target.capacity.value; + + let accommodation = { + name: accommodationName, + address: accommodationAddress, + coordinates: '', + busZone: busZone, + capacity: capacity, + isManuallyAssign: Session.get('manually') + }; + // create user + Meteor.call('accommodation.create', accommodation, role, function (error) { + if (error) swal('Error', error.message, 'error'); + else { + + swal({ + title: 'Accommodation created', + type: 'success', + html: 'Accommodation Name: ' + accommodation.name + '', + confirmButtonText: 'OK', + confirmButtonColor: '#008eff' + }); + + // Clear form + template.find("#admin_add_new_accommodation").reset(); + } + }); + }, + + +}); + +Template.AdminAddNewSection.helpers({ + isManually: function() { + return Session.get('manually'); } }); \ No newline at end of file diff --git a/imports/ui/pages/admin/admin.html b/imports/ui/pages/admin/admin.html index f67f62e..4cf7b63 100644 --- a/imports/ui/pages/admin/admin.html +++ b/imports/ui/pages/admin/admin.html @@ -26,6 +26,9 @@ +
  • Logout
  • diff --git a/imports/ui/pages/admin/admin.list.html b/imports/ui/pages/admin/admin.list.html index bc68307..95ebabc 100644 --- a/imports/ui/pages/admin/admin.list.html +++ b/imports/ui/pages/admin/admin.list.html @@ -1,1366 +1,547 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/imports/ui/pages/admin/admin.list.js b/imports/ui/pages/admin/admin.list.js index e2c1ed9..71d78db 100644 --- a/imports/ui/pages/admin/admin.list.js +++ b/imports/ui/pages/admin/admin.list.js @@ -1,455 +1,368 @@ -import "./admin.list.html"; -import Participants from "/imports/collections/participants"; -import IDs from "/imports/collections/ids"; -import jwt from "jsonwebtoken"; -import _ from "lodash"; -import {deepFind} from "/lib/js/utilities"; -import "/node_modules/bootstrap/dist/js/bootstrap.min"; +import './admin.list.html' +import Participants from '/imports/collections/participants' +import Accommodations from '/imports/collections/accommodations' +import jwt from 'jsonwebtoken' +import _ from 'lodash' +import {deepFlatten, deepPick, deepFind} from '/lib/js/utilities' let fields = require('/imports/collections/db_allowed_values.json'); -const participantsIndices = {'statusComplete': 1, 'firstName': 1, 'lastName': 1}; +const participantsIndices = {'firstName': 1, 'lastName': 1}; +const accomIndices = {'name': 1, 'address':1, 'busZone':1}; const usersIndices = {'username': 1, 'profile.firstName': 1, 'profile.lastName': 1, 'roles': 1}; -// AdminListSection -let collSub; - -// Modal -let modalSubIDs, modalSub, modalSubOwner, modalSubUser, modalSubParticipant; let raven = require('raven'); let client = new raven.Client('https://7b01834070004a4a91b5a7ed14c0b411:79de4d1bd9f24d1a93b78b18750afb54@sentry.io/126769', { - environment: Meteor.settings.public.environment, - server_name: 'snowdays', - tags: {section: 'API'}, - autoBreadcrumbs: true + environment: Meteor.settings.public.environment, + server_name: 'snowdays', + tags: {section: 'API'} }); // catches all exceptions on the server -// raven.patchGlobal(client); +raven.patchGlobal(client); client.on('logged', function () { - console.log('Exception handled and sent to Sentry.io'); + console.log('Exception handled and sent to Sentry.io'); }); client.on('error', function (e) { - // The event contains information about the failure: - // e.reason -- raw response body - // e.statusCode -- response status code - // e.response -- raw http response object + // The event contains information about the failure: + // e.reason -- raw response body + // e.statusCode -- response status code + // e.response -- raw http response object - console.log('Couldn\'t connect to Sentry.io'); + console.log('Couldn\'t connect to Sentry.io'); }); Template.AdminListSection.onCreated(function () { - // template instance - let template = Template.instance(); - - template.flattenedFields = new ReactiveVar(participantsIndices); - template.limit = new ReactiveVar(5); - template.skip = new ReactiveVar(0); - template.count = new ReactiveVar(0); - - template.collection = new ReactiveVar({ - name: 'participants', - instance: Participants, - flattened: template.flattenedFields.get(), - searchQuery: '', - filters: [] - }); + let template = Template.instance(); - this.autorun(() => { - let collection = template.collection.get(); - let limit = template.limit.get(); - let skip = template.skip.get(); - - $.when(setSubscription(collection.name, collection.filters, collection.searchQuery, collection.flattened, limit, skip)).done(function (options) { - collSub = Meteor.subscribe(collection.name + ".all", options, function onStop(error) { - if (error) swal('Error', error, 'error'); - console.log(collection.name + ".all STOP") - }, function onReady() { - console.log(collection.name + ".all START"); - - Meteor.call(collection.name + '.count', options, function (error, count) { - template.count.set(count); - setTimeout(() => { - generateTable(template, options); - }, 300); - }); - }); - }) - }); -}); + template.flattenedFields = new ReactiveVar(participantsIndices); -Template.AdminListSection.onDestroyed(function () { - // stop main subscription - collSub.stop() -}); - -Template.AdminListSection.events({ - - 'click .sn-open-modal': function (event, template) { - let modalId = $(event.target).attr('data-modal-id'); - let userId = $(event.target).attr('data-user-id'); - Session.set('_id', userId); - Session.set('userModalTab', 'UserModalParticipant'); - $('#' + modalId).modal('show') - }, - - 'click .sn-close-modal': function (event, template) { - let modalId = $(event.target).attr('data-modal-id'); - modalSub.stop(); - modalSubParticipant.stop(); - modalSubOwner.stop(); - modalSubUser.stop(); - Session.set('_id', ''); - $('#' + modalId).modal('hide') - }, - - /** - * Switches between collections - */ - 'change #collection_select': function (event, template) { - let collectionName = event.target.value; - - if (_.isEqual(collectionName, 'users')) { - template.collection.set({ - name: collectionName, - instance: Meteor.users, - flattened: usersIndices, - searchQuery: '', - filters: [] - }); - } else { - template.collection.set({ - name: collectionName, + template.collection = new ReactiveVar({ + name: 'participants', instance: Participants, - flattened: participantsIndices, + flattened: template.flattenedFields.get(), searchQuery: '', filters: [] - }) - } - - // reset skip and limit - template.skip.set(0); - template.limit.set(5); - - // reset search input - $('#search').val('') - }, - - /** - * When selecting filters for filtering, it regenerates - * related allowed values' select options - */ - 'change #select_field': function (event, template) { - let field = event.target.value; - let collection = template.collection.get(); - let instance = collection.instance; - - // TODO: everything should be set and retrieve from the website/db like this - // if (_.isEqual(field, 'university')) { - // retrieve all values from server - // console.log(Meteor.call('collection.raw', instance)); - // } - - // deep find in object, returns values allowed - let allowed = deepFind(fields[collection.name], field) || deepFind(fields['common'], field) || deepFind(fields['common'], 'boolean'); - - createOptionChildren(allowed, 'select_value'); - }, - - /** - * Adds filters - */ - 'submit #add_filter_form': function (event, template) { - event.preventDefault(); - - let newFilter; - let collection = template.collection.get(); - let field = event.target.select_field.value; - let operation = event.target.operation.value; - let value = event.target.select_value.value; - let currentFilters = collection.filters; - let flattened = collection.flattened; - - if (!_.isEqual(field, 'Field') && !_.isEqual(value, 'Value')) { - - // _.zipObject returns an object composed from key-value pairs - if (_.isEqual(operation, 'e')) { - if (_.isEqual(value, 'true')) value = true; - if (_.isEqual(value, 'false')) value = false; - - console.log(value); - newFilter = _.zipObject([field], [{$eq: value}]); - } else if (_.isEqual(operation, 'ne')) { - newFilter = _.zipObject([field], [{$ne: value}]); - } - - currentFilters.push(newFilter); - flattened[field] = 1; - - // reset skip - template.skip.set(0); - - template.collection.set({ - name: collection.name, - instance: collection.instance, - flattened: flattened, - searchQuery: collection.searchQuery, - filters: currentFilters - }); - - // Clear form - document.getElementById('add_filter_form').reset(); - } - }, - - /** - * Deletes filters - */ - 'click #sn-delete-filter': (event, template) => { - // get filter index - let index = $(event.target).attr("name"); - let collection = template.collection.get(); - let currentFilters = collection.filters; - - // remove from array at index - _.pullAt(currentFilters, [index]); - - // reset skip - template.skip.set(0); + }); - // update reactive variable - template.collection.set({ - name: collection.name, - instance: collection.instance, - flattened: collection.flattened, - searchQuery: collection.searchQuery, - filters: currentFilters + // subscribe as soon the template is created + // this.subscribe("users.current"); + this.autorun(() => { + let collection = template.collection.get(); + $.when(setSubscription(collection.filters, collection.searchQuery, collection.flattened)).done(function (options) { + Meteor.subscribe(collection.name + ".all", options, () => { + console.log(Participants.find().fetch()); + setTimeout(() => { + generateTable(template, options); + }, 300); + }); + }) }); +}); - }, +Template.AdminListSection.onRendered(function () { - /** - * Handles search - */ - 'keyup [name="search"]': (event, template) => { - let value = event.target.value.trim(); - let collection = template.collection.get(); +}); - // keyCode 13 = 'enter' - if (event.keyCode === 13) { - template.collection.set({ - name: collection.name, - instance: collection.instance, - flattened: collection.flattened, - searchQuery: value, - filters: collection.filters - }); - } - }, +Template.AdminListSection.events({ - /** - * Updates fields in table - */ - 'submit #fields_form': function (event, template) { - event.preventDefault(); - let collection = template.collection.get(); + /** + * Switches between collections + */ + 'change #collection_select': function (event, template) { + let collectionName = event.target.value; + + if (_.isEqual(collectionName, 'users')) { + template.collection.set({ + name: collectionName, + instance: Meteor.users, + flattened: usersIndices, + searchQuery: '', + filters: [] + }) + } + if (_.isEqual(collectionName, 'accommodations')) { + template.collection.set({ + name: collectionName, + instance: Accommodations, + flattened: accomIndices, + searchQuery: '', + filters: [] + }) + } + if (_.isEqual(collectionName, 'participants')) { + template.collection.set({ + name: collectionName, + instance: Participants, + flattened: participantsIndices, + searchQuery: '', + filters: [] + }) + } + // reset search input + $('#search').val('') + }, + + /** + * When selecting filters for filtering, it regenerates + * related allowed values' select options + */ + 'change #select_field': function (event, template) { + let value = event.target.value; + let collection = template.collection.get().name; + + // deep find in object, returns values allowed + let allowed = deepFind(fields[collection], value) || deepFind(fields['common'], value) || deepFind(fields['common'], 'boolean'); + + console.log(value, fields[collection], deepFind(fields[collection], value.toString())); + + createOptionChildren(allowed, 'select_value'); + }, + + /** + * Adds filters + */ + 'submit #add_filter_form': function (event, template) { + event.preventDefault(); + + let newFilter; + let collection = template.collection.get(); + let field = event.target.select_field.value; + let operation = event.target.operation.value; + let value = event.target.select_value.value; + let currentFilters = collection.filters; + + console.log(field, operation, value); + + + // _.zipObject returns an object composed from key-value pairs + if (_.isEqual(operation, 'e')) + newFilter = _.zipObject([field], [{$eq: value}]); + else + newFilter = _.zipObject([field], [{$ne: value}]); + + currentFilters.push(newFilter); + + template.collection.set({ + name: collection.name, + instance: collection.instance, + flattened: collection.flattened, + searchQuery: collection.searchQuery, + filters: currentFilters + }); + }, + + /** + * Deletes filters + */ + 'click #sn-delete-filter': (event, template) => { + // get filter index + let index = $(event.target).parent().attr("value"); + let collection = template.collection.get(); + let currentFilters = collection.filters; + + // remove from array at index + _.pullAt(currentFilters, [index]); + + // update reactive variable + template.collection.set({ + name: collection.name, + instance: collection.instance, + flattened: collection.flattened, + searchQuery: collection.searchQuery, + filters: currentFilters + }); + }, + + /** + * Handles search + */ + 'keyup [name="search"]': (event, template) => { + let value = event.target.value.trim(); + let collection = template.collection.get(); + + // keyCode 13 = 'enter' + if (event.keyCode === 13) { + template.collection.set({ + name: collection.name, + instance: collection.instance, + flattened: collection.flattened, + searchQuery: value, + filters: collection.filters + }); + } + }, - let currentFlattenedFields = collection.flattened; + /** + * Updates fields in table + */ + 'submit #fields_form': function (event, template) { + event.preventDefault(); + let collection = template.collection.get(); - // replace each _ in children inputs with . - $(event.target).find('input').each(function () { - let replaced = this.id.replace(/_/g, '.'); + let currentFlattenedFields = collection.flattened; - // set value = 1 - if (this.checked) currentFlattenedFields[replaced] = 1; + // replace each _ in children inputs with . + $(event.target).find('input').each(function () { + let replaced = this.id.replace(/_/g, '.'); - // or delete property - else delete currentFlattenedFields[replaced]; - }); + // set value = 1 + if (this.checked) currentFlattenedFields[replaced] = 1; - // update reactive variable - template.collection.set({ - name: collection.name, - instance: collection.instance, - flattened: currentFlattenedFields, - searchQuery: collection.searchQuery, - filters: collection.filters - }); - }, + // or delete property + else delete currentFlattenedFields[replaced]; + }); - 'click #download_csv': function (event, template) { - let collection = template.collection.get(); - let filename = ''; - let download = ''; + // update reactive variable + template.collection.set({ + name: collection.name, + instance: collection.instance, + flattened: currentFlattenedFields, + searchQuery: collection.searchQuery, + filters: collection.filters + }); + }, + 'click #download_csv': function (event, template) { + let collection = template.collection.get(); + let filename = ''; + let download = ''; - swal.setDefaults({ - confirmButtonText: 'Next →', - showCancelButton: true, - allowOutsideClick: false, - progressSteps: ['1', '2'] - }); - let steps = [ - { - title: 'Download ...', - input: 'radio', - inputOptions: { - 'all': ' All current collection', - 'results': ' Results shown only' - }, - confirmButtonColor: '#008eff', - inputValidator: function (result) { - return new Promise(function (resolve, reject) { - if (result) { - download = result; - resolve() - } else { - reject('You need to select something!') - } - }) - } - }, - { - title: 'Please give the file a name', - input: 'text', - showCancelButton: true, - confirmButtonColor: '#008eff', - confirmButtonText: 'Download', - inputValidator: function (result) { - return new Promise(function (resolve, reject) { - if (result) { - filename = result; - resolve() - } else { - reject('You need to write something!') + swal.setDefaults({ + confirmButtonText: 'Next →', + showCancelButton: true, + allowOutsideClick: false, + progressSteps: ['1', '2'] + }); + + let steps = [ + { + title: 'Download ...', + input: 'radio', + inputOptions: { + 'all': ' All current collection', + 'results': ' Results shown only' + }, + confirmButtonColor: '#008eff', + inputValidator: function (result) { + return new Promise(function (resolve, reject) { + if (result) { + download = result; + resolve() + } else { + reject('You need to select something!') + } + }) + } + }, + { + title: 'Please give the file a name', + input: 'text', + showCancelButton: true, + confirmButtonColor: '#008eff', + confirmButtonText: 'Download', + inputValidator: function (result) { + return new Promise(function (resolve, reject) { + if (result) { + filename = result; + resolve() + } else { + reject('You need to write something!') + } + }) + }, + preConfirm: function () { + return new Promise(function (resolve) { + $.when(setSubscription(collection.filters, collection.searchQuery, collection.flattened)).done(function (options) { + options['filename'] = filename; + options['download'] = download; + let encoded = jwt.sign(options, 'secret', {expiresIn: 60}); + Meteor.setTimeout(function () { + Router.go('/csv/' + encoded); + }, 300) + }) + }) + } } - }) - }, - preConfirm: function () { - return new Promise(function (resolve) { - swal.resetDefaults(); - // limit, skip = whatever since is not considered in the server route - $.when(setSubscription(collection.name, collection.filters, collection.searchQuery, collection.flattened, 0, 0)).done(function (options) { - options['collection'] = collection.name; - options['filename'] = filename; - options['download'] = download; - let encoded = jwt.sign(options, 'secret', {expiresIn: 60}); - Router.go('/csv/' + encoded); + ]; + + swal.queue(steps).then(function () { + console.log('steps'); + swal.resetDefaults() + }) + }, + + 'click #sn-delete-entry': function (event, template) { + let _id = $(event.target).parent().attr("name"); + let collection = template.collection.get(); + + swal({ + title: 'Are you sure?', + text: "You won't be able to revert this!", + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#008eff', + cancelButtonColor: '#e74c3c', + confirmButtonText: 'Yes, delete it!' + }).then(function () { + Meteor.call(collection.name + '.remove', _id, function (error, result) { + if (error) swal('Error', error.message, 'error'); + else if (_.isEqual(0, result)) swal('Warning', 'Participant not removed!', 'warning'); + else { + generateTable(template) + } }) - }) - } - } - ]; + }); + } - swal.queue(steps).then(function () { - console.log('steps'); - // TODO: exit dialog before downloading - }) - }, +}); - 'click #sn-delete-entry': function (event, template) { - let _id = $(event.target).attr("name"); - let collection = template.collection.get(); - let limit = template.limit.get(); - let skip = template.skip.get(); - - swal({ - title: 'Are you sure?', - text: "You won't be able to revert this!", - type: 'warning', - showCancelButton: true, - confirmButtonColor: '#008eff', - cancelButtonColor: '#e74c3c', - confirmButtonText: 'Yes, delete it!' - }).then(function () { - Meteor.call(collection.name + '.remove', _id, function (error, result) { - if (error) swal('Error', error.message, 'error'); - else if (_.isEqual(0, result)) swal('Warning', 'Object in ' + collection.name + ' not removed!', 'warning'); - else { - $.when(setSubscription(collection.name, collection.filters, collection.searchQuery, collection.flattened, limit, skip)).done(function (options) { - generateTable(template, options); - }) +Template.AdminListSection.helpers({ + count: function (selector) { + let collection = Template.instance().collection.get(); + let options = setSubscription(collection.filters, collection.searchQuery, collection.flattened); + + switch (selector) { + case 'results': + let query = collection.instance.find(options.query, options.query).count(); + return query + (query > 1 ? ' '+collection.name : ' '+ collection.name.substr(0, collection.name.length -1 )); + break; + case 'filters': + return _.size(collection.filters) || '0'; + break; + case 'fields': + return _.size(collection.flattened) || '0'; + break; + default: + return '@' } - }) - }); - }, - - 'change #limit_field': function (event, template) { - let value = event.target.value; + }, - // update reactive variable - template.limit.set(value); - - // reset skip - template.skip.set(0) - }, + listIsEmpty: function () { + let collection = Template.instance().collection.get(); + $.when(setSubscription(collection.filters, collection.searchQuery, collection.flattened)).done(function (options) { + return _.isEqual(collection.instance.find(options.query, {fields: options.fields}).count(), 0) + }); + }, - 'click .pagination_item': function (event, template) { - let value = event.target.name; - let limit = template.limit.get(); + filtersList: function () { + return Template.instance().collection.get().filters + }, - template.skip.set((value - 1) * limit) - }, + query: function () { + return Template.instance().collection.get().searchQuery || 'Search first name and last name'; + }, -}); - -Template.AdminListSection.helpers({ - countText: function (selector) { - let collection = Template.instance().collection.get(); - let count = Template.instance().count.get(); - - switch (selector) { - case 'results': - return count + (count == 1 ? ' match' : ' matches'); - break; - case 'filters': - return _.size(collection.filters) || '0'; - break; - case 'fields': - return _.size(collection.flattened) || '0'; - break; - default: - return '@' + isCollection: function (collection) { + return _.isEqual(collection, Template.instance().collection.get().name) } - }, - - count: function (selector) { - let collection = Template.instance().collection.get(); - let count = Template.instance().count.get(); - - switch (selector) { - case 'results': - return count; - break; - case 'filters': - return _.size(collection.filters) || 0; - break; - case 'fields': - return _.size(collection.flattened) || 0; - break; - default: - return '@' - } - }, - - filtersList: function () { - return Template.instance().collection.get().filters - }, - - query: function () { - return Template.instance().collection.get().searchQuery || 'Search first and last name'; - }, - - isCollection: function (collection) { - return _.isEqual(collection, Template.instance().collection.get().name) - } }); @@ -461,660 +374,116 @@ Template.AdminListSection.helpers({ * @param {Object} selectName */ function createOptionChildren(values, selectName) { - let select = document.getElementById(selectName); - - // empty select input - $(select).empty(); - - // then append values - if (!_.isEmpty(values)) { - _.forEach(values, function (value, key) { - $(select).append($('