JourneyJoker/templates/auction/offer_table.js

51 lines
3 KiB
JavaScript
Raw Normal View History

2021-04-15 16:10:31 +00:00
{% load offeroptions %}
!(function(){
var myTabella = new Tabella(
document.getElementById('offers'),
{
2021-04-15 16:10:31 +00:00
from: "",
tableHeader: [
{% for offer in object_list %}['{{ offer.roomcategory.establishment.name }}<br/>{% if offer.roomcategory.establishment.image %}<br/><img onclick="$(\'#gallery{{ offer.id }}\').modal(\'show\');" style="max-height:100px;max-width:100%;" src="{{ offer.roomcategory.establishment.image.url }}"></img>{% endif %}'],{% endfor %}
],
rows : [
{
rowVal: [
[{% for offer in object_list %}'{{ offer.inquiry.arrival }}',{% endfor %}],
[{% for offer in object_list %}'{{ offer.departure }}',{% endfor %}],
[{% for offer in object_list %}'{{ offer.nights }} Nächte',{% endfor %}]
],
2021-04-15 16:10:31 +00:00
rowDesc: ["Anreise", "Abreise", "Dauer"]
},
{
rowVal: [
[{% for offer in object_list %}'{% autoescape off %}{% stars offer.roomcategory.establishment.stars offer.roomcategory.establishment.superior orange %}{% endautoescape %}',{% endfor %}],
[{% for offer in object_list %}{% autoescape off %}'{% hearts 3 red %} (304)'{% endautoescape %},{% endfor %}]
],
rowDesc: ["Sterne", "Bewertungen"]
},
{
rowVal: [
[{% for offer in object_list %}'{{ offer.roomcategory.name }}',{% endfor %}],
[{% for offer in object_list %}'&nbsp;',{% endfor %}]
],
rowDesc: ["Zimmerkategorie", "Betten"]
2021-04-15 16:10:31 +00:00
},
{
rowVal: [
[{% for offer in object_list %}'<i class="fas fa-wifi" title="WLAN"></i><i class="fas fa-parking" title="Parkplätze"></i><i class="fas fa-hand-sparkles" title="Desinfektionsmittel"></i>',{% endfor %}],
[{% for offer in object_list %}'{{ offer.distance | floatformat:1 }} km',{% endfor %}],
[{% for offer in object_list %}'{% if offer.comment %}{{ offer.comment }}{% else %}&nbsp;{% endif %}',{% endfor %}]
],
rowDesc: ["Ausstattung", "Distanz zum Wunschort", "Zusätzliche Angaben"]
2021-04-15 16:10:31 +00:00
},
{
rowVal: [
[{% for offer in object_list %}'€ {{ offer.inquiry.budget }}',{% endfor %}],
[{% for offer in object_list %}'<button data-offer-uuid="{{ offer.uuid }}" data-offer-name="{{ offer.roomcategory.establishment.name }}" data-toggle="modal" data-target="#accept-offer" class="btn btn-orange btn-block accept-button">Angebot annehmen!</button>',{% endfor %}]
2021-04-15 16:10:31 +00:00
],
rowDesc: ["Fixpreis", ""]
}
]
});
})();