Skip to content

Commit

Permalink
Merge pull request EGCETSII#29 from Decide-Part-Rota/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
alfcadmorUS authored Dec 16, 2022
2 parents 4f31690 + 4c3b915 commit 66f9e83
Show file tree
Hide file tree
Showing 62 changed files with 3,018 additions and 48 deletions.
12 changes: 12 additions & 0 deletions .CommitsTemplate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<type>: <description>

[optional body]

(Important this is template to be erase before you do a commit. DO NOT FORGET TO ERASE ALL THE INFO IN THIS TEMPLATE!)
Types of <type>:
fix: this commit patches a bug in your codebase
feat: this commit introduces a new feature to the codebase
test: this commit introduces new test for a funtionality in the codebase

<description> An usuful an short summary of the work done in the commit
<body> A more in depth description of the new functionality (optional)
2 changes: 2 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ jobs:
build:

runs-on: ubuntu-latest

env:
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_SECRET: ${{ secrets.GOOGLE_SECRET }}
EMAIL_USER: ${{ secrets.EMAIL_USER }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}


services:
postgres:
image: postgres:10.8
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ coverage.xml
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,5 @@ A tener en cuenta:
* En un servidor local, con un postgres que por defecto nos viene limitado a 100 usuarios
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)..
las peticiones tarden algo más y consigamos menos RPS (Peticiones por segundo)

3 changes: 3 additions & 0 deletions decide/.env:Zone.Identifier
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\rafae\Downloads\env.zip
53 changes: 53 additions & 0 deletions decide/authentication/static/registration/header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
* {
margin: 0;
padding: 0;
}

body {
background: #fffffa;
}

header {
width: 100%;
overflow: hidden;
background: #252932;
margin-bottom: 20px;
}

.wrapper {
width: 90%;
max-width: 1000px;
margin: auto;
overflow: hidden;
}

header .logo {
color: #f2f2f2;
font-size: 50px;
line-height: 200px;
float: left;
}

header nav {
float: right;
line-height: 200px;
}

header nav a {
display: inline-block;
color: #fff;
text-decoration: none;
padding: 10px 20px;
line-height: normal;
font-size: 20px;
font-weight: bold;
-webkit-transition: all 500ms ease;
-o-transition: all 500ms ease;
transition: all 500ms ease;
border-radius: 50px;
}

header nav a:hover {
background: blue;
border-radius: 50px;
}
52 changes: 28 additions & 24 deletions decide/authentication/templates/welcome.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
{% extends "base.html" %}
{% load i18n static %}

{% block extrahead %}
<link type="text/css" rel="stylesheet" href="https://unpkg.com/bootstrap/dist/css/bootstrap.min.css" />

<link type="text/css" rel="stylesheet" href="https://unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.css" />
<title>Welcome</title>
{% endblock %}

{% block content %}
<!-- Navbar -->
<div >

<h2>¡Bienvenido, {{user.first_name}}!</h2>


<a href="{% url 'salir'%}">Cerrar sesion</a>

{% if message %}
<p>Error: {{message}}</p>
{% endif %}
</div>
{% endblock %}
{% load static %}
<html lang="es-ES">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inicio</title>
<link rel="stylesheet" href="{% static 'registration/header.css' %}">
</head>
<body>
<header>
<div class="wrapper">

<div class="logo">Decide</div>

<nav>
<a href="#">Perfil</a>
<a href="#">Censo</a>
<a href="#">Mis votaciones</a>
<a href="{% url 'salir'%}">Cerrar sesión</a>
</nav>
</div>
</header>

<h2>¡Bienvenido, {{user.username}}!</h2>

</body>
</html>
23 changes: 23 additions & 0 deletions decide/authentication/templates/welcome2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% extends "base.html" %}
{% load i18n static %}

{% block extrahead %}
<link type="text/css" rel="stylesheet" href="https://unpkg.com/bootstrap/dist/css/bootstrap.min.css" />

<link type="text/css" rel="stylesheet" href="https://unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.css" />
{% endblock %}

{% block content %}
<!-- Navbar -->
<div >

<h2>¡Bienvenido, {{user.first_name}}!</h2>


<a href="{% url 'salir'%}">Cerrar sesion</a>

{% if message %}
<p>Error: {{message}}</p>
{% endif %}
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion decide/booth/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django.contrib import admin


# Register your models here.
2 changes: 1 addition & 1 deletion decide/booth/templates/booth/booth.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h2>[[ voting.question.desc ]]</h2>
<script src="{% static "crypto/elgamal.js" %}"></script>

<!-- Vuejs -->
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue@2.7.10"></script>
<script src="https://unpkg.com/babel-polyfill@latest/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.js"></script>

Expand Down
4 changes: 4 additions & 0 deletions decide/census/export/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Export Folder
================================

Este directorio incluirá todos los censos que exportes.
2 changes: 2 additions & 0 deletions decide/census/export/export_pruebaDiscord.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
username,first_name,last_name,email
practica,,,[email protected]
16 changes: 16 additions & 0 deletions decide/census/static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
div.title {
margin-top: 2%
}

div.submit {
margin-top: 2%;
}

.row {
margin-top: 1%;
margin-bottom: 1%;
}

.group-button {
margin-left: 25px;
}
82 changes: 82 additions & 0 deletions decide/census/templates/census_add.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{% extends "base.html" %}
{% load i18n static %}

{% block extrahead %}
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>

<link type="text/css" rel="stylesheet" href="{% static 'style.css' %}" />
{% endblock %}


{% block content %}
<div class="title">
<h2>{% trans "Manage Census" %}</h2>
</div>

<div class="row justify-content-md-center">
<div class="col-sm-8">
<h4>{% trans "In this view you can manage the census by adding a user to a specific voting" %}</h4>
</div>
</div>

<div class="row">

</div>

<form class="row gx-3 gy-2 align-items-center" action="add_to_census" method="POST">
{% csrf_token %}
<div class="row justify-content-md-center">
<div class="col-sm-8">
<label for="voting-select">{% trans "Choose a voting" %}</label>
<select class="form-select" id="voting-select" name="voting-select">
{% for voting in votings %}
<option value="{{voting.id}}">{{voting}}</option>
{%endfor%}
</select>

</div>
</div>
<div class="row justify-content-md-center">
<div class="col-sm-8">
<label for="user-select">{% trans "Choose a user" %}</label>
<select class="form-select" id="user-select" name="user-select">
{% for user in users %}
<option value="{{user.id}}">{{user}}</option>
{%endfor%}
</select>
</div>
</div>
<div class="row justify-content-center submit">
<div class="col col-lg-1">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>

<div class="row justify-content-center submit">
<div class="col col-lg-2">
<a href="by_group"><button type="button" class="btn btn-primary group-button">{% trans "Or Add By Group" %}</button></a>
</div>
</div>

{% if messages %}
<ul class="messages" style="margin-top:2%">
{% for message in messages %}
{% if message.tags == 'error' %}
<li class="{{ message.tags }} alert alert-danger" role="alert">{{ message }}</li>
{% else %}
<li class="{{ message.tags }} alert alert-{{message.tags}}" role="alert">{{ message }}</li>
{% endif %}

{% endfor %}
</ul>

{% endif %}



{% include 'footer.html' %}


{% endblock %}
72 changes: 72 additions & 0 deletions decide/census/templates/census_age.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{% extends "base.html" %}
{% load i18n static %}

{% block extrahead %}
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>

<link type="text/css" rel="stylesheet" href="{% static 'style.css' %}" />
{% endblock %}


{% block content %}
<div class="row justify-content-md-center align-items-center">
<div class="col-sm-8 justify-content-center align-items-center">
<h2 class ="justify-content-center align-items-center"> {% trans "Census Groups" %}</h2>
</div>
</div>
<div class="row justify-content-md-center">
<div class="col-sm-8">
<h3>{% trans "Now you can add groups of voters to an specific voting" %}</h3>
<h6>{% trans "for example, if you select minmun age 22 and maximum age 28, every user who satisfies that requirement will be added to the chosen voting" %}</h6>
</div>
</div>

<div class="row">

</div>

<form class="row gx-3 gy-2 align-items-center" action="age/create" method="POST">
{% csrf_token %}
<div class="row justify-content-md-center">
<div class="col-sm-8">
<label for="specificSizeSelect">{% trans "Choose a voting" %}</label>
<select class="form-select" id="specificSizeSelect" name="voting-select">
{% for voting in votings %}
<option value="{{voting.id}}">{{voting}}</option>
{%endfor%}
</select>

</div>
</div>
<div class="row justify-content-md-center">
<div class="col-sm-8">
<label for="minimum-age">{% trans "Minimum age" %}</label>
<input type="number" name="minimum-age" max="100" min="0">
<label for="maximum-age">{% trans "Maximum age" %}</label>
<input type="number" name="maximum-age" max="100" min="0">
</div>
</div>
<div class="row justify-content-center submit">
<div class="col col-lg-1">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>

{% if messages %}
<ul class="messages" style="margin-top:2%">
{% for message in messages %}
{% if message.tags == 'error' %}
<li class="{{ message.tags }} alert alert-danger" role="alert">{{ message }}</li>
{% else %}
<li class="{{ message.tags }} alert alert-{{message.tags}}" role="alert">{{ message }}</li>
{% endif %}

{% endfor %}
</ul>

{% endif %}
{% include 'footer.html' %}

{% endblock %}
Loading

0 comments on commit 66f9e83

Please sign in to comment.