diff --git a/sessao/views.py b/sessao/views.py index 1a173c0af..78268356a 100644 --- a/sessao/views.py +++ b/sessao/views.py @@ -1,3 +1,5 @@ +from crispy_forms.helper import FormHelper +from crispy_forms.layout import Layout, Fieldset, Submit, ButtonHolder from django.utils.translation import ugettext_lazy as _ from extra_views import InlineFormSetView from sapl.crud import build_crud @@ -81,11 +83,29 @@ registro_votacao_crud = build_crud( class ExpedienteView(InlineFormSetView): - model = SessaoPlenaria inline_model = ExpedienteSessao template_name = 'sessao/expediente.html' + fields = ('tipo', 'conteudo') + can_delete = False extra = 1 +# import ipdb; ipdb.set_trace() + + + def get_context_data(self, **kwargs): + context = super(ExpedienteView, self).get_context_data(**kwargs) + + self.helper = FormHelper() + self.helper.layout = Layout( + Fieldset( + 'tipo', + 'conteudo' + ) + ) + context.update({'helper': self.helper}) + +# import ipdb; ipdb.set_trace() + return context class PresencaView(InlineFormSetView): diff --git a/templates/sessao/expediente.html b/templates/sessao/expediente.html index abf072ce4..e52279f5f 100644 --- a/templates/sessao/expediente.html +++ b/templates/sessao/expediente.html @@ -1,12 +1,15 @@ {% extends "sessao/sessaoplenaria_detail.html" %} {% load i18n %} +{% load crispy_forms_tags %} {% block detail_content %}
{% endblock detail_content %} diff --git a/templates/sessao/presenca.html b/templates/sessao/presenca.html index f838f4e19..f17f7791f 100644 --- a/templates/sessao/presenca.html +++ b/templates/sessao/presenca.html @@ -13,7 +13,7 @@