Skip to content

Commit

Permalink
local meeting
Browse files Browse the repository at this point in the history
  • Loading branch information
damian-garrido committed Jun 6, 2017
1 parent 060cde8 commit 845c4a8
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 7 deletions.
8 changes: 5 additions & 3 deletions popular_proposal/forms/forms.py
Expand Up @@ -192,15 +192,17 @@ def __init__(self, *args, **kwargs):

class Meta:
model = PopularProposal
fields = ['background', 'contact_details', 'image', 'document', 'generated_at']
fields = ['background', 'contact_details', 'image', 'document', 'generated_at','is_local_meeting']
labels = {'background': _(u'Más antecedentes sobre tu propuesta.'),
'image': _(u'¿Tienes alguna imagen para compartir?'),
'document': _(u'¿Tienes algún documento para complementar tu propuesta?'),
'generated_at': _(u'¿En qué comuna se generó esta propuesta?'),
'contact_details': _(u'¿Cómo te puede contactar un candidato?')
'contact_details': _(u'¿Cómo te puede contactar un candidato?'),
'is_local_meeting': _(u'¿Esta propuesta se generó en un encuentro local?')
}
help_texts = {'background': _(u'Ejemplo: Durante el año 2011, existió una iniciativa de otra comunidad que no llegó a buen puerto.'),
'contact_details': _(u'Ejemplo: Tu teléfono o el lugar donde eres ubicable y en qué horario.')}
'contact_details': _(u'Ejemplo: Tu teléfono o el lugar donde eres ubicable y en qué horario.'),
'generated_at': _(u'Si eres una ONG de vocación nacional, esta opción no aplica')}


class CommentsForm(forms.Form):
Expand Down
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-06-06 15:19
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('popular_proposal', '0019_popularproposal_generated_at'),
]

operations = [
migrations.AddField(
model_name='popularproposal',
name='is_local_meeting',
field=models.BooleanField(default=False),
),
]
1 change: 1 addition & 0 deletions popular_proposal/models.py
Expand Up @@ -187,6 +187,7 @@ class PopularProposal(models.Model, OGPMixin):
related_name='proposals_generated_here',
null=True,
blank=True)
is_local_meeting = models.BooleanField(default=False)

ogp_enabled = True

Expand Down
1 change: 1 addition & 0 deletions popular_proposal/tests/popular_proposal_model_tests.py
Expand Up @@ -39,6 +39,7 @@ def test_instantiate_one(self):
self.assertFalse(popular_proposal.image)
self.assertEquals(popular_proposal.clasification, u'education')
self.assertFalse(popular_proposal.for_all_areas)
self.assertFalse(popular_proposal.is_local_meeting)

def test_popular_proposal_card_as_property(self):
popular_proposal = PopularProposal.objects.create(proposer=self.fiera,
Expand Down
16 changes: 12 additions & 4 deletions votai_general_theme/templates/popular_proposal/update.html
Expand Up @@ -6,15 +6,23 @@
{% load bootstrap3 %}

{% block main_content %}

<h2>{% blocktrans with popular_proposal=popular_proposal url=popular_proposal.get_absolute_url %}Agrega más información sobre <a href="{{url}}">{{popular_proposal}}</a>{% endblocktrans %}</h2>
<form action="{% url 'popular_proposals:citizen_update' slug=popular_proposal.slug %}" enctype="multipart/form-data" method="POST" role="form">
{% csrf_token %}
{% bootstrap_form form %}

{% bootstrap_field form.background %}
{% bootstrap_field form.contact_details %}
{% bootstrap_field form.image %}
{% bootstrap_field form.document %}

<h3 class="page-header">Información extra</h3>
<p>Esta información nos permitirá tener un mejor entendimiento de cómo cuándo y dónde se formulan las propuestas.</p>

{% bootstrap_field form.is_local_meeting %}
{% bootstrap_field form.generated_at %}

<div class="form-actions">
<button type="submit" class="btn btn-success">{% trans 'Actualiza tu propuesta'%}</button>
</div>
</form>


{% endblock main_content %}

0 comments on commit 845c4a8

Please sign in to comment.