issue 207 add membershipSince, certificationDate membershipType
In certificates templates: - Add membershipSince instead of issued or now() - Add certificationDate instead of issued - get membershipType for put there in template
This commit is contained in:
parent
edaaca6ec4
commit
32ad6edd9d
|
@ -87,7 +87,7 @@
|
|||
<strong>CERTIFICA</strong><br />
|
||||
<ul>
|
||||
<li class="text-justify">
|
||||
Que l’entitat <b>{{ legalName }}</b>, amb NIF <b>{{ taxReference }}</b> i domicili a {{ streetAddress }} {{ postCode }} {{ city }} forma part com a entitat membre de {{ federation }} (ple dret/observadora) de <b>Lafede.cat - Federació d'Organitzacions per a la Justícia Global</b>, des de l’Assemblea General Ordinària celebrada el {{ issue_date }}
|
||||
Que l’entitat <b>{{ legalName }}</b>, amb NIF <b>{{ taxReference }}</b> i domicili a {{ streetAddress }} {{ postCode }} {{ city }} forma part com a entitat membre de {{ federation }} {% if membership_type == "full" %}ple dret{% endif %}{% if membership_type == "observer" %}observadora{% endif %} de <b>Lafede.cat - Federació d'Organitzacions per a la Justícia Global</b>, des de l’Assemblea General Ordinària celebrada el {{ membership_since }}
|
||||
</li>
|
||||
</ul>
|
||||
<br />
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
<strong>CERTIFICA</strong><br />
|
||||
<ul>
|
||||
<li class="text-justify">
|
||||
Que la entidad <b>{{ legalName }}</b>, con NIF <b>{{ taxReference }}</b> y domicilio {{ streetAddress }} {{ postCode }} {{ city }} forma parte como entidad miembro de {{ federation }} (pleno derecho/observadora) de <b>Lafede.cat - Federación de Organizaciones para la Justícia Global</b>, desde la Asamblea General Ordinaria celebrada el {{ issue_date }}
|
||||
Que la entidad <b>{{ legalName }}</b>, con NIF <b>{{ taxReference }}</b> y domicilio {{ streetAddress }} {{ postCode }} {{ city }} forma parte como entidad miembro de {{ federation }} {% if membership_type == "full" %}pleno derecho{% endif %}{% if membership_type == "observer" %}observadora{% endif %} de <b>Lafede.cat - Federación de Organizaciones para la Justícia Global</b>, desde la Asamblea General Ordinaria celebrada el {{ membership_since }}
|
||||
</li>
|
||||
</ul>
|
||||
<br />
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import json
|
||||
import base64
|
||||
import qrcode
|
||||
import datetime
|
||||
import weasyprint
|
||||
import qrcode.image.svg
|
||||
|
||||
|
@ -282,21 +281,23 @@ class CredentialPdfView(MyWallet, TemplateView):
|
|||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context.update(dict(self.object.get_datas()))
|
||||
img_sig = self.get_img_sign()
|
||||
img_head = self.get_img_header()
|
||||
img_foot = self.get_img_footer()
|
||||
qr = self.generate_qr_code(self.url_id)
|
||||
issue_date_now = datetime.datetime.now()
|
||||
issue_date = context.get('issuedDate', issue_date_now)
|
||||
issue_date = context.get('certificationDate', '')
|
||||
membership_since = context.get('membershipSince', '')
|
||||
membership_type = context.get('membershipType', '').lower()
|
||||
|
||||
context.update(dict(self.object.get_datas()))
|
||||
context.update({
|
||||
'object': self.object,
|
||||
"image_signature": img_sig,
|
||||
"image_header": img_head,
|
||||
"image_footer": img_foot,
|
||||
"issue_date_now": issue_date_now.strftime("%d/%m/%Y"),
|
||||
"issue_date": issue_date.strftime("%d/%m/%Y"),
|
||||
"issue_date": issue_date,
|
||||
"membership_since": membership_since,
|
||||
"membership_type": membership_type,
|
||||
"qr": qr,
|
||||
})
|
||||
return context
|
||||
|
|
Loading…
Reference in New Issue