-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from leonardocintra/template-novo
feat: outros tipos de produtos parte 1 #92
- Loading branch information
Showing
19 changed files
with
176 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.0.4 on 2022-05-02 15:09 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('catalogo', '0065_rename_categoria_tipoproduto_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='tipoproduto', | ||
name='descricao', | ||
field=models.TextField(default='Descrição não informada'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from django import template | ||
from django.templatetags.static import static | ||
from catalogo.models import TipoProduto | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.simple_tag(name='imagem_tipo_produto') | ||
def imagem_tipo_produto(tipo_produto_id=1): | ||
# para incluir a imagem aqui precisa adicionar manualmente na pasta core/static/img | ||
tipos_produto = TipoProduto.get_tipos_produto_ativo() | ||
imagem = tipos_produto.filter(id=tipo_produto_id).first() | ||
return static('img/' + imagem.icone_fontawesome + '.gif') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{% load static %} | ||
{% load catalogo_extras %} | ||
|
||
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Sofia"> | ||
<style> | ||
.nossoProduto { | ||
font-family: "Sofia", sans-serif;icone_fontawesome | ||
} | ||
</style> | ||
|
||
<div class="container"> | ||
<h1 class="text-center nossoProduto">Nossos produtos</h1> | ||
|
||
<div class="row row-cols-1 row-cols-md-2 g-4"> | ||
{% for tipo in tipos_produto %} | ||
<div class="col"> | ||
<div class="card mb-3" style="max-width: 540px;"> | ||
<div class="row g-0"> | ||
<div class="col-md-4"> | ||
<img src="{% imagem_tipo_produto tipo.id %}" class="img-fluid rounded-start" alt="{{ tipo.icone_fontawesome }}"> | ||
</div> | ||
<div class="col-md-8"> | ||
<div class="card-body"> | ||
<h5 class="card-title">{{ tipo }}</h5> | ||
<p class="card-text">{{ tipo.descricao }}</p> | ||
<a href="#" class="stretched-link">Mais detalhes</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters