diff --git a/.desktop/settings.json b/.desktop/settings.json index 5b395b3097e3917d3012c0b8ecc1083855e99152..cf72ee21203e603a687c42aa5829a191d96285c5 100644 --- a/.desktop/settings.json +++ b/.desktop/settings.json @@ -22,7 +22,7 @@ "uglify": true, "plugins": { "meteor-desktop-splash-screen": { - "version": "0.1.0", + "version": "0.3.0", "imagePath": "splash.png", "windowSettings": { "width": 800, diff --git a/.meteor/packages b/.meteor/packages index 6127d04ff2aea2dc7517ee731784a95fd064c41a..530d7541ed2fa18da14e2180a20585c8f0d0a687 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -75,7 +75,7 @@ force-ssl@1.0.13 froatsnook:request froatsnook:valid-email shell-server@0.2.3 -omega:meteor-desktop-watcher@=0.5.3 -omega:meteor-desktop-bundler@=0.5.3 +omega:meteor-desktop-watcher@=0.6.1 +omega:meteor-desktop-bundler@=0.6.1 omega:meteor-desktop-localstorage tap:i18n-bundler diff --git a/.meteor/versions b/.meteor/versions index c5ecfd337a725dbcee7e6ef0d27f14e0d804cc44..72d2e9f31b113367baac91b17ff5745de499cb12 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -115,9 +115,9 @@ mrt:profile-online@0.1.9 multiply:iron-router-progress@1.0.2 npm-mongo@2.2.24 observe-sequence@1.0.16 -omega:meteor-desktop-bundler@0.5.3 +omega:meteor-desktop-bundler@0.6.1 omega:meteor-desktop-localstorage@0.0.11 -omega:meteor-desktop-watcher@0.5.3 +omega:meteor-desktop-watcher@0.6.1 ordered-dict@1.0.9 outatime:geolib@2.0.15 pauloborges:mapbox@2.2.3_2 diff --git a/imports/api/news.js b/imports/api/news.js index caf942c32f1d109e0d480ab1341c99a8b1c7c4cd..accb9f9a939105db447ad3ee787bb8112c9c0ba9 100644 --- a/imports/api/news.js +++ b/imports/api/news.js @@ -133,33 +133,54 @@ News.deny({ //collection -if(Meteor.isClient){ - import { Photosimg } from './client/photosimg.js' -} - import { Citoyens } from './citoyens.js' - -News.helpers({ - authorNews () { - return Citoyens.findOne({_id:new Mongo.ObjectID(this.author)}); - }, - photoNews () { - if(this.media && this.media.content && this.media.content.imageId){ - return Photosimg.find({_id:this.media.content.imageId}); + if(Meteor.isClient){ + import { Photosimg } from './client/photosimg.js' + import { Citoyens } from './citoyens.js' + News.helpers({ + authorNews () { + return Citoyens.findOne({_id:new Mongo.ObjectID(this.author)}); + }, + photoNews () { + if(this.media && this.media.content && this.media.content.imageId){ + return Photosimg.find({_id:this.media.content.imageId}); + } + }, + likesCount () { + if (this.voteUp && this.voteUpCount) { + return this.voteUpCount; + } + return 0; + }, + dislikesCount () { + if (this.voteDown && this.voteDownCount) { + return this.voteDownCount; + } + return 0; + }, + isAuthor () { + return this.author === Meteor.userId(); + } + }); + }else{ + import { Citoyens } from './citoyens.js' + News.helpers({ + authorNews () { + return Citoyens.findOne({_id:new Mongo.ObjectID(this.author)}); + }, + likesCount () { + if (this.voteUp && this.voteUpCount) { + return this.voteUpCount; + } + return 0; + }, + dislikesCount () { + if (this.voteDown && this.voteDownCount) { + return this.voteDownCount; + } + return 0; + }, + isAuthor () { + return this.author === Meteor.userId(); + } + }); } - }, - likesCount () { - if (this.voteUp && this.voteUpCount) { - return this.voteUpCount; - } - return 0; - }, - dislikesCount () { - if (this.voteDown && this.voteDownCount) { - return this.voteDownCount; - } - return 0; - }, - isAuthor () { - return this.author === Meteor.userId(); - } -}); diff --git a/imports/api/server/publish.js b/imports/api/server/publish.js index eece5d1791d7794bca2f7a3c3ff22593ca37edd6..151ad40c71a9b390d33d71960778c2aad09f5271 100644 --- a/imports/api/server/publish.js +++ b/imports/api/server/publish.js @@ -133,12 +133,11 @@ Meteor.publishComposite('citoyenEvents', function(latlng,radius) { $maxDistance: radius }}},{_disableOplog: true}); }else{ - //console.log("polygon"); return Events.find({"geoPosition": { $geoIntersects: { $geometry:{ - "type" : "Polygon", - "coordinates" : latlng + "type" : latlng.type, + "coordinates" : latlng.coordinates } } } diff --git a/imports/ui/changeposition/changeposition.js b/imports/ui/changeposition/changeposition.js index 6ade63525804c986e88e1853dd16c79c6c416779..27bc6403566641d7c1c60a41f170bc5e2a8f23ce 100644 --- a/imports/ui/changeposition/changeposition.js +++ b/imports/ui/changeposition/changeposition.js @@ -59,7 +59,9 @@ Template.changePosition.onRendered(function () { var onOk=IonPopup.confirm({title:TAPi18n.__('Position'),template:TAPi18n.__('Utiliser la position de cette ville'), onOk: function(){ Session.set( 'city', self); - Session.set('radius', false); + if(self.geoShape && self.geoShape.coordinates){ + Session.set('radius', false); + } Session.set('geolocate', false); Location.setMockLocation({ latitude : self.geo.latitude, diff --git a/imports/ui/events/list.js b/imports/ui/events/list.js index 531d76e8c5c1e67cd2d549ae398a3af4f56f51a8..f7343a41d4ef02302528e882a25480d36efb4fc4 100644 --- a/imports/ui/events/list.js +++ b/imports/ui/events/list.js @@ -32,7 +32,7 @@ Template.map.onCreated(function () { Template.map.onRendered(function () { var self = this; - L.mapbox.accessToken = 'pk.eyJ1IjoiY29tbXVuZWN0ZXIiLCJhIjoiY2lreWRkNzNrMDA0dXc3bTA1MHkwbXdscCJ9.NbvsJ14y2bMWWdGqucR_EQ'; + L.mapbox.accessToken = Meteor.settings.public.mapbox; let map = L.mapbox.map('map','mapbox.streets'); var marker; self.autorun(function(c) { @@ -66,16 +66,17 @@ Template.listEvents.onCreated(function () { self.autorun(function(c) { let geo = Location.getReactivePosition(); let radius = Session.get('radius'); + console.log(radius); if(radius && geo && geo.latitude){ - //console.log('sub list events geo radius'); + console.log('sub list events geo radius'); let latlng = {latitude: parseFloat(geo.latitude), longitude: parseFloat(geo.longitude)}; let handle = listEventsSubs.subscribe('citoyenEvents',latlng,radius); self.ready.set(handle.ready()); }else{ - //console.log('sub list events city'); + console.log('sub list events city'); let city = Session.get('city'); if(city && city.geoShape && city.geoShape.coordinates){ - let handle = listEventsSubs.subscribe('citoyenEvents',city.geoShape.coordinates); + let handle = listEventsSubs.subscribe('citoyenEvents',city.geoShape); self.ready.set(handle.ready()); } } diff --git a/imports/ui/mapevent/mapevent.js b/imports/ui/mapevent/mapevent.js index b8feae13ddd14eee58ecb6ce94676617bef5195d..14833da004fa447a00cb668874e6902f562f1d50 100644 --- a/imports/ui/mapevent/mapevent.js +++ b/imports/ui/mapevent/mapevent.js @@ -36,7 +36,7 @@ Template.mapevent.onCreated(function () { console.log('sub list events city'); let city = Session.get('city'); if(city && city.geoShape && city.geoShape.coordinates){ - let handle = listEventsSubs.subscribe('citoyenEvents',city.geoShape.coordinates); + let handle = listEventsSubs.subscribe('citoyenEvents',city.geoShape); self.ready.set(handle.ready()); } }