|
@ -13,8 +13,8 @@ from sapl.base.models import AppConfig as AppsAppConfig |
|
|
from sapl.crud.base import (RP_DETAIL, RP_LIST, Crud, |
|
|
from sapl.crud.base import (RP_DETAIL, RP_LIST, Crud, |
|
|
CrudAux, MasterDetailCrud, |
|
|
CrudAux, MasterDetailCrud, |
|
|
PermissionRequiredForAppCrudMixin) |
|
|
PermissionRequiredForAppCrudMixin) |
|
|
from sapl.comissoes.forms import (ComissaoForm, DocumentoAcessorioCreateForm, |
|
|
from sapl.comissoes.forms import (ComissaoForm,ComposicaoForm, DocumentoAcessorioCreateForm, |
|
|
DocumentoAcessorioEditForm, ParticipacaoCreateForm, |
|
|
DocumentoAcessorioEditForm, ParticipacaoCreateForm, |
|
|
ParticipacaoEditForm, ReuniaoForm) |
|
|
ParticipacaoEditForm, ReuniaoForm) |
|
|
from sapl.materia.models import MateriaLegislativa, Tramitacao |
|
|
from sapl.materia.models import MateriaLegislativa, Tramitacao |
|
|
|
|
|
|
|
@ -81,6 +81,10 @@ class ComposicaoCrud(MasterDetailCrud): |
|
|
model_set = 'participacao_set' |
|
|
model_set = 'participacao_set' |
|
|
public = [RP_LIST, RP_DETAIL, ] |
|
|
public = [RP_LIST, RP_DETAIL, ] |
|
|
|
|
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
|
|
form_class = ComposicaoForm |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ListView(MasterDetailCrud.ListView): |
|
|
class ListView(MasterDetailCrud.ListView): |
|
|
template_name = "comissoes/composicao_list.html" |
|
|
template_name = "comissoes/composicao_list.html" |
|
|
paginate_by = None |
|
|
paginate_by = None |
|
@ -176,7 +180,7 @@ class ReuniaoCrud(MasterDetailCrud): |
|
|
context = super().get_context_data(**kwargs) |
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
|
|
|
reuniao_pk = self.take_reuniao_pk() |
|
|
reuniao_pk = self.take_reuniao_pk() |
|
|
|
|
|
|
|
|
if reuniao_pk == 0: |
|
|
if reuniao_pk == 0: |
|
|
ultima_reuniao = list(context['reuniao_list']) |
|
|
ultima_reuniao = list(context['reuniao_list']) |
|
|
if len(ultima_reuniao) > 0: |
|
|
if len(ultima_reuniao) > 0: |
|
@ -235,4 +239,4 @@ class DocumentoAcessorioCrud(MasterDetailCrud): |
|
|
obj.delete() |
|
|
obj.delete() |
|
|
return HttpResponseRedirect( |
|
|
return HttpResponseRedirect( |
|
|
reverse('sapl.comissoes:reuniao_detail', |
|
|
reverse('sapl.comissoes:reuniao_detail', |
|
|
kwargs={'pk': obj.reuniao.pk})) |
|
|
kwargs={'pk': obj.reuniao.pk})) |
|
|