2020-05-27 19:39:14 +00:00
{% extends "base.html" %}
{% load static %}
{% block css %}
< link rel = "stylesheet" href = "{% static 'css/style.css' %}" >
< link rel = "stylesheet" href = "{% static 'css/navbar_style.css' %}" >
< link href = "https://fonts.googleapis.com/css2?family=Faster+One&display=swap" rel = "stylesheet" >
{% endblock css %}
{% block content %}
{% if cocktail %}
2020-06-03 13:45:22 +00:00
< div class = "card mt-3" >
< div class = "card-header" >
< h1 class = "text-center text-muted" > In totale nel nostro Salone Bar abbiamo trovato {{ cocktail.count }} cocktails {% if cocktail.count == 1 %} che corrisponde {% else %} che corrispondono {% endif %} alla tua ricerca < i class = "fas fa-cocktail" > < / i > < / h1 >
< / div >
2020-06-03 19:35:10 +00:00
< / div >
{% for cocktails in cocktail %}
2020-05-27 19:39:14 +00:00
<!-- {{ cocktail.ingredienti.all }}
{{ cocktail.nome_cocktail }} -->
{% if forloop.first %} < div class = "row" > {% endif %}
< div class = "col-lg-4 my-3" >
< a href = "{{ cocktails.get_absolute_url }}" >
< div class = "card h-100 my-1 border border-info" >
< div class = "card-img-top" > < img src = "{{ cocktails.immagine_cocktail.url }}" class = "img-fluid" alt = "{{ cocktails.nome_cocktail }}" > < / div >
< div class = "text_on_image" > {{ cocktails.nome_cocktail }}< / div >
< div class = "card-body py-0" >
< p class = "mt-2 mb-0 py-3 text-center" > {{ cocktails.ingredienti.all|join:"," }}< / p >
< / div >
< / div >
< / a >
< / div >
{% if forloop.counter|divisibleby:"3" or forloop.last %}
< / div >
{% endif %}
{% if forloop.counter|divisibleby:"3" and not forloop.last %}
< div class = "row" >
{% endif %}
{% endfor %}
2020-06-03 13:45:22 +00:00
{% endif %}
{% if ingrediente and cocktail %}
2020-05-27 19:39:14 +00:00
< hr >
2020-06-03 13:45:22 +00:00
{% elif ingrediente or cocktail %}
{% else %}
< div class = "card mt-3" >
< div class = "card-header" > < h1 class = "text-center text-muted" > Nessun Cocktail o Ingrediente trovato!< / h1 > < / div >
< / div >
2020-05-27 19:39:14 +00:00
{% endif %}
{% if ingrediente %}
2020-06-03 13:45:22 +00:00
< div class = "card mt-3" >
< div class = "card-header" > < h1 class = "text-center text-muted" > Cocktails contenenti l'ingrediente "{{ querystring }}" : < / h1 > < / div >
< / div >
{% for cocktails_ingrediente in ingrediente %}
{% if forloop.first %} < div class = "row" > {% endif %}
< div class = "col-lg-4 my-3" >
< a href = "{{ cocktails_ingrediente.get_absolute_url }}" >
< div class = "card h-100 my-1 border border-info" >
< div class = "card-img-top" > < img src = "{{ cocktails_ingrediente.immagine_cocktail.url }}" class = "img-fluid" alt = "{{ cocktails_ingrediente.nome_cocktail }}" > < / div >
< div class = "text_on_image" > {{ cocktails_ingrediente.nome_cocktail }}< / div >
< div class = "card-body py-0" >
< p class = "mt-2 mb-0 py-3 text-center" > {{ cocktails_ingrediente.ingredienti.all|join:"," }}< / p >
< / div >
< / div >
< / a >
< / div >
{% if forloop.counter|divisibleby:"3" or forloop.last %}
< / div >
{% endif %}
{% if forloop.counter|divisibleby:"3" and not forloop.last %}
< div class = "row" >
{% endif %}
{% endfor %}
2020-05-27 19:39:14 +00:00
{% endif %}
{% endblock content %}