Browse Source

Merge pull request #1531 from interlegis/470-ajustar-links-ajuda

Fix #470 ajustar links ajuda
pull/1537/head
Eliseu Egewarth 7 years ago
committed by GitHub
parent
commit
58346b8e58
  1. 4
      sapl/base/views.py
  2. 2
      sapl/comissoes/views.py
  3. 18
      sapl/crud/base.py
  4. 4
      sapl/crud/tests/stub_app/views.py
  5. 24
      sapl/materia/views.py
  6. 4
      sapl/norma/views.py
  7. 12
      sapl/parlamentares/views.py
  8. 8
      sapl/protocoloadm/views.py
  9. 8
      sapl/sessao/views.py
  10. 2
      sapl/templates/ajuda.html
  11. 4
      sapl/templates/base.html

4
sapl/base/views.py

@ -54,7 +54,7 @@ class ConfirmarEmailView(TemplateView):
class TipoAutorCrud(CrudAux): class TipoAutorCrud(CrudAux):
model = TipoAutor model = TipoAutor
help_path = 'tipo-autor' help_topic = 'tipo-autor'
class BaseMixin(CrudAux.BaseMixin): class BaseMixin(CrudAux.BaseMixin):
list_field_names = ['descricao', 'content_type'] list_field_names = ['descricao', 'content_type']
@ -63,7 +63,7 @@ class TipoAutorCrud(CrudAux):
class AutorCrud(CrudAux): class AutorCrud(CrudAux):
model = Autor model = Autor
help_path = 'autor' help_topic = 'autor'
class BaseMixin(CrudAux.BaseMixin): class BaseMixin(CrudAux.BaseMixin):
list_field_names = ['tipo', 'nome', 'user'] list_field_names = ['tipo', 'nome', 'user']

2
sapl/comissoes/views.py

@ -78,7 +78,7 @@ class ComposicaoCrud(MasterDetailCrud):
class ComissaoCrud(Crud): class ComissaoCrud(Crud):
model = Comissao model = Comissao
help_path = 'modulo_comissoes' help_topic = 'modulo_comissoes'
public = [RP_LIST, RP_DETAIL, ] public = [RP_LIST, RP_DETAIL, ]
class BaseMixin(Crud.BaseMixin): class BaseMixin(Crud.BaseMixin):

18
sapl/crud/base.py

@ -81,7 +81,7 @@ def make_pagination(index, num_pages):
""" """
variáveis do crud: variáveis do crud:
help_path help_topic
container_field container_field
container_field_set container_field_set
is_m2m is_m2m
@ -865,7 +865,7 @@ class Crud:
DetailView = CrudDetailView DetailView = CrudDetailView
UpdateView = CrudUpdateView UpdateView = CrudUpdateView
DeleteView = CrudDeleteView DeleteView = CrudDeleteView
help_path = '' help_topic = ''
class PublicMixin: class PublicMixin:
permission_required = [] permission_required = []
@ -877,7 +877,7 @@ class Crud:
if view: if view:
class CrudViewWithBase(cls.BaseMixin, view): class CrudViewWithBase(cls.BaseMixin, view):
model = cls.model model = cls.model
help_path = cls.help_path help_topic = cls.help_topic
crud = cls crud = cls
CrudViewWithBase.__name__ = view.__name__ CrudViewWithBase.__name__ = view.__name__
return CrudViewWithBase return CrudViewWithBase
@ -909,13 +909,13 @@ class Crud:
for regex, view, suffix in cruds] for regex, view, suffix in cruds]
@classonlymethod @classonlymethod
def build(cls, _model, _help_path, _model_set=None, list_field_names=[]): def build(cls, _model, _help_topic, _model_set=None, list_field_names=[]):
def create_class(_list_field_names): def create_class(_list_field_names):
class ModelCrud(cls): class ModelCrud(cls):
model = _model model = _model
model_set = _model_set model_set = _model_set
help_path = _help_path help_topic = _help_topic
list_field_names = _list_field_names list_field_names = _list_field_names
return ModelCrud return ModelCrud
@ -950,10 +950,10 @@ class CrudAux(Crud):
return context return context
@classonlymethod @classonlymethod
def build(cls, _model, _help_path, _model_set=None, list_field_names=[]): def build(cls, _model, _help_topic, _model_set=None, list_field_names=[]):
ModelCrud = Crud.build( ModelCrud = Crud.build(
_model, _help_path, _model_set, list_field_names) _model, _help_topic, _model_set, list_field_names)
class ModelCrudAux(CrudAux, ModelCrud): class ModelCrudAux(CrudAux, ModelCrud):
pass pass
@ -1405,10 +1405,10 @@ class MasterDetailCrud(Crud):
return '' return ''
@classonlymethod @classonlymethod
def build(cls, model, parent_field, help_path, def build(cls, model, parent_field, help_topic,
_model_set=None, list_field_names=[]): _model_set=None, list_field_names=[]):
crud = super(MasterDetailCrud, cls).build( crud = super(MasterDetailCrud, cls).build(
model, help_path, _model_set=_model_set, model, help_topic, _model_set=_model_set,
list_field_names=list_field_names) list_field_names=list_field_names)
crud.parent_field = parent_field crud.parent_field = parent_field
return crud return crud

4
sapl/crud/tests/stub_app/views.py

@ -6,7 +6,7 @@ from .models import City, Country
class CountryCrud(Crud): class CountryCrud(Crud):
model = Country model = Country
help_path = 'help_path', help_topic = 'help_topic',
class ListView(CrudListView): class ListView(CrudListView):
paginate_by = 10 paginate_by = 10
@ -14,4 +14,4 @@ class CountryCrud(Crud):
class CityCrud(MasterDetailCrud): class CityCrud(MasterDetailCrud):
model = City model = City
help_path = 'help_path', help_topic = 'help_topic',

24
sapl/materia/views.py

@ -525,7 +525,7 @@ class ConfirmarProposicao(PermissionRequiredForAppCrudMixin, UpdateView):
class UnidadeTramitacaoCrud(CrudAux): class UnidadeTramitacaoCrud(CrudAux):
model = UnidadeTramitacao model = UnidadeTramitacao
help_path = 'unidade_tramitacao' help_topic = 'unidade_tramitacao'
class BaseMixin(Crud.BaseMixin): class BaseMixin(Crud.BaseMixin):
list_field_names = ['comissao', 'orgao', 'parlamentar'] list_field_names = ['comissao', 'orgao', 'parlamentar']
@ -551,7 +551,7 @@ class UnidadeTramitacaoCrud(CrudAux):
class ProposicaoCrud(Crud): class ProposicaoCrud(Crud):
model = Proposicao model = Proposicao
help_path = '' help_topic = 'proposicao'
container_field = 'autor__user' container_field = 'autor__user'
class BaseMixin(Crud.BaseMixin): class BaseMixin(Crud.BaseMixin):
@ -838,7 +838,7 @@ class ReciboProposicaoView(TemplateView):
class RelatoriaCrud(MasterDetailCrud): class RelatoriaCrud(MasterDetailCrud):
model = Relatoria model = Relatoria
parent_field = 'materia' parent_field = 'materia'
help_path = '' help_topic = 'tramitacao_relatoria'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class CreateView(MasterDetailCrud.CreateView): class CreateView(MasterDetailCrud.CreateView):
@ -913,7 +913,7 @@ class RelatoriaCrud(MasterDetailCrud):
class TramitacaoCrud(MasterDetailCrud): class TramitacaoCrud(MasterDetailCrud):
model = Tramitacao model = Tramitacao
parent_field = 'materia' parent_field = 'materia'
help_path = '' help_topic = 'tramitacao_relatoria'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class BaseMixin(MasterDetailCrud.BaseMixin): class BaseMixin(MasterDetailCrud.BaseMixin):
@ -1058,7 +1058,7 @@ def montar_helper_documento_acessorio(self):
class DocumentoAcessorioCrud(MasterDetailCrud): class DocumentoAcessorioCrud(MasterDetailCrud):
model = DocumentoAcessorio model = DocumentoAcessorio
parent_field = 'materia' parent_field = 'materia'
help_path = '' help_topic = 'despacho_autoria'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class BaseMixin(MasterDetailCrud.BaseMixin): class BaseMixin(MasterDetailCrud.BaseMixin):
@ -1094,7 +1094,7 @@ class DocumentoAcessorioCrud(MasterDetailCrud):
class AutoriaCrud(MasterDetailCrud): class AutoriaCrud(MasterDetailCrud):
model = Autoria model = Autoria
parent_field = 'materia' parent_field = 'materia'
help_path = '' help_topic = 'despacho_autoria'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
list_field_names = ['autor', 'autor__tipo__descricao', 'primeiro_autor'] list_field_names = ['autor', 'autor__tipo__descricao', 'primeiro_autor']
@ -1169,7 +1169,7 @@ class AutoriaMultiCreateView(PermissionRequiredForAppCrudMixin, FormView):
class DespachoInicialCrud(MasterDetailCrud): class DespachoInicialCrud(MasterDetailCrud):
model = DespachoInicial model = DespachoInicial
parent_field = 'materia' parent_field = 'materia'
help_path = '' help_topic = 'despacho_autoria'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class CreateView(MasterDetailCrud.CreateView): class CreateView(MasterDetailCrud.CreateView):
@ -1182,7 +1182,7 @@ class DespachoInicialCrud(MasterDetailCrud):
class LegislacaoCitadaCrud(MasterDetailCrud): class LegislacaoCitadaCrud(MasterDetailCrud):
model = LegislacaoCitada model = LegislacaoCitada
parent_field = 'materia' parent_field = 'materia'
help_path = '' help_topic = 'legislacao_cita_matanexada'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class BaseMixin(MasterDetailCrud.BaseMixin): class BaseMixin(MasterDetailCrud.BaseMixin):
@ -1267,14 +1267,14 @@ class LegislacaoCitadaCrud(MasterDetailCrud):
class NumeracaoCrud(MasterDetailCrud): class NumeracaoCrud(MasterDetailCrud):
model = Numeracao model = Numeracao
parent_field = 'materia' parent_field = 'materia'
help_path = '' help_topic = 'numeracao_docsacess'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class AnexadaCrud(MasterDetailCrud): class AnexadaCrud(MasterDetailCrud):
model = Anexada model = Anexada
parent_field = 'materia_principal' parent_field = 'materia_principal'
help_path = '' help_topic = 'materia_anexada'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class BaseMixin(MasterDetailCrud.BaseMixin): class BaseMixin(MasterDetailCrud.BaseMixin):
@ -1302,7 +1302,7 @@ class AnexadaCrud(MasterDetailCrud):
class MateriaAssuntoCrud(MasterDetailCrud): class MateriaAssuntoCrud(MasterDetailCrud):
model = MateriaAssunto model = MateriaAssunto
parent_field = 'materia' parent_field = 'materia'
help_path = '' help_topic = ''
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class BaseMixin(MasterDetailCrud.BaseMixin): class BaseMixin(MasterDetailCrud.BaseMixin):
@ -1326,7 +1326,7 @@ class MateriaAssuntoCrud(MasterDetailCrud):
class MateriaLegislativaCrud(Crud): class MateriaLegislativaCrud(Crud):
model = MateriaLegislativa model = MateriaLegislativa
help_path = 'materia_legislativa' help_topic = 'materia_legislativa'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class BaseMixin(Crud.BaseMixin): class BaseMixin(Crud.BaseMixin):

4
sapl/norma/views.py

@ -33,7 +33,7 @@ TipoVinculoNormaJuridicaCrud = CrudAux.build(
class NormaRelacionadaCrud(MasterDetailCrud): class NormaRelacionadaCrud(MasterDetailCrud):
model = NormaRelacionada model = NormaRelacionada
parent_field = 'norma_principal' parent_field = 'norma_principal'
help_path = '' help_topic = 'norma_juridica'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class BaseMixin(MasterDetailCrud.BaseMixin): class BaseMixin(MasterDetailCrud.BaseMixin):
@ -123,7 +123,7 @@ class NormaTaView(IntegracaoTaView):
class NormaCrud(Crud): class NormaCrud(Crud):
model = NormaJuridica model = NormaJuridica
help_path = 'norma_juridica' help_topic = 'norma_juridica'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class BaseMixin(Crud.BaseMixin): class BaseMixin(Crud.BaseMixin):

12
sapl/parlamentares/views.py

@ -89,7 +89,7 @@ class FrenteList(MasterDetailCrud):
class RelatoriaParlamentarCrud(CrudBaseForListAndDetailExternalAppView): class RelatoriaParlamentarCrud(CrudBaseForListAndDetailExternalAppView):
model = Relatoria model = Relatoria
parent_field = 'parlamentar' parent_field = 'parlamentar'
help_path = 'relatoria_parlamentar' help_topic = 'tramitacao_relatoria'
namespace = AppConfig.name namespace = AppConfig.name
class BaseMixin(CrudBaseForListAndDetailExternalAppView.BaseMixin): class BaseMixin(CrudBaseForListAndDetailExternalAppView.BaseMixin):
@ -181,7 +181,7 @@ class ParticipacaoParlamentarCrud(CrudBaseForListAndDetailExternalAppView):
class ColigacaoCrud(CrudAux): class ColigacaoCrud(CrudAux):
model = Coligacao model = Coligacao
help_path = 'tabelas_auxiliares#coligacao' help_topic = 'coligacao'
class ListView(CrudAux.ListView): class ListView(CrudAux.ListView):
ordering = ('-numero_votos', 'nome') ordering = ('-numero_votos', 'nome')
@ -272,7 +272,7 @@ def parlamentares_frente_selected(request):
class FrenteCrud(CrudAux): class FrenteCrud(CrudAux):
model = Frente model = Frente
help_path = 'tabelas_auxiliares#tipo_situa_militar' help_topic = 'tipo_situa_militar'
list_field_names = ['nome', 'data_criacao', 'parlamentares'] list_field_names = ['nome', 'data_criacao', 'parlamentares']
class CreateView(CrudAux.CreateView): class CreateView(CrudAux.CreateView):
@ -337,7 +337,7 @@ class MandatoCrud(MasterDetailCrud):
class ComposicaoColigacaoCrud(MasterDetailCrud): class ComposicaoColigacaoCrud(MasterDetailCrud):
model = ComposicaoColigacao model = ComposicaoColigacao
parent_field = 'coligacao' parent_field = 'coligacao'
help_path = '' help_topic = 'coligacao'
class BaseMixin(MasterDetailCrud.BaseMixin): class BaseMixin(MasterDetailCrud.BaseMixin):
@ -353,7 +353,7 @@ class ComposicaoColigacaoCrud(MasterDetailCrud):
class LegislaturaCrud(CrudAux): class LegislaturaCrud(CrudAux):
model = Legislatura model = Legislatura
help_path = 'tabelas_auxiliares#legislatura' help_topic = 'legislatura'
class CreateView(CrudAux.CreateView): class CreateView(CrudAux.CreateView):
form_class = LegislaturaForm form_class = LegislaturaForm
@ -391,7 +391,7 @@ class LegislaturaCrud(CrudAux):
class FiliacaoCrud(MasterDetailCrud): class FiliacaoCrud(MasterDetailCrud):
model = Filiacao model = Filiacao
parent_field = 'parlamentar' parent_field = 'parlamentar'
help_path = '' help_topic = 'filiacoes_partidarias'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class BaseMixin(MasterDetailCrud.BaseMixin): class BaseMixin(MasterDetailCrud.BaseMixin):

8
sapl/protocoloadm/views.py

@ -84,7 +84,7 @@ class DocumentoAdministrativoMixin:
class DocumentoAdministrativoCrud(Crud): class DocumentoAdministrativoCrud(Crud):
model = DocumentoAdministrativo model = DocumentoAdministrativo
help_path = '' help_topic = 'numeracao_docsacess'
class BaseMixin(Crud.BaseMixin): class BaseMixin(Crud.BaseMixin):
list_field_names = ['tipo', 'numero', 'ano', 'data', list_field_names = ['tipo', 'numero', 'ano', 'data',
@ -142,7 +142,7 @@ class DocumentoAdministrativoCrud(Crud):
class StatusTramitacaoAdministrativoCrud(CrudAux): class StatusTramitacaoAdministrativoCrud(CrudAux):
model = StatusTramitacaoAdministrativo model = StatusTramitacaoAdministrativo
help_path = '' help_topic = 'status_tramitacao'
class BaseMixin(CrudAux.BaseMixin): class BaseMixin(CrudAux.BaseMixin):
list_field_names = ['sigla', 'indicador', 'descricao'] list_field_names = ['sigla', 'indicador', 'descricao']
@ -577,7 +577,7 @@ class PesquisarDocumentoAdministrativoView(DocumentoAdministrativoMixin,
class TramitacaoAdmCrud(MasterDetailCrud): class TramitacaoAdmCrud(MasterDetailCrud):
model = TramitacaoAdministrativo model = TramitacaoAdministrativo
parent_field = 'documento' parent_field = 'documento'
help_path = '' help_topic = 'unidade_tramitacao'
class BaseMixin(MasterDetailCrud.BaseMixin): class BaseMixin(MasterDetailCrud.BaseMixin):
list_field_names = ['data_tramitacao', 'unidade_tramitacao_local', list_field_names = ['data_tramitacao', 'unidade_tramitacao_local',
@ -656,7 +656,7 @@ class TramitacaoAdmCrud(MasterDetailCrud):
class DocumentoAcessorioAdministrativoCrud(MasterDetailCrud): class DocumentoAcessorioAdministrativoCrud(MasterDetailCrud):
model = DocumentoAcessorioAdministrativo model = DocumentoAcessorioAdministrativo
parent_field = 'documento' parent_field = 'documento'
help_path = '' help_topic = 'numeracao_docsacess'
class BaseMixin(MasterDetailCrud.BaseMixin): class BaseMixin(MasterDetailCrud.BaseMixin):
list_field_names = ['nome', 'tipo', list_field_names = ['nome', 'tipo',

8
sapl/sessao/views.py

@ -203,7 +203,7 @@ def get_presencas_generic(model, sessao, legislatura):
class MateriaOrdemDiaCrud(MasterDetailCrud): class MateriaOrdemDiaCrud(MasterDetailCrud):
model = OrdemDia model = OrdemDia
parent_field = 'sessao_plenaria' parent_field = 'sessao_plenaria'
help_path = '' help_topic = 'sessao_plenaria_materias_ordem_dia'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class BaseMixin(MasterDetailCrud.BaseMixin): class BaseMixin(MasterDetailCrud.BaseMixin):
@ -358,7 +358,7 @@ def recuperar_materia(request):
class ExpedienteMateriaCrud(MasterDetailCrud): class ExpedienteMateriaCrud(MasterDetailCrud):
model = ExpedienteMateria model = ExpedienteMateria
parent_field = 'sessao_plenaria' parent_field = 'sessao_plenaria'
help_path = '' help_topic = 'sessao_plenaria_materia_expediente'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class BaseMixin(MasterDetailCrud.BaseMixin): class BaseMixin(MasterDetailCrud.BaseMixin):
@ -504,7 +504,7 @@ class ExpedienteMateriaCrud(MasterDetailCrud):
class OradorCrud(MasterDetailCrud): class OradorCrud(MasterDetailCrud):
model = '' model = ''
parent_field = 'sessao_plenaria' parent_field = 'sessao_plenaria'
help_path = '' help_topic = 'sessao_plenaria_oradores'
public = [RP_LIST, RP_DETAIL] public = [RP_LIST, RP_DETAIL]
class ListView(MasterDetailCrud.ListView): class ListView(MasterDetailCrud.ListView):
@ -571,7 +571,7 @@ def sessao_legislativa_legislatura_ajax(request):
class SessaoCrud(Crud): class SessaoCrud(Crud):
model = SessaoPlenaria model = SessaoPlenaria
help_path = 'sessao_plenaria' help_topic = 'sessao_legislativa'
public = [RP_DETAIL] public = [RP_DETAIL]
class BaseMixin(Crud.BaseMixin): class BaseMixin(Crud.BaseMixin):

2
sapl/templates/ajuda.html

@ -96,7 +96,7 @@
<li><a href="{% url 'sapl.base:help_topic' 'tramitacao_relatoria' %}">Para inclusão de Tramitação, acione a função "Tramitação"</a></li> <li><a href="{% url 'sapl.base:help_topic' 'tramitacao_relatoria' %}">Para inclusão de Tramitação, acione a função "Tramitação"</a></li>
<li><a href="{% url 'sapl.base:help_topic' 'tramitacao_relatoria' %}">Para inclusão da Relatoria, acione a função "Relatoria"</a></li> <li><a href="{% url 'sapl.base:help_topic' 'tramitacao_relatoria' %}">Para inclusão da Relatoria, acione a função "Relatoria"</a></li>
<li><a href="{% url 'sapl.base:help_topic' 'numeracao_docsacess' %}">Para inclusão de Numeração, acione a função "Numeração"</a></li> <li><a href="{% url 'sapl.base:help_topic' 'numeracao_docsacess' %}">Para inclusão de Numeração, acione a função "Numeração"</a></li>
<li><a href="{% url 'sapl.base:help_topic' 'despacho_autoria' %}">Para inclusão de Documentos Acessórios, acione a função "Documentos Acessórios"</a></li> <li><a href="{% url 'sapl.base:help_topic' 'numeracao_docsacess' %}">Para inclusão de Documentos Acessórios, acione a função "Documentos Acessórios"</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>

4
sapl/templates/base.html

@ -135,8 +135,8 @@
<div class="clearfix"> <div class="clearfix">
{% block help %} {% block help %}
{# {% if view.help_path %}#} {# {% if view.help_topic %}#}
{# <a class="contextual-help right" href="{% url 'sapl.base:help_base' %}{{ view.help_path }}">{% trans 'Ajuda' %}</a>#} {# <a class="contextual-help right" href="{% url 'sapl.base:help' %}{{ view.help_topic }}">{% trans 'Ajuda' %}</a>#}
{# {% endif %}#} {# {% endif %}#}
{% endblock %} {% endblock %}

Loading…
Cancel
Save