Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
5075e87
feat(init): Commit inicial
jorsilman Nov 20, 2022
09d4d31
feat(init): Commit inicial
jorsilman Nov 20, 2022
f468a22
IC: Integración Continua
jorsilman Nov 22, 2022
94ef480
IC: Integración Continua
jorsilman Nov 22, 2022
abd0303
IC: Integracion Continua
jorsilman Nov 22, 2022
898109f
IC: Integracion Continua
jorsilman Nov 22, 2022
d743620
IC: Integracion Continua
jorsilman Nov 22, 2022
1a440a1
feat:Definición(administración Votación Sí/No
Nov 22, 2022
fbf0c10
feat: Pintado de gráficas y estudio de datos
jorsilman Nov 22, 2022
a7d3d45
IC: Integración Continua
jorsilman Nov 23, 2022
6f75f97
IC: Integración continua
jorsilman Nov 23, 2022
d9ee8bb
IC: Integración continua
jorsilman Nov 23, 2022
7118629
IC: Integracion continua
jorsilman Nov 23, 2022
cb0d396
IC: Integracion Continua
jorsilman Nov 23, 2022
bc53bee
IC: Integracion Continua
jorsilman Nov 23, 2022
2066420
IC: Integracion Continua
jorsilman Nov 23, 2022
85b82dc
Merge pull request #10 from jorsilman/IntegracionContinua
jorsilman Nov 24, 2022
6223cd3
DC: Despliegue docker
jorsilman Nov 24, 2022
0f1cb5f
fix: Dependecia psycopg2
jorsilman Nov 24, 2022
5ef4317
Merge pull request #11 from jorsilman/jorsilman
jorsilman Nov 24, 2022
c78ae97
feat: Listado de censo , Exportación censo a formato csv , Exportació…
juanjesussevi Nov 24, 2022
7a6fa81
feat:Añadidas preguntas de si o no y votaciones de si o no
Nov 24, 2022
8cad841
fix:Arreglo de votacion de tipo binario
Nov 29, 2022
245233d
feat: 22, 23
manortgar Nov 29, 2022
e5ac6f1
fix:Corregido fallo que al votar en cualquier tipo de votación
Nov 29, 2022
fae7096
IC: Integración Continua
jorsilman Dec 6, 2022
8c0887e
test: Pintado de gráficas
jorsilman Dec 6, 2022
2c20004
Merge pull request #28 from jorsilman/visualizer
jorsilman Dec 6, 2022
978a336
Merge pull request #29 from jorsilman/develop
jorsilman Dec 6, 2022
60b3f78
test: Visualizacion y pintado de gráficas
jorsilman Dec 6, 2022
7fea2e4
Merge pull request #30 from jorsilman/visualizer
jorsilman Dec 6, 2022
2910948
Merge pull request #31 from jorsilman/develop
jorsilman Dec 6, 2022
7e7e9eb
fix:Arreglo al almacenar los votos de votaciones binarias
Dec 7, 2022
b533705
feat:Creado tally para votaciones binarias
Dec 7, 2022
dfcf9b3
test:Realizados test de votacion binaria
Dec 7, 2022
eb6b3b6
Merge pull request #33 from jorsilman/24-test-votación-binaria
jorsilman Dec 7, 2022
702f0fa
fix:Arreglo con las dependencias de migraciones
Dec 7, 2022
51d337c
feat: Visualización y pintado de gráficas
jorsilman Dec 8, 2022
b8e93a4
int: Visualizacion y pintado de gráficas - Votación SI NO
jorsilman Dec 10, 2022
93177e0
Merge pull request #34 from jorsilman/VisualizerVotacionSN
jorsilman Dec 10, 2022
3629784
git: Template commit
jorsilman Dec 10, 2022
6f53f5e
feat: Añandida pregunta de puntuación y votación de puntuación
Dec 11, 2022
1d5b3b8
DC: docker-compose
manortgar Dec 11, 2022
8d1b238
Merge branch 'develop-prueba-manuel' into manortgar
manortgar Dec 11, 2022
4cc1923
Merge pull request #37 from jorsilman/fracaralb
fracaralb Dec 12, 2022
b43feff
feat: Implementada votación de puntuación
Dec 12, 2022
7a0e408
Merge branch 'scorevoting' into fracaralb
fracaralb Dec 12, 2022
7ab5e1f
refactor : #22, #23
manortgar Dec 12, 2022
bc2885b
Fallo en la integración de votaciones binarias y de puntuación
Dec 12, 2022
328c25a
Merge branch 'juamarher7' into developJuan
juanjesussevi Dec 13, 2022
853fb98
Update views.py
juanjesussevi Dec 13, 2022
df62d0b
feat: Implementados los test
juanjesussevi Dec 13, 2022
4f6da53
int:Integración de los tipos de votaciones scoreVoting y binaryVoting…
Dec 14, 2022
3438af4
fix:Arreglado problema al intentar votar en una scoreVoting
Dec 14, 2022
2974ae1
test:Eliminados test de update voting
Dec 14, 2022
c0a8cc6
Integración de ScoreVoting con BinaryVoting en develop
alb-gallego Dec 14, 2022
5a47bc6
Realiza los test de scoreVoting
Dec 14, 2022
8f81716
test:Realiza los test de scoreVoting
alb-gallego Dec 14, 2022
c9b1120
Merge branch 'develop' into 24-test-votación-binaria
alb-gallego Dec 14, 2022
ea8c012
test:Eliminados test de update voting
alb-gallego Dec 14, 2022
26e57b0
Merge pull request #49 from jorsilman/VisualizerVotacionSN
jorsilman Dec 14, 2022
397cdf4
int: Integración visualización y pintado de gráficas y scorevoting #50
jorsilman Dec 14, 2022
c9f0850
test: Test visualizer score voting #51
jorsilman Dec 14, 2022
c0631df
feat: Creacion de buscador de votante en los censos
juanjesussevi Dec 14, 2022
8f13279
feat: Exportación a los diferentes tipos y se ha añadido css.
juanjesussevi Dec 14, 2022
d8cc805
Merge branch 'develop' into developJuan
juanjesussevi Dec 14, 2022
584fb7e
Merge branch 'juamarher7' into developJuan
juanjesussevi Dec 14, 2022
4e3b825
feat: Finalizado funcionalidad censo
manortgar Dec 14, 2022
c60dfa5
Merge pull request #55 from jorsilman/test-visualizer-scorevoting
jorsilman Dec 15, 2022
af05828
Merge branch 'manortgar' of https://github.com/jorsilman/decide-23 in…
manortgar Dec 15, 2022
123c245
config: Configura .gitignore y crea template para commit
jorsilman Dec 15, 2022
ea60ed1
feat: Integracion de ScoreVoting a censo #57
manortgar Dec 15, 2022
880026f
Merge pull request #58 from jorsilman/DEVELOPMANUELV3
manortgar Dec 15, 2022
5a52f3f
Merge pull request #59 from jorsilman/manortgar
manortgar Dec 15, 2022
0f94fad
DC: Despliegue Docker #60
jorsilman Dec 16, 2022
8007078
test: reuseCensustest
manortgar Dec 17, 2022
e73cc58
Merge branch 'manortgar' into develop
manortgar Dec 17, 2022
0a62a60
fix: recogida de datos del POST en reuseCensus
manortgar Dec 17, 2022
d486992
test: test ReuseCensus y CensusForAll terminados
manortgar Dec 17, 2022
f8b07c2
Merge pull request #62 from jorsilman/manortgar
manortgar Dec 17, 2022
f115af8
VA: Despliegue en Vagrant
jorsilman Dec 18, 2022
b8026fa
fix: Arregla test
jorsilman Dec 18, 2022
346fc0f
Merge pull request #64 from jorsilman/fix-tests
jorsilman Dec 18, 2022
1e8c368
fix: Arregla test
jorsilman Dec 18, 2022
d8d04cd
fix: Arregla test
jorsilman Dec 18, 2022
a4a1f3a
Merge pull request #66 from jorsilman/fix-tests
jorsilman Dec 18, 2022
b66c141
fix: Arregla test
jorsilman Dec 18, 2022
c798683
Merge pull request #67 from jorsilman/developDocker
jorsilman Dec 18, 2022
4be07ba
Merge pull request #68 from jorsilman/developVagrant
jorsilman Dec 18, 2022
7baa15c
Merge branch 'master' into develop
jorsilman Dec 18, 2022
3548aec
Delete local_settings.py
jorsilman Dec 18, 2022
dd4c6ba
Merge branch 'develop' of https://github.com/jorsilman/decide-23 into…
manortgar Dec 18, 2022
30ab86f
IC: Integración Continua
jorsilman Dec 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
name: Python application

on: [push]
on:
push:
branches:
- master
- develop
workflow_call:
secrets:
CODACY_PROJECT_TOKEN:
required: true

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
pyversion: ['3.8']
pgversion: ['10.8', '12']

services:
postgres:
image: postgres:10.8
image: postgres:${{matrix.pgversion}}
env:
POSTGRES_USER: decide
POSTGRES_PASSWORD: decide
Expand All @@ -21,10 +34,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python ${{matrix.pyversion}}
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{matrix.pyversion}}
- name: psycopg2 prerequisites
run: sudo apt-get install libpq-dev
- name: Install dependencies and config
Expand All @@ -46,4 +59,4 @@ jobs:
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: decide/coverage.xml
coverage-reports: decide/coverage.xml
21 changes: 21 additions & 0 deletions .github/workflows/first.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: release

on:
push:
tags:
- '*'

jobs:
buildTest:
uses: jorsilman/decide-23/.github/workflows/django.yml@master
secrets:
CODACY_PROJECT_TOKEN: ${{secrets.CODACY_PROJECT_TOKEN}}

release:
needs: buildTest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: softprops/action-gh-release@v1
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[![Build Status](https://travis-ci.com/wadobo/decide.svg?branch=master)](https://travis-ci.com/wadobo/decide) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/94a85eaa0e974c71af6899ea3b0d27e0)](https://www.codacy.com/app/Wadobo/decide?utm_source=github.com&utm_medium=referral&utm_content=wadobo/decide&utm_campaign=Badge_Grade) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/94a85eaa0e974c71af6899ea3b0d27e0)](https://www.codacy.com/app/Wadobo/decide?utm_source=github.com&utm_medium=referral&utm_content=wadobo/decide&utm_campaign=Badge_Coverage)
[![Build Status](https://travis-ci.com/wadobo/decide.svg?branch=master)](https://travis-ci.com/wadobo/decide)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cba8fd0874ac4f569f4f880e473cbac9?branch=master)](https://www.codacy.com/app/Wadobo/decide?utm_source=github.com&utm_medium=referral&utm_content=wadobo/decide&utm_campaign=Badge_Grade)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/cba8fd0874ac4f569f4f880e473cbac9?branch=master)](https://www.codacy.com/app/Wadobo/decide?utm_source=github.com&utm_medium=referral&utm_content=wadobo/decide&utm_campaign=Badge_Coverage)
[![Python application](https://github.com/jorsilman/decide-23/actions/workflows/django.yml/badge.svg)](https://github.com/jorsilman/decide-23/actions/workflows/django.yml)

Plataforma voto electrónico educativa
=====================================
Expand Down Expand Up @@ -290,3 +293,5 @@ A tener en cuenta:
concurrentes, cuando pongamos más de 100, lo normal es que empiecen a fallar muchas peticiones.
* Si hacemos las pruebas en local, donde tenemos activado el modo debug de Django, lo normal es que
las peticiones tarden algo más y consigamos menos RPS (Peticiones por segundo).


11 changes: 6 additions & 5 deletions decide/base/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by Django 2.0 on 2018-06-05 08:42
# Generated by Django 2.0 on 2022-12-12 16:03

import base.models
from django.db import migrations, models


Expand All @@ -24,10 +25,10 @@ class Migration(migrations.Migration):
name='Key',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('p', models.IntegerField()),
('g', models.IntegerField()),
('y', models.IntegerField()),
('x', models.IntegerField(blank=True, null=True)),
('p', base.models.BigBigField()),
('g', base.models.BigBigField()),
('y', base.models.BigBigField()),
('x', base.models.BigBigField(blank=True, null=True)),
],
),
]
33 changes: 0 additions & 33 deletions decide/base/migrations/0002_auto_20180921_1056.py

This file was deleted.

34 changes: 0 additions & 34 deletions decide/base/migrations/0003_auto_20180921_1119.py

This file was deleted.

3 changes: 2 additions & 1 deletion decide/booth/templates/booth/booth.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ <h2>[[ voting.question.desc ]]</h2>
vote: {a: v.alpha.toString(), b: v.beta.toString()},
voting: this.voting.id,
voter: this.user.id,
token: this.token
token: this.token,
type: this.voting.type
}
this.postData("{% url "gateway" "store" "/" %}", data)
.then(data => {
Expand Down
9 changes: 8 additions & 1 deletion decide/booth/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
from django.urls import path
from .views import BoothView

from .views import BoothView, ScoreBoothView, BoothBinaryView



urlpatterns = [
path('<int:voting_id>/', BoothView.as_view()),

path('scoreVoting/<int:voting_id>/', ScoreBoothView.as_view()),

path('binaryVoting/<int:voting_id>/', BoothBinaryView.as_view()),

]
59 changes: 51 additions & 8 deletions decide/booth/views.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,74 @@
import json

from voting.models import ScoreVoting

from django.shortcuts import get_object_or_404

from django.views.generic import TemplateView
from django.conf import settings
from django.http import Http404

from base import mods

from voting.models import Voting, VotingBinary



# TODO: check permissions and census
class BoothView(TemplateView):
template_name = 'booth/booth.html'

def get_context_data(self, **kwargs):
def get_context_data(self,voting_id, **kwargs):
context = super().get_context_data(**kwargs)
vid = kwargs.get('voting_id', 0)
#vid = kwargs.get('voting_id', 0)

try:
r = mods.get('voting', params={'id': vid})
voting = get_object_or_404(Voting,pk=voting_id)

context['voting'] = json.dumps(voting.toJson())

except:
raise Http404

# Casting numbers to string to manage in javascript with BigInt
# and avoid problems with js and big number conversion
for k, v in r[0]['pub_key'].items():
r[0]['pub_key'][k] = str(v)
context['KEYBITS'] = settings.KEYBITS

context['voting'] = json.dumps(r[0])
return context

class BoothBinaryView(TemplateView):
template_name = 'booth/booth.html'

def get_context_data(self,voting_id, **kwargs):
context = super().get_context_data(**kwargs)
#vid = kwargs.get('voting_id', 0)

try:
voting = get_object_or_404(VotingBinary,pk=voting_id)

context['voting'] = json.dumps(voting.toJson())

except:
raise Http404

context['KEYBITS'] = settings.KEYBITS

return context


class ScoreBoothView(TemplateView):
template_name = 'booth/booth.html'

def get_context_data(self, voting_id, **kwargs):

context = super().get_context_data(**kwargs)

try:
voting = get_object_or_404(ScoreVoting,pk=voting_id)

context['voting'] = json.dumps(ScoreVoting.toJson(voting))
except:
raise Http404

context['KEYBITS'] = settings.KEYBITS

return context

4 changes: 2 additions & 2 deletions decide/census/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@


class CensusAdmin(admin.ModelAdmin):
list_display = ('voting_id', 'voter_id')
list_filter = ('voting_id', )
list_display = ('voting_id', 'voter_id','type')
list_filter = ('voting_id', 'type')

search_fields = ('voter_id', )

Expand Down
12 changes: 12 additions & 0 deletions decide/census/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django import forms

TYPES = [('CSV','CSV'), ('JSON','JSON'), ('XML','XML')]
class NameForm(forms.Form):
q = forms.CharField(required=False,label='Votante', max_length=100)
x = forms.CharField(required=False,label='Votación', max_length=100)
t = forms.ChoiceField(required=False,label=' Exportar a',choices=TYPES,widget=forms.RadioSelect)





5 changes: 3 additions & 2 deletions decide/census/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 2.0 on 2018-04-08 17:16
# Generated by Django 2.0 on 2022-12-12 16:51

from django.db import migrations, models

Expand All @@ -17,10 +17,11 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('voting_id', models.PositiveIntegerField()),
('voter_id', models.PositiveIntegerField()),
('type', models.CharField(choices=[('V', 'Voting'), ('SV', 'ScoreVoting'), ('BV', 'BinaryVoting')], default='V', max_length=2)),
],
),
migrations.AlterUniqueTogether(
name='census',
unique_together={('voting_id', 'voter_id')},
unique_together={('voting_id', 'voter_id', 'type')},
),
]
5 changes: 4 additions & 1 deletion decide/census/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
class Census(models.Model):
voting_id = models.PositiveIntegerField()
voter_id = models.PositiveIntegerField()
votingTypes = (('V', 'Voting'), ('SV', 'ScoreVoting'), ('BV', 'BinaryVoting'))
type = models.CharField(max_length=2, choices=votingTypes, default='V')


class Meta:
unique_together = (('voting_id', 'voter_id'),)
unique_together = (('voting_id', 'voter_id','type'),)
33 changes: 33 additions & 0 deletions decide/census/static/census/censusForAll.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.form {
width: 100%;
max-width: 600px;
margin: 0 auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.form select {
width: 350px;
height: 60px;
margin: 1rem;font-size: 30px!important;
}

.btn{
width: 200px;
height: 60px;
margin: 1rem;
font-size: 25px!important;
}
body{
background-image: url('./fondoEvoting.png')!important;
}

#botonHome{
position: absolute; /* Posicionamos de forma absoluta*/
top: 5%; /* Calculamos la posición*/
right: 90%; /* Calculamos la posición*/
width: auto!important;
height: auto!important;
}
Binary file added decide/census/static/census/fondoEvoting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading