Skip to content

Commit

Permalink
Merge pull request #142 from nossas/feat/candidate-list-title-descrip…
Browse files Browse the repository at this point in the history
…tion

Feat: Adiciona logo no footer e edição de título e descrição de Listagem de Candidaturas
  • Loading branch information
miguelzinh3 authored Nov 23, 2023
2 parents c4b2be3 + 8925b99 commit 8323445
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/eleicao/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def render(self, context, instance, placeholder):
del form.fields["uf"]
del form.fields["city"]


ctx["form"] = form

page_number = request.GET.get("page", 1)
Expand All @@ -114,6 +113,8 @@ def render(self, context, instance, placeholder):
ctx["is_paginated"] = p.count > 1
ctx["page_obj"] = page_obj
ctx["object_list"] = page_obj.object_list

ctx.update({"title": instance.title, "description": instance.description})

return ctx

Expand Down
23 changes: 23 additions & 0 deletions app/eleicao/migrations/0019_auto_20231123_0544.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2 on 2023-11-23 05:44

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('eleicao', '0018_eleicaocandidatelist'),
]

operations = [
migrations.AddField(
model_name='eleicaocandidatelist',
name='description',
field=models.CharField(blank=True, max_length=120, null=True, verbose_name='Descrição'),
),
migrations.AddField(
model_name='eleicaocandidatelist',
name='title',
field=models.CharField(blank=True, max_length=120, null=True, verbose_name='Título'),
),
]
2 changes: 2 additions & 0 deletions app/eleicao/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ class Meta:


class EleicaoCandidateList(CMSPlugin):
title = models.CharField("Título", max_length=120, blank=True, null=True)
description = models.CharField("Descrição", max_length=120, blank=True, null=True)
city = models.CharField("Cidade", max_length=120, blank=True, null=True)
state = models.CharField("Estado", max_length=2, blank=True, null=True, choices=lazy(get_states, list)())

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/eleicao/templates/eleicao/plugins/candidate_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<main class="container mx-auto candidate-list">
<section class="list-header">
<div class="px-5 py-20 text-center text-[#1842AC]">
<h1 class="mb-3 text-4xl md:text-6xl">Conheça as candidaturas</h1>
<p class="m-auto max-w-xl text-lg">As candidatas e candidatos abaixo assumiram o compromisso com o Estatuto da Criança e do Adolescente ao se cadastrar na plataforma.<p>
<h1 class="mb-3 text-4xl md:text-6xl">{{ title }}</h1>
<p class="m-auto max-w-xl text-lg">{{ description }}<p>
</div>
</section>

Expand Down
2 changes: 2 additions & 0 deletions app/eleicao/templates/eleicao/plugins/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ <h3 class="text-3xl text-center text-blue-800">Realização</h3>
alt="Alana" />
<img class="object-cover mx-auto w-44 md:w-32" src="{% static 'images/eleicao/vladimir-herzog.png' %}"
alt="Vladimir Herzog" />
<img class="object-cover mx-auto w-44 md:w-32" src="{% static 'images/eleicao/teia-de-criadores.png' %}"
alt="Teia de Criadores" />
<img class="object-cover mx-auto w-44 md:w-32" src="{% static 'images/eleicao/minha-manaus.png' %}"
alt="Minha Manaus" />
<img class="object-cover mx-auto w-44 md:w-32" src="{% static 'images/eleicao/minha-bh.png' %}"
Expand Down
1 change: 1 addition & 0 deletions app/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ psycopg2-binary
django-select2
django-formtools
django-recaptcha
captcha
# Django CMS
django-cms
djangocms-text-ckeditor
Expand Down

0 comments on commit 8323445

Please sign in to comment.