Commit 4b9437b1 authored by Lucas Gueiros's avatar Lucas Gueiros
Browse files

Merge branch '4-criacao-do-componente-br_card' into 'master'

Resolve "Criacao do componente br_card"

Closes #4

See merge request !5
parents 2b426157 9513dd38
{% extends "dsgov/base.html" %}
{% load br_components %}
{% load static %}
{% block content %}
<div class="br-card hover" style="cursor: pointer;">
<div class="card-content">
<div class="d-flex align-items-center">
{% if icon_svg %}
<img src="{% static icon_svg %}" alt="ícone" width="40" height="40" class="mr-3"/>
{% endif %}
<div>
<h4 class="mt-0 mb-1 text-primary" style="font-family: 'Noto Sans', sans-serif;">{{ title }}</h4>
<p style="font-family: 'Noto Sans', sans-serif; color: #5C5C5C;">{{ text }}</p>
</div>
</div>
</div>
</div>
{% endblock %}
from django import template
from django.utils.html import format_html, mark_safe
from django.utils.html import format_html
from django.templatetags.static import static
from django.template.loader import render_to_string
......@@ -168,3 +168,13 @@ def br_pagination(pages=""):
}
return render_to_string('dsgov/components/pagination.html', context)
@register.simple_tag
def br_card(title='', text='', icon_path=None):
context = {
'title': title,
'text': text,
'icon_svg': icon_path
}
return render_to_string('dsgov/components/card_with_icon.html', context)
......@@ -78,4 +78,5 @@ urlpatterns = [
path("breadcrumb/", TemplateView.as_view(template_name = 'examples_breadcrumb.html'), name="breadcrumb"),
path("pagination/", TemplateView.as_view(template_name = 'examples_pagination.html'), name="pagination"),
path("tag/", TemplateView.as_view(template_name = 'examples_tag.html'), name="tag"),
path("cards/", TemplateView.as_view(template_name = 'examples_card_with_icon.html'), name="cards"),
]
{% extends "dsgov/base.html" %}
{% load br_components %}
{% load static %}
{% block title %}
Exemplo de Cards com Ícones
{% endblock %}
{% block content %}
<div class="flex flex-col mb-6">
<div class="row mt-6">
<div class="row mb-6">
<div class="col-md-4 mb-4">
{% br_card title=title text=text icon_path=icon_path %}
</div>
</div>
</div>
</div>
{% endblock %}
......@@ -114,6 +114,16 @@
</div>
</div>
</div>
<div class="br-item" role="listitem">
<div class="row align-items-center">
<div class="col-auto">
<i class="fa-solid fa-sitemap" aria-hidden="true"></i>
</div>
<div class="col">
<a href="{% url 'cards' %}">Exemplos de Cards com Ícones</a>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment