mirror of https://github.com/interlegis/sapl.git
committed by
João Rodrigues
22 changed files with 255 additions and 91 deletions
@ -0,0 +1 @@ |
|||
default_app_config = 'sapl.sdr.apps.AppConfig' |
|||
@ -1,20 +1,39 @@ |
|||
import logging |
|||
|
|||
from django import forms |
|||
from django.forms import ModelForm |
|||
from django.utils.translation import ugettext_lazy as _ |
|||
|
|||
from sapl.videoconf.models import Videoconferencia |
|||
from sapl.sdr.models import DeliberacaoRemota |
|||
|
|||
|
|||
class VideoconferenciaForm(ModelForm): |
|||
|
|||
class DeliberacaoRemotaCreateForm(ModelForm): |
|||
logger = logging.getLogger(__name__) |
|||
|
|||
class Meta: |
|||
model = Videoconferencia |
|||
fields = ['chat_id', 'descricao'] |
|||
model = DeliberacaoRemota |
|||
exclude = [] |
|||
|
|||
widgets = { |
|||
'created_by': forms.HiddenInput(), |
|||
'descricao': forms.Textarea(attrs={'id': 'texto-rico'}) |
|||
} |
|||
|
|||
def clean(self): |
|||
cleaned_data = super().clean() |
|||
import ipdb; ipdb.set_trace() |
|||
if not self.is_valid(): |
|||
return self.cleaned_data |
|||
|
|||
return cleaned_data |
|||
|
|||
# class DeliberacaoRemotaForm(ModelForm): |
|||
# |
|||
# logger = logging.getLogger(__name__) |
|||
# |
|||
# class Meta: |
|||
# model = DeliberacaoRemota |
|||
# fields = ['chat_id', 'descricao'] |
|||
# class AutoriaNormaForm(ModelForm): |
|||
# |
|||
# tipo_autor = ModelChoiceField(label=_('Tipo Autor'), |
|||
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-03-31 21:50 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('sessao', '0050_auto_20191029_1441'), |
|||
('sdr', '0001_initial'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='videoconferencia', |
|||
name='sessao_plenaria', |
|||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='sessao.SessaoPlenaria', verbose_name='Sessão Plenária'), |
|||
), |
|||
] |
|||
@ -0,0 +1,19 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-03-31 22:26 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('sdr', '0002_videoconferencia_sessao_plenaria'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RenameModel( |
|||
old_name='Videoconferencia', |
|||
new_name='SistemaDeliberacaoRemota', |
|||
), |
|||
] |
|||
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-03-31 22:33 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('sdr', '0003_auto_20200331_1926'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RenameModel( |
|||
old_name='SistemaDeliberacaoRemota', |
|||
new_name='DeliberacaoRemota', |
|||
), |
|||
migrations.AlterModelOptions( |
|||
name='deliberacaoremota', |
|||
options={'ordering': ['chat_id', 'descricao'], 'verbose_name': 'Deliberação Remota', 'verbose_name_plural': 'Deliberações Remotas'}, |
|||
), |
|||
] |
|||
@ -0,0 +1,13 @@ |
|||
|
|||
from .apps import AppConfig |
|||
from .views import ChatView, DeliberacaoRemotaCrud |
|||
from django.conf.urls import include, url |
|||
|
|||
app_name = AppConfig.name |
|||
|
|||
urlpatterns = [ |
|||
url(r'^sdr/chat/(?P<pk>[0-9]+)$', |
|||
ChatView.as_view(), name='chat-session'), |
|||
url(r'^sdr/', |
|||
include(DeliberacaoRemotaCrud.get_urls()), name='deliberacaoremota'), |
|||
] |
|||
@ -0,0 +1,80 @@ |
|||
{% extends "crud/detail.html" %} |
|||
{% load i18n common_tags %} |
|||
{% load render_bundle from webpack_loader %} |
|||
|
|||
{% block title%} |
|||
<h2 class="page-header">Sistema de Deliberação Remota (SDR)</h2> |
|||
{% endblock %} |
|||
|
|||
{% block base_content %}{{block.super}} |
|||
<div id="content"> |
|||
<h3>Título: {{ object.titulo }}<br/></h3> |
|||
<h3>Descrição: {{ object.descricao }}<br/></h3> |
|||
<h5>ID: {{ object.chat_id }}</h5><br/> |
|||
{% if is_parlamentar %} |
|||
<h4>Parlamentar: {{ parlamentar.nome_parlamentar }}</h4> |
|||
{% else %} |
|||
<h4>Nome: {{ nome_usuario }}</h4> |
|||
{% endif %} |
|||
|
|||
</div> |
|||
<div class="container"> |
|||
<div id="meet" class="col-md"></div> |
|||
<div id="painel" class="col-md"> |
|||
<h3>Dados Básicos</h3> |
|||
Sessão: {{ sessao_plenaria }} <br/> |
|||
Data Início: {{ sessao_plenaria.data_inicio }} <br/> |
|||
Hora Início: {{ sessao_plenaria.hora_inicio }} <br/> |
|||
Iniciada: {{ sessao_plenaria.iniciada|yesno:"Sim,Não" }} <br/> |
|||
<br/> |
|||
<br/> |
|||
<!-- TODO: pegar de REST WS --> |
|||
<div class="row"> |
|||
<div class="sm-5" style="margin-right:60px"> |
|||
<h3>Presença Sessão Plenária</h3> |
|||
<ul> |
|||
{% for p in sessao_plenaria.sessaoplenariapresenca_set.all %} |
|||
<li>{{p.parlamentar}}</li> |
|||
{% endfor %} |
|||
</ul> |
|||
</div> |
|||
<div class="sm-5" style="margin-right:60px"> |
|||
<h3>Presentes Ordem do Dia:</h3> |
|||
<ul> |
|||
{% for p in sessao_plenaria.presencaordemdia_set.all %} |
|||
<li>{{p.parlamentar}}</li> |
|||
{% endfor %} |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{% endblock base_content %} |
|||
|
|||
{% block extra_js %} |
|||
{{block.super}} |
|||
<script src='https://meet.jit.si/external_api.js'></script> |
|||
<script language="Javascript"> |
|||
api = undefined; |
|||
$(document).ready(function() { |
|||
const domain = 'jitsih.interlegis.leg.br'; |
|||
const options= { |
|||
roomName: '{{object.chat_id}}', |
|||
width: 700, |
|||
height: 700, |
|||
parentNode: document.querySelector('#meet'), |
|||
interfaceConfigOverwrite: {TOOLBAR_BUTTONS: ['hangup','microphone', 'camera']} |
|||
}; |
|||
api = new JitsiMeetExternalAPI(domain, options); |
|||
api.executeCommand('displayName', '{{nome_usuario}}'); |
|||
api.executeCommand('toggleTileView'); |
|||
api.executeCommand('subject', '{{object.titulo}}'); |
|||
// api.executeCommand('password', '12345'); |
|||
//api.executeCommand('toggleChat'); |
|||
|
|||
api.on('readyToClose', () => { |
|||
console.log('Closed session'); |
|||
window.location.href = "{% url 'sapl.sdr:deliberacaoremota_list' %}"; |
|||
}); |
|||
}); |
|||
</script> |
|||
{% endblock extra_js %} |
|||
@ -0,0 +1,12 @@ |
|||
{% load i18n %} |
|||
|
|||
DeliberacaoRemota: |
|||
{% trans 'Deliberação Remota' %}: |
|||
- titulo finalizada |
|||
- descricao |
|||
|
|||
DeliberacaoRemotaCreate: |
|||
{% trans 'Deliberação Remota' %}: |
|||
- created_by |
|||
- titulo finalizada |
|||
- descricao |
|||
@ -1,6 +0,0 @@ |
|||
{% load i18n %} |
|||
|
|||
Videoconferencia: |
|||
{% trans 'Videoconferência' %}: |
|||
- titulo finalizada |
|||
- descricao |
|||
@ -1,43 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<script src="https://code.jquery.com/jquery-3.4.1.min.js" |
|||
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" |
|||
crossorigin="anonymous"></script> |
|||
<script src='https://meet.jit.si/external_api.js'></script> |
|||
<script language="Javascript"> |
|||
api = undefined; |
|||
$(document).ready(function() { |
|||
const domain = 'jitsih.interlegis.leg.br'; |
|||
const options= { |
|||
roomName: '{{object.chat_id}}', |
|||
width: 700, |
|||
height: 700, |
|||
parentNode: document.querySelector('#meet'), |
|||
interfaceConfigOverwrite: {TOOLBAR_BUTTONS: ['hangup','microphone', 'camera']} |
|||
}; |
|||
api = new JitsiMeetExternalAPI(domain, options); |
|||
api.executeCommand('displayName', '{{nome}}'); |
|||
// api.executeCommand('password', '12345'); |
|||
api.executeCommand('toggleTileView'); |
|||
//api.executeCommand('toggleChat'); |
|||
api.executeCommand('subject', '{{object.titulo}}'); |
|||
|
|||
api.on('readyToClose', () => { |
|||
console.log('Closed session'); |
|||
window.location.href = "{% url 'sapl.videoconf:videoconferencia_list' %}"; |
|||
}); |
|||
}); |
|||
</script> |
|||
<title>Videoconferência</title> |
|||
</head> |
|||
<body> |
|||
<div id="content"> |
|||
<h3>Título: {{ object.titulo }}<br/></h3> |
|||
<h3>Descrição: {{ object.descricao }}<br/></h3> |
|||
<strong>ID: </strong>{{ object.chat_id }}<br/> |
|||
</div> |
|||
<div id="meet"></div> |
|||
</body> |
|||
</html> |
|||
@ -1 +0,0 @@ |
|||
default_app_config = 'sapl.videoconf.apps.AppConfig' |
|||
@ -1,13 +0,0 @@ |
|||
|
|||
from .apps import AppConfig |
|||
from .views import ChatView, VideoConferenciaCrud |
|||
from django.conf.urls import include, url |
|||
|
|||
app_name = AppConfig.name |
|||
|
|||
urlpatterns = [ |
|||
url(r'^videoconferencia/chat/(?P<pk>[0-9]+)$', |
|||
ChatView.as_view(), name='chat-session'), |
|||
url(r'^videoconferencia/', |
|||
include(VideoConferenciaCrud.get_urls()), name='videoconferencia'), |
|||
] |
|||
Loading…
Reference in new issue