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
c73e9710
Commit
c73e9710
authored
Jul 03, 2025
by
Eduardo Silva
Browse files
atualizacao das tags de icone e das imagens de assinatura
parent
6e7547a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
dsgov/templatetags/br_footer_tags.py
View file @
c73e9710
...
...
@@ -188,15 +188,25 @@ class SocialSectionNode(template.Node):
self
.
nodelist
.
render
(
context
)
# HTML dos ícones e imagens
social_links_html
=
''
.
join
([
format_html
(
'<a class="br-button circle" href="{}" aria-label="{}"><i class="fab {}" aria-hidden="true"></i></a>'
,
link
[
'href'
],
link
[
'aria_label'
],
link
[
'icone'
]
)
for
link
in
social_links
])
assign_images_html
=
''
.
join
([
format_html
(
'<img class="ml-4" src="{}" alt="{}"/>'
,
img
[
'src'
],
img
[
'alt'
]
)
for
img
in
assign_images
])
social_links_html
=
''
.
join
([
format_html
(
'<a class="br-button circle" href="{}" aria-label="{}">'
'<i class="fab {} {}" aria-hidden="true"></i></a>'
,
link
[
'href'
],
link
[
'aria_label'
],
link
[
'icone'
],
link
.
get
(
'extra_classes'
,
''
)
)
for
link
in
social_links
])
assign_images_html
=
''
.
join
([
format_html
(
'<a href="{}"><img class="ml-4" src="{}" alt="{}"/></a>'
,
img
[
'href'
],
img
[
'src'
],
img
[
'alt'
]
)
if
img
.
get
(
'href'
)
else
format_html
(
'<img class="ml-4" src="{}" alt="{}"/>'
,
img
[
'src'
],
img
[
'alt'
]
)
for
img
in
assign_images
])
return
format_html
(
'''<div class="d-none d-sm-block">
...
...
@@ -216,15 +226,15 @@ class SocialSectionNode(template.Node):
)
@
register
.
simple_tag
(
takes_context
=
True
)
def
br_footer_rede_social
(
context
,
href
,
icone
,
aria_label
):
# Esta tag
agora não retorna HTML,
apenas adiciona dados à lista.
context
[
'social_links'
].
append
({
'href'
:
href
,
'icone'
:
icone
,
'aria_label'
:
aria_label
})
def
br_footer_rede_social
(
context
,
href
,
icone
,
aria_label
,
extra_classes
=
''
):
# Esta tag apenas adiciona dados à lista.
context
[
'social_links'
].
append
({
'href'
:
href
,
'icone'
:
icone
,
'aria_label'
:
aria_label
,
'extra_classes'
:
extra_classes
})
return
''
@
register
.
simple_tag
(
takes_context
=
True
)
def
br_footer_imagem
(
context
,
src
,
alt
):
# Esta tag
agora não retorna HTML,
apenas adiciona dados à lista.
context
[
'assign_images'
].
append
({
'src'
:
src
,
'alt'
:
alt
})
def
br_footer_imagem
(
context
,
src
,
alt
,
href
=
None
):
# Esta tag apenas adiciona dados à lista.
context
[
'assign_images'
].
append
({
'src'
:
src
,
'alt'
:
alt
,
'href'
:
href
})
return
''
@
register
.
tag
(
name
=
'br_footer_copyright'
)
...
...
tests/django_dsgov_test1/templates/examples_footer.html
View file @
c73e9710
...
...
@@ -81,13 +81,13 @@
{# Seção de Redes Sociais que organiza suas próprias colunas e linhas #}
{% br_footer_social_section title="Nossas Redes" %}
{% br_footer_rede_social href="#" icone="fa-facebook-f" aria_label="Facebook" %}
{% br_footer_rede_social href="#" icone="fa-twitter" aria_label="Twitter" %}
{% br_footer_rede_social href="#" icone="fa-linkedin-in" aria_label="LinkedIn" %}
{% br_footer_rede_social href="#" icone="fa-whatsapp" aria_label="WhatsApp" %}
{% br_footer_rede_social href="#" icone="fa-facebook-f" aria_label="Facebook"
extra_classes=""
%}
{% br_footer_rede_social href="#" icone="fa-twitter" aria_label="Twitter"
extra_classes=""
%}
{% br_footer_rede_social href="#" icone="fa-linkedin-in" aria_label="LinkedIn"
extra_classes=""
%}
{% br_footer_rede_social href="#" icone="fa-whatsapp" aria_label="WhatsApp"
extra_classes=""
%}
{% br_footer_imagem src="https://cdngovbr-ds.estaleiro.serpro.gov.br/design-system/images/logo-assign-negative.png" alt="Logo 1" %}
{% br_footer_imagem src="https://cdngovbr-ds.estaleiro.serpro.gov.br/design-system/images/logo-assign-negative.png" alt="Logo 2" %}
{% br_footer_imagem src="https://cdngovbr-ds.estaleiro.serpro.gov.br/design-system/images/logo-assign-negative.png" alt="Logo 1"
href=""
%}
{% br_footer_imagem src="https://cdngovbr-ds.estaleiro.serpro.gov.br/design-system/images/logo-assign-negative.png" alt="Logo 2"
href=""
%}
{% end_br_footer_social_section %}
{% end_br_footer_main %}
...
...
@@ -172,13 +172,13 @@
{# Seção de Redes Sociais que organiza suas próprias colunas e linhas #}
{% br_footer_social_section title="Nossas Redes" %}
{% br_footer_rede_social href="#" icone="fa-facebook-f" aria_label="Facebook" %}
{% br_footer_rede_social href="#" icone="fa-twitter" aria_label="Twitter" %}
{% br_footer_rede_social href="#" icone="fa-linkedin-in" aria_label="LinkedIn" %}
{% br_footer_rede_social href="#" icone="fa-whatsapp" aria_label="WhatsApp" %}
{% br_footer_rede_social href="#" icone="fa-facebook-f" aria_label="Facebook"
extra_classes=""
%}
{% br_footer_rede_social href="#" icone="fa-twitter" aria_label="Twitter"
extra_classes=""
%}
{% br_footer_rede_social href="#" icone="fa-linkedin-in" aria_label="LinkedIn"
extra_classes=""
%}
{% br_footer_rede_social href="#" icone="fa-whatsapp" aria_label="WhatsApp"
extra_classes=""
%}
{% br_footer_imagem src="https://cdngovbr-ds.estaleiro.serpro.gov.br/design-system/images/logo-assign-positive.png" alt="Logo 1" %}
{% br_footer_imagem src="https://cdngovbr-ds.estaleiro.serpro.gov.br/design-system/images/logo-assign-positive.png" alt="Logo 2" %}
{% br_footer_imagem src="https://cdngovbr-ds.estaleiro.serpro.gov.br/design-system/images/logo-assign-positive.png" alt="Logo 1"
href=""
%}
{% br_footer_imagem src="https://cdngovbr-ds.estaleiro.serpro.gov.br/design-system/images/logo-assign-positive.png" alt="Logo 2"
href=""
%}
{% end_br_footer_social_section %}
{% end_br_footer_main %}
...
...
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