Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
django-dsgov
Commits
4b9437b1
Commit
4b9437b1
authored
Jun 05, 2025
by
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
Changes
5
Show whitespace changes
Inline
Side-by-side
dsgov/templates/dsgov/components/card_with_icon.html
0 → 100644
View file @
4b9437b1
{% 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 %}
dsgov/templatetags/br_components.py
View file @
4b9437b1
from
django
import
template
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.templatetags.static
import
static
from
django.template.loader
import
render_to_string
from
django.template.loader
import
render_to_string
...
@@ -168,3 +168,13 @@ def br_pagination(pages=""):
...
@@ -168,3 +168,13 @@ def br_pagination(pages=""):
}
}
return
render_to_string
(
'dsgov/components/pagination.html'
,
context
)
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
)
tests/django_dsgov_test1/django_dsgov_test1/urls.py
View file @
4b9437b1
...
@@ -78,4 +78,5 @@ urlpatterns = [
...
@@ -78,4 +78,5 @@ urlpatterns = [
path
(
"breadcrumb/"
,
TemplateView
.
as_view
(
template_name
=
'examples_breadcrumb.html'
),
name
=
"breadcrumb"
),
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
(
"pagination/"
,
TemplateView
.
as_view
(
template_name
=
'examples_pagination.html'
),
name
=
"pagination"
),
path
(
"tag/"
,
TemplateView
.
as_view
(
template_name
=
'examples_tag.html'
),
name
=
"tag"
),
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"
),
]
]
tests/django_dsgov_test1/templates/examples_card_with_icon.html
0 → 100644
View file @
4b9437b1
{% 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 %}
tests/django_dsgov_test1/templates/index.html
View file @
4b9437b1
...
@@ -114,6 +114,16 @@
...
@@ -114,6 +114,16 @@
</div>
</div>
</div>
</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>
</div>
</div>
{% endblock %}
{% endblock %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment