czydojade/resources/components/finder.html
2020-01-19 18:04:27 +01:00

38 lines
1.6 KiB
HTML

<div class="finder">
<input class="form-control" :value="filter" @input="filter = $event.target.value" placeholder="Zacznij pisać nazwę aby szukać..."/>
<div v-if="filter.length < 3" class="mt-2">
<favourites />
</div>
<div v-if="state === 'fetching'" class="text-center p-4">
<fa icon="spinner-third" pulse/>
</div>
<div class="finder__stops" v-else-if="filter.length > 2 && Object.keys(filtered).length > 0">
<div class="stop-group" v-for="(group, name) in filtered">
<div class="stop-group__header">
<h3 class="stop-group__name">{{ name }}</h3>
<div class="actions flex-space-left">
<button class="btn btn-action" @click="select(group)">
<fa :icon="['fal', 'check-double']"></fa>
wybierz wszystkie
</button>
</div>
</div>
<ul class="stop-group__stops list-underlined">
<li v-for="stop in group" :key="stop.id" class="d-flex">
<button @click="select(stop, $event)" class="btn btn-action align-self-start">
<fa :icon="['fal', 'check']" />
</button>
<picker-stop :stop="stop" class="flex-grow-1"></picker-stop>
</li>
</ul>
</div>
</div>
<div class="alert alert-warning" v-else-if="filter.length > 2">
<fa :icon="['far', 'exclamation-triangle']"></fa>
Nie znaleziono więcej przystanków, spełniających te kryteria.
</div>
</div>