lnbits-legend/lnbits/extensions/diagonalley/templates/diagonalley/stall.html

154 lines
3.7 KiB
HTML
Raw Normal View History

2022-07-19 10:13:06 +01:00
{% extends "public.html" %} {% block page %}
2022-07-20 11:47:03 +01:00
<div class="row q-mb-md">
<div class="col-12 q-gutter-y-md">
<q-toolbar class="row">
<div class="col">
<q-toolbar-title> {{ stall.name }} </q-toolbar-title>
</div>
<div class="col q-mx-md">
<q-input
class="float-left full-width q-ml-md"
standout
square
dense
outlined
clearable
v-model.trim="searchText"
label="Search for products"
>
<template v-slot:append>
<q-icon v-if="!searchText" name="search" />
</template>
</q-input>
</div>
<q-btn class="q-ml-auto" flat icon="shopping_cart" />
</q-toolbar>
</div>
</div>
<div class="row q-col-gutter-md">
<div
class="col-xs-12 col-sm-6 col-lg-4"
v-for="item in products"
:key="item.id"
>
<q-card class="card--product">
{% raw %}
<q-img
:src="item.image ? item.image : '/diagonalley/static/images/placeholder.png'"
alt="Product Image"
loading="lazy"
spinner-color="white"
fit="cover"
height="300px"
></q-img>
2022-07-19 10:13:06 +01:00
2022-07-20 11:47:03 +01:00
<q-card-section class="q-pb-xs q-pt-md">
<q-btn
round
color="primary"
icon="shopping_cart"
size="lg"
style="
position: absolute;
top: 0;
right: 0;
transform: translate(-50%, -50%);
"
@click="sendAlert"
><q-tooltip> Add to cart </q-tooltip></q-btn
>
2022-07-19 10:13:06 +01:00
2022-07-20 11:47:03 +01:00
<div class="row no-wrap items-center">
<div class="col text-subtitle2 ellipsis-2-lines">
{{ item.product }}
2022-07-19 10:13:06 +01:00
</div>
2022-07-20 11:47:03 +01:00
</div>
2022-07-19 10:13:06 +01:00
2022-07-20 11:47:03 +01:00
<!-- <q-rating v-model="stars" color="orange" :max="5" readonly size="17px"></q-rating> -->
</q-card-section>
2022-07-19 10:13:06 +01:00
2022-07-20 11:47:03 +01:00
<q-card-section class="q-py-sm">
<div>
<div class="text-caption text-green-8 text-weight-bolder">
Special Price
2022-07-19 10:13:06 +01:00
</div>
2022-07-20 11:47:03 +01:00
<span class="text-h6">{{ item.price }} sats</span
><span class="q-ml-sm text-grey-6"
>BTC {{ (item.price / 1e8).toFixed(8) }}</span
2022-07-19 10:13:06 +01:00
>
2022-07-20 11:47:03 +01:00
<span
class="q-ml-md text-caption text-green-8 text-weight-bolder q-mt-md"
>{{item.quantity}} left</span
>
</div>
<div v-if="item.categories" class="text-subtitle1">
<q-chip v-for="cat in item.categories.split(',')" dense
>{{cat}}</q-chip
>
</div>
<div
v-if="item.description"
class="text-caption text-grey ellipsis-2-lines"
style="min-height: 40px"
>
{{ item.description }}
</div>
2022-07-19 10:13:06 +01:00
</q-card-section>
2022-07-20 11:47:03 +01:00
<q-separator></q-separator>
2022-07-19 10:13:06 +01:00
2022-07-20 11:47:03 +01:00
<q-card-actions>
<q-btn
flat
class="text-weight-bold text-capitalize"
dense
color="primary"
>
View details
</q-btn>
</q-card-actions>
2022-07-19 10:13:06 +01:00
{% endraw %}
</q-card>
</div>
2022-07-20 11:47:03 +01:00
</div>
2022-07-19 10:13:06 +01:00
{% endblock %} {% block scripts %}
<script>
Vue.component(VueQrcode.name, VueQrcode)
new Vue({
el: '#vue',
mixins: [windowMixin],
data: function () {
return {
2022-07-20 11:47:03 +01:00
products: [],
searchText: null,
cart: []
}
},
methods: {
sendAlert() {
alert('really')
2022-07-19 10:13:06 +01:00
}
},
created() {
this.products = JSON.parse('{{ products | tojson }}')
2022-07-20 11:47:03 +01:00
console.log(this.searchText)
2022-07-19 10:13:06 +01:00
}
})
</script>
<style scoped>
2022-07-20 11:47:03 +01:00
.card--product {
background: pink;
2022-07-19 10:13:06 +01:00
}
</style>
2022-07-20 11:47:03 +01:00
{% endblock %}
2022-07-19 10:13:06 +01:00
<!-- <pre id="json"></pre>
2022-01-27 12:24:38 +00:00
<script>
document.getElementById('json').innerHTML = JSON.stringify(
'{{ stall }}',
null,
2
)
2022-07-19 10:13:06 +01:00
</script> -->