OTM/template/journey.html
2021-07-16 09:13:48 +02:00

320 lines
20 KiB
HTML

<html>
<head>
<title>Helcel-OTM</title>
<link rel='shortcut icon' href='/public/img/helcel.ico' type='image/x-icon'/>
<meta charset='utf-8'/>
<meta name='viewport' content='width=device-width, initial-scale=1'/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,700,300" type="text/css">
<link rel='stylesheet' href='/public/css/index.css'/>
<script src="/public/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="https://unpkg.com/vue/dist/vue.min.js"></script>
<script src="https://unpkg.com/vue2-datepicker/index.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/vue2-datepicker/index.css">
<link rel="stylesheet" href="//unpkg.com/leaflet/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script src="https://unpkg.com/vue2-leaflet"></script>
<script src="https://unpkg.com/leaflet.awesome-markers/dist/leaflet.awesome-markers.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet.awesome-markers/dist/leaflet.awesome-markers.css">
<link rel="stylesheet" href="https://unpkg.com/@fortawesome/fontawesome-free/css/all.min.css">
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="https://unpkg.com/lodash/lodash.min.js"></script>
<script src="https://unpkg.com/vue-multiselect"></script>
<script src="//cdn.jsdelivr.net/npm/sortablejs/Sortable.min.js"></script>
<script src="https://unpkg.com/vuedraggable/dist/vuedraggable.umd.min.js"></script>
<script src="https://unpkg.com/vue-textarea-autosize/dist/vue-textarea-autosize.umd.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/vue-multiselect/dist/vue-multiselect.min.css">
</head>
<body>
<main id="app">
<header class="header">
<div class="header-inner container">
<a href="/" class="header-logo text-dark">
<img class="header-logoImage" src="/public/img/helcel.png" alt="Helcel logo" width="40">
<span class="hide-small">HOTM</span>
</a>
<div class="input input-invis"><input class="small" v-model="journey_data.name" type="text" /></div>
<ul class="header-nav">
<div class="col-sm-5"><button class="button button--primary button--mobileFull" v-on:click="first_step">Main</button></div>
<div class="col-sm-5"><button class="button button--primary button--mobileFull" v-on:click="next_step">Next</button></div>
</ul>
</div>
</header>
<div v-if="journey_step==-1">
<div v-for="(item,idx) in journey_data.main" :class="idx%2===0 ? 'bg-dark text-white' : ''" v-cloak>
<div class="container section">
<div class="row text-center">
<div class="col-sm-1"><button class="button button--secondary button--mobileFull" v-on:click="rm_section(idx)">X</button></div>
<div class="input col-sm-4"><input class="" v-model="item.title" type="text" /></div>
</div>
<div class="row">
<div class="col-12 col-sm-8">
<l-map
:zoom.sync="item.map.zoom"
:center.sync="item.map.center"
style="padding-top: 100%;"
>
<l-tile-layer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
></l-tile-layer>
<l-control-scale position="topright" :imperial="false" :metric="true"></l-control-scale>
<l-marker v-if="item.hotel && item.hotel.icon" :lat-lng.sync="item.hotel.latlon">
<l-icon>
<div v-html="generate_icon(item.hotel,'hotel')"></div>
</l-icon>
<l-popup>
<div>
Hotel: {{item.hotel.display_name}}
</div>
</l-popup>
<!-- <l-tooltip :options="{ permanent: true, interactive: true }">
<div>
H
</div>
</l-tooltip> -->
</l-marker>
<l-marker v-for="place in item.places.restaurants" :lat-lng.sync="place.latlon">
<l-icon>
<div v-html="generate_icon(place,'food')"></div>
</l-icon>
<l-popup>
<div>
Food: {{place.display_name}}
</div>
</l-popup>
</l-marker>
<l-marker v-for="place in item.places.activities" :lat-lng.sync="place.latlon">
<l-icon>
<div v-html="generate_icon(place,'activity')"></div>
</l-icon>
<l-popup>
<div>
Activity: {{place.display_name}}
</div>
</l-popup>
</l-marker>
</l-map>
</div>
<div class="col-12 col-sm-4">
<div class="row text-center">
<div><label>Date Range</label></div>
<div class="input ">
<date-picker v-model="item.dateRange" range :placeholder="item.dateRange"></date-picker>
</div>
</div>
<div class="row text-center">
<div><label>Hotel</label></div>
<multiselect v-model="item.hotel" id="ajax" label="display_name" track-by="place_id" placeholder="Type to search" open-direction="bottom" :options="query.nominatim" :searchable="true" :loading="querying.hotel" :internal-search="false" :clear-on-select="false" :allow-empty="false" :options-limit="300" :limit="3" :max-height="600" @search-change="debounceSearch.hotel"></multiselect>
</div>
<div class="row text-center">
<div><label>Fight</label></div>
<multiselect v-model="item.flightA" id="ajax" label="label" track-by="id" placeholder="Type to search" open-direction="bottom" :multiple="true" :options="query.flight" :searchable="true" :loading="querying.flight" :internal-search="false" :clear-on-select="false" :allow-empty="false" :options-limit="300" :limit="3" :max-height="600" @search-change="debounceSearch.flight"></multiselect>
<multiselect v-model="item.flightB" id="ajax" label="label" track-by="id" placeholder="Type to search" open-direction="bottom" :multiple="true" :options="query.flight" :searchable="true" :loading="querying.flight" :internal-search="false" :clear-on-select="false" :allow-empty="false" :options-limit="300" :limit="3" :max-height="600" @search-change="debounceSearch.flight"></multiselect>
</div>
<div class="row text-center">
<div><label>Restoration</label></div>
<multiselect v-model="item.places.restaurants" id="ajax" label="display_name" track-by="place_id" placeholder="Type to search" open-direction="bottom" :multiple="true" :options="query.nominatim" :searchable="true" :loading="querying.food" :internal-search="false" :clear-on-select="false" :allow-empty="false" :options-limit="300" :limit="3" :max-height="600" @search-change="debounceSearch.restaurants"></multiselect>
</div>
<div class="row text-center">
<div><label>Activities</label></div>
<multiselect v-model="item.places.activities" id="ajax" label="display_name" track-by="place_id" placeholder="Type to search" open-direction="bottom" :multiple="true" :options="query.nominatim" :searchable="true" :loading="querying.place" :internal-search="false" :clear-on-select="false" :options-limit="300" :limit="3" :max-height="600" @search-change="debounceSearch.places"></multiselect>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class="container-medium section">
</div>
</div>
<div class="bg-dark">
<div id="go" class="container-medium section text-white">
<h2 class="text-big">Add new section</h2>
<p>Got an other flight and/or hotel ? Add a new section to register it</p>
<div class="aligner aligner--contentEnd">
<button class="button button--primary button--mobileFull" v-on:click="add_section">Add Section</button>
</div>
</div>
</div>
</div>
<div v-else-if="journey_step>=0 && journey_data.main[journey_step_data.section]">
<div class="bg-dark text-white" v-cloak>
<div class="container section">
<div class="row text-center">
<div class="input col-sm-4"><input :value="journey_data.main[journey_step_data.section].title + ': Day ' + journey_step_data.day" disabled /></div>
<div class="input col-sm-2"><input placeholder="Day title" v-model="journey_data.step_title[journey_step]" /></div>
</div>
<div class="row">
<div class="col-12 col-sm-12">
<l-map
:zoom=" journey_data.main[journey_step_data.section].map.zoom"
:center="journey_data.main[journey_step_data.section].map.center"
style="padding-top: 100%;"
>
<l-tile-layer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
></l-tile-layer>
<l-control-scale position="topright" :imperial="false" :metric="true"></l-control-scale>
<l-marker v-if="journey_data.main[journey_step_data.section].hotel &&
journey_data.main[journey_step_data.section].hotel.icon"
:lat-lng="journey_data.main[journey_step_data.section].hotel.latlon">
<l-icon>
<div v-html="generate_icon(journey_data.main[journey_step_data.section].hotel,'hotel')"></div>
</l-icon>
<l-popup>
<div>
Hotel: {{journey_data.main[journey_step_data.section].hotel.display_name}}
</div>
</l-popup>
</l-marker>
<!-- <l-marker v-for="place in journey_data.main[journey_step_data.section].places.restaurants" :lat-lng="place.latlon">
<l-icon>
<div v-html="generate_icon(place,'food')"></div>
</l-icon>
<l-popup>
<div>
Food: {{place.display_name}}
</div>
</l-popup>
</l-marker> -->
<l-marker v-for="place in filter_selected(journey_data.main[journey_step_data.section].places.activities, true)" :lat-lng="place.latlon">
<l-icon>
<div v-html="generate_icon(place,'activity')"></div>
</l-icon>
<l-popup>
<div>
Activity: {{place.display_name}}
</div>
</l-popup>
</l-marker>
</l-map>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12">
<div class="container text-center" v-if="journey_step_data.start || journey_step_data.end">
<b>Flights</b>
<div v-if="journey_step_data.start">
<div v-for="element in journey_data.main[journey_step_data.section].flightA"><a :href="'https://www.flightradar24.com/data/flights/'+element.id">{{ element.label }}</a></div>
</div>
<div v-if="journey_step_data.end">
<div v-for="element in journey_data.main[journey_step_data.section].flightB"><a :href="'https://www.flightradar24.com/data/flights/'+element.id">{{ element.label }}</a></div>
</div>
</div>
<div class="container"></div>
<div class="container text-center">
<b>Select Daily Activities</b>
<div class= "row text-dark container">
<div class="col-12 col-sm-6">
<l-draggable
class="dragArea list-group"
:list="filter_unselected(journey_data.main[journey_step_data.section].places.activities)"
:group="{ name: 'people', pull: 'clone', put: false }"
>
<div
class="list-group-item"
v-for="element in filter_unselected(journey_data.main[journey_step_data.section].places.activities)"
:key="element.place_id"
>
{{ element.display_name.split(",")[0] }}
</div>
</l-draggable>
</div>
<div class="col-12 col-sm-6">
<l-draggable
class="dragArea list-group"
:list="activities_tmp"
group="people"
>
<div
class="list-group-item"
v-for="(element,idx) in filter_selected(activities_tmp,true)"
:key="element.place_id"
>
<div class="row">
<i class="fa fa-times close col-12 col-sm-1" @click="remove_item(activities_tmp,idx)"></i>
<div class="text">{{ element.display_name.split(",")[0] }}</div>
</div>
<div class="row">
<div class="input col-12 col-sm-12">
<textarea-autosize
class="small"
placeholder="Comments..."
v-model="element.text"
:min-height="16"
:max-height="360"
/>
</div>
</div>
</div>
</l-draggable>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class="container-medium section">
</div>
</div>
<div class="bg-dark">
</div>
</div>
<div class="">
<div class="container-medium section">
<div class="aligner">
<div class="input col-sm-4"><input class="" v-model="impexp" type="text" /></div>
<div class="col-sm-2"><button class="button button--primary button--mobileFull" v-on:click="import_data">Import</button></div>
<div class="col-sm-2"><button class="button button--primary button--mobileFull" v-on:click="export_data">Export</button></div>
</div>
</div>
</div>
</main>
<script src="/public/js/main.js" type="text/javascript" charset="utf-8"></script>
<footer class="bg-dark">
<div class="container">
<div class="section text-center text-small">
<p class="text-white">
<img src="/public/img/helcel.png" alt="helcel logo" width="100"><br><br>
Built with &nbsp;&nbsp; by Helcel <br><span class="text-small text-gray">v0.0.1</span>
</p>
<p class="text-gray"><a href="https://git.helcel.net">Helcel Git</a></p>
</div>
</div>
</footer>
</body>
</html>