Commit 0672913f authored by Carolina's avatar Carolina

BASE_URL is included as a new ENV variable, so it can be used on pug templates #13

parent b31d5b39
Pipeline #7902 passed with stages
in 13 minutes and 44 seconds
......@@ -82,6 +82,8 @@ To deploy this project, you need to configure settings in your environment
* GOOGLE_ANALYTICS_CODE: The code for google analytics
* GOOGLE_MAPS_TOKEN: Api key for access to service from google maps
* GOOGLE_TAG_MANAGER: Google tag manager ID
* RECAPTCHA_PUBLIC_KEY: public Key for recaptcha service
* RECAPTCHA_PRIVATE_KEY: private key for recaptcha service
......@@ -95,6 +97,8 @@ To deploy this project, you need to configure settings in your environment
* COMPRESS_OFFLINE: if 'True', uses pre compiled static assets
* COMPRESS_ENABLED: if 'True', enables compiled static assets
* BASE_URL: Domain site URL (this must include ending backslash)
* ROLLBAR_ACCESS_TOKEN
* CHILE_ATIENDE_ACCESS_TOKEN
* CLAVE_UNICA_CALLBACK: The url that clave única will call on login
......
......@@ -8,7 +8,7 @@ footer.footer(class="{% if footer_class %}{{footer_class}}{% else %}mt-5{% endif
.col-4.col-sm-3.logo-col
img.logo(src="{% static 'img/logo-minecon.svg' %}", width='120', alt='Logo Minecon')
.col-8.col-sm-9.pt-2
a.super-gob-cl-es-una(href='https://super.digital.gob.cl/que-es-chileatiende?skin=exterior') super.gob.cl
a.super-gob-cl-es-una(href='{{base_url}}') super.gob.cl
| es una idea del
br
| Ministerio de Economía,
......@@ -18,17 +18,17 @@ footer.footer(class="{% if footer_class %}{{footer_class}}{% else %}mt-5{% endif
.col-sm-6.col-lg-3.mb-4.mb-sm-0
ul.p-3.footer-links
li
a(href='https://super.gob.cl/que-es-super', target='_blank') Sobre SUPER
a(href='{{base_url}}que-es-super', target='_blank') Sobre SUPER
li
a(href='https://super.gob.cl/contacto', target='_blank') Contacto
a(href='{{base_url}}contacto', target='_blank') Contacto
li
a(href='https://super.gob.cl/gps', target='_blank') Ir a sitio GPS
a(href='{{base_url}}gps', target='_blank') Ir a sitio GPS
.col-sm-6.col-lg-3
ul.p-3.footer-links
li
a(href='https://super.gob.cl/preguntas-frecuentes', target='_blank') Preguntas frecuentes
a(href='{{base_url}}preguntas-frecuentes', target='_blank') Preguntas frecuentes
li
a(href='https://super.gob.cl/instituciones', target='_blank')
a(href='{{base_url}}instituciones', target='_blank')
| Instituciones que publican
br
|
......
......@@ -4,7 +4,7 @@
nav.navbar.navbar-dark.navbar-expand-lg.fixed-top.bg-tertiary.px-3
.container
a.navbar-brand(href="/")
a.navbar-brand(href="{{base_url}}")
img(
src="{% static 'img/logo-super.svg' %}",
alt="Logo SUPER"
......
......@@ -42,7 +42,7 @@ if permit_requests
.col-sm-4
.d-flex.justify-content-between.align-items-center
a.btn.btn-outline-primary(
href='{{permit.permit.permalink}}'
href='{{base_url}}fichas/{{permit.id}}'
target='_blank'
)
small
......
......@@ -258,13 +258,3 @@ class Permit(BaseModel):
print("-- Problema de conexión en página " + str(iteration) + ". Reintento... n°" + str(intentos))
if intentos > 5:
quit()
def get_super_url(self):
"""
Returns the url from SUPER corresponding to this permit
"""
return urllib.parse.urljoin(
settings.SUPER_PAGES_URL,
str(self.permit_id)
)
......@@ -64,7 +64,7 @@ block content
small #[b TRÁMITE PRESENCIAL]
if object.permalink
a.btn.btn-block.btn-outline-primary(
href='{{object.get_super_url}}',
href='{{base_url}}fichas/{{object.id}}',
)
small #[b VER GUÍA PERMISO]
else
......
......@@ -20,3 +20,6 @@ def google_maps_token(request):
'google_maps_token': settings.GOOGLE_MAPS_TOKEN,
'site': Site.objects.get_current(),
}
def base_url(request):
return {'base_url': settings.BASE_URL}
......@@ -70,7 +70,4 @@ DGD_EMAIL_CLIENT_ID = os.getenv('DGD_EMAIL_CLIENT_ID', '')
DGD_EMAIL_CLIENT_SECRET = os.getenv('DGD_EMAIL_CLIENT_SECRET', '')
DGD_EMAIL_TOKEN_APP = os.getenv('DGD_EMAIL_TOKEN_APP', '')
SUPER_PAGES_URL = os.getenv(
'SUPER_PAGES_URL',
'https://super.gob.cl/fichas/'
)
BASE_URL = os.getenv('BASE_URL', 'https://test.super.gob.cl/')
......@@ -268,6 +268,7 @@ TEMPLATES = [
'project.context_processors.google_analytics_code',
'project.context_processors.google_tag_manager_code',
'project.context_processors.google_maps_token',
'project.context_processors.base_url',
],
'loaders': [
('pypugjs.ext.django.Loader', (
......@@ -568,11 +569,7 @@ CMS_TEMPLATES = [
CMS_PERMISSION = True
SUPER_PAGES_URL = get_local_value(
'SUPER_PAGES_URL',
'https://super.digital.gob.cl/fichas/'
)
BASE_URL = get_local_value('BASE_URL', '')
# CLAVE UNICA
CLAVE_UNICA_CALLBACK = get_local_value('CLAVE_UNICA_CALLBACK', '')
CLAVE_UNICA_CLIENT_ID = get_local_value('CLAVE_UNICA_CLIENT_ID', '')
......
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