Skip to content

Commit

Permalink
Apresenta imagens de receitas
Browse files Browse the repository at this point in the history
  • Loading branch information
brnocesar committed Nov 8, 2020
1 parent 74caf89 commit 348567b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion apps/receitas/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
{% for receita in receitas %}
<div class="col-12 col-sm-6 col-lg-4">
<div class="single-best-receipe-area mb-30">
<img src="{% static 'img/bg-img/foto_receita.png' %}" alt="">
{% if receita.foto == '' %}
<img src="{% static 'img/bg-img/foto_receita.png' %}" alt="">
{% else %}
<img src="{{ receita.foto.url }}" alt="">
{% endif %}
<div class="receipe-content">
<a href="{% url 'receita' receita.id %}">
<h5>{{ receita }}</h5>
Expand Down
6 changes: 5 additions & 1 deletion apps/receitas/templates/receita.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
<div class="row">
<div class="col-12">
<div class="receipe-slider owl-carousel">
<img src="{% static 'img/bg-img/tomate_banner.jpg' %}">
{% if receita.foto == '' %}
<img src="{% static 'img/bg-img/tomate_banner.jpg' %}">
{% else %}
<img src="{{ receita.foto.url }}" alt="">
{% endif %}
</div>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion djangoreceitas/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static

print(include('apps.receitas.urls'))

urlpatterns = [
path('', include('apps.receitas.urls')),
path('admin/', admin.site.urls),
]
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

0 comments on commit 348567b

Please sign in to comment.