-
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 #269 from nossas/feature/dashboard-others-informat…
…ions feat(votepeloclima): included others informations session on dashboard
- Loading branch information
Showing
4 changed files
with
95 additions
and
6 deletions.
There are no files selected for viewing
7 changes: 5 additions & 2 deletions
7
app/org_eleicoes/votepeloclima/candidature/static/js/copy-to-clipboard.js
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{% extends "votepeloclima/base.html" %} | ||
{% load crispy_forms_filters %} | ||
{% load static crispy_forms_filters social_share %} | ||
|
||
{% block content %} | ||
<div class="container mx-auto py-5"> | ||
|
@@ -70,6 +70,55 @@ <h2 class="accordion-header"> | |
</div> | ||
{% endfor %} | ||
</div> | ||
<hr class="hr my-4"/> | ||
<section class="py-5"> | ||
<div class="container"> | ||
<div class="grid gap-5"> | ||
<div class="g-col-12 g-col-md-8"> | ||
<div class="d-flex flex-column justify-content-between h-100"> | ||
<div> | ||
<h2 class="fw-bold text-uppercase">Outras informações</h2> | ||
<p class="w-75">Compartilhe seu perfil com eleitores e ajude a divulgar suas propostas. Para mais detalhes sobre o processo de verificação, acesse o link abaixo. Se precisar de suporte ou tiver dúvidas, entre em contato conosco. Se preferir remover seu perfil e dados da plataforma, você pode excluir seu cadastro a qualquer momento.</p> | ||
<div class="d-flex"> | ||
<p> | ||
<a href="mailto:[email protected]" target="_blank" rel="noopener noreferrer" class="me-3">Contato</a> | ||
<a href="{% static 'docs/aviso-de-privacidade-candidaturas.pdf' %}" target="_blank" rel="noopener noreferrer">Política de privacidade</a> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% if is_public and candidature %} | ||
<div class="g-col-12 g-col-md-4"> | ||
<p class="fw-bold text-uppercase">Compartilhe seu perfil:</p> | ||
<div class="d-flex flex-column justify-content-center gap-2"> | ||
{% with request.scheme|add:"://"|add:request.get_host as base_url %} | ||
<a class="btn btn-primary text-uppercase d-inline-flex justify-content-center align-items-center gap-1" href="{% share_url base_url candidature.slug 'whatsapp' %}"> | ||
<span class="ds-icon-whatsapp"></span> | ||
</a> | ||
<a class="btn btn-primary text-uppercase d-inline-flex justify-content-center align-items-center gap-1" href="{% share_url base_url candidature.slug 'twitter' %}" target="_blank"> | ||
<span class="ds-icon-x"></span> | ||
</a> | ||
<a class="btn btn-primary text-uppercase d-inline-flex justify-content-center align-items-center gap-1" href="{% share_url base_url candidature.slug 'linkedin' %}" target="_blank"> | ||
<span class="ds-icon-linkedin"></span> | ||
</a> | ||
<a class="btn btn-primary text-uppercase d-inline-flex justify-content-center align-items-center gap-1" href="{% share_url base_url candidature.slug 'facebook' %}" target="_blank"> | ||
<span class="ds-icon-facebook"></span> | ||
</a> | ||
<button type="button" id="copyButton" onclick="copyURL('{{ base_url }}/c/{{ candidature.slug }}')" class="btn btn-primary text-uppercase d-inline-flex justify-content-center align-items-center gap-1" data-bs-toggle="tooltip" data-bs-trigger="click" data-bs-placement="bottom" title="Copiado!"> | ||
<span class="ds-icon-anchor"></span> | ||
Copiar Link | ||
</button> | ||
{% endwith %} | ||
</div> | ||
</div> | ||
{% endif %} | ||
</div> | ||
</section> | ||
<!-- <div class="mt-4" style="max-width:868px;"> | ||
<h3 class="text-dark fw-bold text-uppercase">Outras informações</h3> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam lacinia iaculis arcu, sed ornare risus congue nec. Phasellus rhoncus, tortor in fermentum auctor, diam risus pulvinar nisi, ac ultrices nibh ipsum at lacus. Mauris varius metus in ante viverra faucibus. Vivamus fringilla metus urna, sit amet.</p> | ||
|
@@ -81,3 +130,7 @@ <h3 class="text-dark fw-bold text-uppercase">Outras informações</h3> | |
</div> --> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block footer_js %} | ||
<script src="{% static 'js/copy-to-clipboard.js' %}" type="text/javascript"></script> | ||
{% endblock %} |
32 changes: 32 additions & 0 deletions
32
app/org_eleicoes/votepeloclima/candidature/templatetags/social_share.py
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,32 @@ | ||
from django import template | ||
from urllib.parse import urlencode | ||
|
||
register = template.Library() | ||
|
||
@register.simple_tag | ||
def share_url(base_url, slug, platform): | ||
url = f"{base_url}/c/{slug}" | ||
|
||
if platform == 'whatsapp': | ||
text = ("Oi! As eleições estão chegando e o futuro da nossa cidade depende do nosso voto. " | ||
"Compartilho com você uma das candidaturas comprometidas na luta pelo meio ambiente e contra as ameaças climáticas. " | ||
"Conheça as propostas na plataforma *Vote pelo Clima!*") | ||
return f"https://wa.me/?text={urlencode({'text': text})}{url}" | ||
|
||
elif platform == 'twitter': | ||
text = ("O clima mudou. A política precisa mudar. #VotePeloClima é a plataforma que reúne candidaturas de todo o Brasil " | ||
"comprometidas com a pauta climática, eu sou uma delas! Acesse o perfil e conheça as propostas.") | ||
return f"https://twitter.com/intent/tweet?url={url}&{urlencode({'text': text})}" | ||
|
||
elif platform == 'linkedin': | ||
title = "O clima mudou. A política precisa mudar." | ||
summary = ("#VotePeloClima é a plataforma que reúne candidaturas de todo o Brasil comprometidas com a pauta climática, " | ||
"eu sou uma delas! Acesse o perfil e conheça as propostas.") | ||
return f"https://www.linkedin.com/shareArticle?mini=true&url={url}&{urlencode({'title': title, 'summary': summary})}" | ||
|
||
elif platform == 'facebook': | ||
quote = ("O clima mudou. A política precisa mudar. #VotePeloClima é a plataforma que reúne candidaturas de todo o Brasil " | ||
"comprometidas com a pauta climática, eu sou uma delas! Acesse o perfil e conheça as propostas.") | ||
return f"https://www.facebook.com/sharer/sharer.php?u={url}&{urlencode({'quote': quote})}" | ||
|
||
return url |
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