diff --git a/public/js/main.js b/public/js/main.js index 4e134d2..128e546 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -69,8 +69,7 @@ Vue.component('l-icon', window.Vue2Leaflet.LIcon); Vue.component('l-popup', window.Vue2Leaflet.LPopup); Vue.component('l-tooltip', window.Vue2Leaflet.LTooltip); Vue.component('l-control-scale', window.Vue2Leaflet.LControlScale); -Vue.component('l-draggable', window.vuedraggable); -Vue.use(window.VueTextareaAutosize.install) +Vue.use(window.VueTextareaAutosize) Vue.component('multiselect', window.VueMultiselect.default) @@ -88,7 +87,6 @@ const app = new Vue({ query:{hotel:[],flight:[],nominatim:[]}, querying:{hotel:false,flight:false,place:false,food:false}, impexp:"", - activities_tmp:[], }, methods: { start_journey: function(event){ @@ -101,14 +99,20 @@ const app = new Vue({ next_step: function(){ this.journey_step+=1; this.journey_step_data = this.step_convert(this.journey_step); - this.activities_tmp = this.journey_data.main[this.journey_step_data.section].places.activities.filter(e=>e.step==this.journey_step) + if(this.journey_step_data.section==-1) this.prev_step(); + window.location.hash = '#' + this.journey_step; + + }, + prev_step: function(){ + this.journey_step-=1; + if(this.journey_step<-1) this.journey_step=-1; + this.journey_step_data = this.step_convert(this.journey_step); window.location.hash = '#' + this.journey_step; }, first_step: function(){ this.journey_step=-1; this.journey_step_data = {day:-1, section:-1}; - this.activities_tmp = []; window.location.hash = ''; }, step_convert: function(step){ @@ -140,7 +144,10 @@ const app = new Vue({ } return query_nominatim(txt,f) .then((results) =>{ - results.forEach(r=>r.latlon=[parseFloat(r.lat),parseFloat(r.lon)]) + results.forEach(r=>{ + r.latlon=[parseFloat(r.lat),parseFloat(r.lon)]; + r.sname=r.display_name.split(',')[0]; + }) this.query.nominatim=results; }); }, @@ -157,9 +164,10 @@ const app = new Vue({ }); }, - generate_icon: function(item){ - return L.AwesomeMarkers.icon( - {icon: icon_type(item) || 'star', prefix: 'fa',markerColor: item.color || 'blue'} + generate_icon: function(item,fcolor){ + return L.AwesomeMarkers.icon({ + icon: icon_type(item) || 'star', prefix: 'fa', + markerColor: fcolor || item.color || 'blue'} ).createIcon().outerHTML }, @@ -199,7 +207,6 @@ const app = new Vue({ } } this.journey_step_data = this.step_convert(this.journey_step); - this.activities_tmp = this.journey_data.main[this.journey_step_data.section].places.activities.filter(e=>e.step==this.journey_step); }); this.debounceSave = _.debounce(this.save_data, 500) this.debounceSearch = {"hotel":_.debounce((q)=>{this.querying.hotel=true;this.search_nominatim(q,(r)=>(r.type=="hotel")).then((r)=>{this.querying.hotel=false});}, 500), @@ -225,11 +232,5 @@ const app = new Vue({ }, deep: true, }, - activities_tmp:{ - handler:function (nd,od){ - nd.forEach(e=>e.step=this.journey_step); - }, - deep: false, - }, }, }) \ No newline at end of file diff --git a/public/template/home.html b/public/template/home.html index e3f7052..c657521 100644 --- a/public/template/home.html +++ b/public/template/home.html @@ -9,7 +9,6 @@ - diff --git a/public/template/journey.html b/public/template/journey.html index 551a56c..15a95c6 100644 --- a/public/template/journey.html +++ b/public/template/journey.html @@ -9,7 +9,6 @@ - @@ -28,8 +27,6 @@ - - @@ -45,8 +42,9 @@
@@ -74,7 +72,7 @@ -
+
@@ -90,17 +88,17 @@ -
+
- Food: {{place.display_name}} + Restaurant: {{place.display_name}}
-
+
@@ -119,26 +117,26 @@
- +
- - + +
- +
- +
@@ -164,7 +162,7 @@
-
+
@@ -186,34 +184,91 @@ journey_data.main[journey_step_data.section].hotel.icon" :lat-lng="journey_data.main[journey_step_data.section].hotel.latlon"> -
+
-
- Hotel: {{journey_data.main[journey_step_data.section].hotel.display_name}} -
-
- - - - -
-
- -
- Activity: {{place.display_name}} +

{{journey_data.main[journey_step_data.section].hotel.sname}}

+ {{journey_data.main[journey_step_data.section].hotel.display_name}} +
+ +
+ +
+ +
+
+ +

{{place.sname}}

+ {{place.display_name}} +
+ +
+ - +
+
+
+ +
+
+ +

{{place.sname}}

+ {{place.display_name}} +
+ +
+ + +
+
+
+ +
+
+ +

{{place.sname}}

+ {{place.display_name}} +
+ +
+ + +
+
+
+ +
+
+ +

{{place.sname}}

+ {{place.display_name}} + +
+
@@ -229,55 +284,6 @@
-
- Select Daily Activities -
-
- -
- {{ element.display_name.split(",")[0] }} -
-
-
-
- -
-
- -
{{ element.display_name.split(",")[0] }}
-
-
-
- -
-
-
-
-
-
-