diff --git a/public/js/main.js b/public/js/main.js index 128e546..c9384c8 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -76,7 +76,7 @@ Vue.component('multiselect', window.VueMultiselect.default) const app = new Vue({ el: '#app', data: { - journey_id : window.location.pathname.slice(1) || gen_id(16), + journey_id : window.location.pathname.split('/').at(-1) || gen_id(16), journey_step: window.location.hash.slice(1)==""?-1:parseInt(window.location.hash.slice(1)), journey_step_data: {day:-1, section:-1}, journey_data : { @@ -84,6 +84,7 @@ const app = new Vue({ main:[], step_title:[], }, + view: window.location.pathname.split('/').at(1), query:{hotel:[],flight:[],nominatim:[]}, querying:{hotel:false,flight:false,place:false,food:false}, impexp:"", @@ -106,6 +107,7 @@ const app = new Vue({ prev_step: function(){ this.journey_step-=1; if(this.journey_step<-1) this.journey_step=-1; + if(this.journey_step==-1 && this.view) this.journey_step=0; this.journey_step_data = this.step_convert(this.journey_step); window.location.hash = '#' + this.journey_step; diff --git a/public/template/journey.html b/public/template/journey.html index e4af203..c52b3c5 100644 --- a/public/template/journey.html +++ b/public/template/journey.html @@ -33,162 +33,317 @@
-
-
- -
- -
    -
    -
    -
    -
-
-
-
-
-
-
-
-
- -
-
-
- - - - - - -
-
- -

{{item.hotel.sname}}

- {{item.hotel.display_name}} -
- -
-
- - -
- - -
-
- -

{{place.sname}}

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

{{place.sname}}

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

{{item.hotel.sname}}

+ {{item.hotel.display_name}} +
+ +
+
+ + +
+ + +
+
+ +

{{place.sname}}

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

{{place.sname}}

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

Add new section

+

Got an other flight and/or hotel ? Add a new section to register it

+
+
-
-
-
+
+
+
+
+
+
+
+ +
+
+
+ + + + + + +
+
+ +

{{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}} + +
+
+
+
+
+
+
+
+
+ Flights + + +
+
+
+
+
+
+
+
+
+
+
+ +
-
-
-

Add new section

-

Got an other flight and/or hotel ? Add a new section to register it

-
- + +
+
+
+
+
+
-
+
-
-
- +
{{journey_data.main[journey_step_data.section].title + ': Day ' + journey_step_data.day}}
{{journey_data.step_title[journey_step]}}
+
+
+ + +
+
@@ -213,85 +368,29 @@

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

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

{{place.sname}}

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

{{place.sname}}

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

{{place.sname}}

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

{{place.sname}}

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

{{place.sname}}

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

{{place.sname}}

- {{place.display_name}} - -
-
@@ -300,10 +399,10 @@
@@ -311,24 +410,6 @@
-
-
-
-
-
- - -
-
- -
-
-
-
-
-
-
-
@@ -340,8 +421,6 @@ helcel logo

Built with   ❤   by Helcel
v0.0.1

- -

Helcel Git

diff --git a/server.js b/server.js index e462860..ca48c72 100644 --- a/server.js +++ b/server.js @@ -16,9 +16,7 @@ fastify.register(require('fastify-leveldb'), { -fastify.get('/', (req, reply) => { - reply.sendFile('/template/home.html'); -}); +fastify.get('/', (req, reply) => reply.sendFile('/template/home.html')); fastify.register(require('./router/api'), { prefix: '/api' }); fastify.get('/:id', (req, reply) => { @@ -43,6 +41,7 @@ fastify.get('/:id', (req, reply) => { reply.sendFile('/template/journey.html'); } }); +fastify.get('/view/:id', (req, reply) => reply.sendFile('/template/journey.html'));