diff --git a/sapl/urls.py b/sapl/urls.py index f3c7cf3c9..749d4d0c6 100644 --- a/sapl/urls.py +++ b/sapl/urls.py @@ -32,6 +32,7 @@ from parlamentares.views import (cargo_mesa_crud, coligacao_crud, partido_crud, sessao_legislativa_crud, tipo_afastamento_crud, tipo_dependente_crud, tipo_militar_crud) +from sessao.urls import sessao_urls from sessao.views import (tipo_expediente_crud, tipo_resultado_votacao_crud, tipo_sessao_crud) @@ -41,7 +42,7 @@ urlpatterns = [ # main apps url(r'^comissoes/', include(comissoes_urls)), - url(r'^sessao/', include('sessao.urls')), + url(r'^sessao/', include(sessao_urls)), # SYSTEM DATA diff --git a/sessao/urls.py b/sessao/urls.py index 10dc9c8d2..581bc4a7b 100644 --- a/sessao/urls.py +++ b/sessao/urls.py @@ -1,15 +1,9 @@ -from django.conf.urls import patterns, url +from django.conf.urls import url -from sessao.views import (SessaoPlenariaCreateView, SessaoPlenariaDetailView, - SessaoPlenariaListView, SessaoPlenariaUpdateView) +from sessao.views import ExpedienteView, sessao_crud -urlpatterns = patterns( - 'sessao.views', - url(r'^$', SessaoPlenariaListView.as_view(), name='sessao_list'), - url(r'^(?P\d+)$', SessaoPlenariaDetailView.as_view(), - name='sessao_detail'), - url(r'^create$', SessaoPlenariaCreateView.as_view(), - name='sessao_create'), - url(r'^(?P\d+)/edit$', SessaoPlenariaUpdateView.as_view(), - name='sessao_update'), -) +urlpatterns = sessao_crud.urlpatterns + [ + url(r'^(?P\d+)/expediente$', + ExpedienteView.as_view(), name='expediente'), +] +sessao_urls = urlpatterns, sessao_crud.namespace, sessao_crud.namespace diff --git a/sessao/views.py b/sessao/views.py index bd14f57c5..7ab382f91 100644 --- a/sessao/views.py +++ b/sessao/views.py @@ -1,8 +1,4 @@ -from braces.views import FormMessagesMixin -from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ -from django.views.generic import (CreateView, DeleteView, DetailView, ListView, - UpdateView) from sapl.crud import build_crud @@ -87,34 +83,6 @@ registro_votacao_crud = build_crud( ) -class SessaoPlenariaListView(ListView): - model = SessaoPlenaria - - -class SessaoPlenariaDetailView(DetailView): - model = SessaoPlenaria - - -class SessaoPlenariaCreateView(CreateView): - model = SessaoPlenaria - # fields = [f.name for f in SessaoPlenaria._meta.fields] - form_invalid_message = u"Something went wrong, post was not saved" - - success_url = reverse_lazy('sessao_list') - - -class SessaoPlenariaUpdateView(FormMessagesMixin, UpdateView): - model = SessaoPlenaria - fields = [f.name for f in SessaoPlenaria._meta.fields] - - success_url = reverse_lazy('sessao_list') - - form_invalid_message = u"Something went wrong, post was not saved" - - def get_form_valid_message(self): - return u"{0} updated successfully!".format(self.object) - - -class SessaoPlenariaDeleteView(DeleteView): - model = SessaoPlenaria - success_url = reverse_lazy('sessao_list') +class ExpedienteView(sessao_crud.CrudDetailView): + template_name = 'sessao/expediente.html' + # TODO ... diff --git a/templates/sessao/expediente.html b/templates/sessao/expediente.html new file mode 100644 index 000000000..ccbbdd5e4 --- /dev/null +++ b/templates/sessao/expediente.html @@ -0,0 +1,6 @@ +{% extends "sessao/sessaoplenaria_detail.html" %} +{% load i18n %} + +{% block detail_content %} + TODO ... Expediente +{% endblock detail_content %} diff --git a/templates/sessao/sessaoplenaria_detail.html b/templates/sessao/sessaoplenaria_detail.html new file mode 100644 index 000000000..e14589865 --- /dev/null +++ b/templates/sessao/sessaoplenaria_detail.html @@ -0,0 +1,9 @@ +{% extends "crud/detail.html" %} +{% load i18n %} + +{% block sections_nav %} + +{% endblock sections_nav %} diff --git a/templates/sessao/sessaoplenaria_form.html b/templates/sessao/sessaoplenaria_form.html deleted file mode 100644 index 98ee815e5..000000000 --- a/templates/sessao/sessaoplenaria_form.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base.html" %} -{% load i18n crispy_forms_tags %} - -{% block title %}SAPL{% endblock %} - -{% block base_content %} - {% crispy form %} -{% endblock %} diff --git a/templates/sessao/sessaoplenaria_list.html b/templates/sessao/sessaoplenaria_list.html deleted file mode 100644 index 75f554618..000000000 --- a/templates/sessao/sessaoplenaria_list.html +++ /dev/null @@ -1,28 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block title %}SAPL{% endblock %} - -{% block base_content %} -

Sessão Plenária

- Incluir Sessão -
- - - - - - - - - - {% for sessao in object_list %} - - - - - {% endfor %} - -
{% trans 'Sessão Legislativa' %}{% trans 'Legislatura' %}{% trans 'Tipo' %}
{{ sessao.sessao_legislativa }}{{ sessao.legislatura }}{{ sessao.tipo }}
-{% endblock %} -