Skip to content

Commit

Permalink
Merge pull request #25 from Villanueva-del-Trabuco-EGC/develop
Browse files Browse the repository at this point in the history
Actualización de master con funcionalidad estable
  • Loading branch information
Framigdom authored Dec 8, 2022
2 parents 8bc278b + a28a137 commit 8ed9ddb
Show file tree
Hide file tree
Showing 46 changed files with 1,655 additions and 235 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Python application
on:
push:
branches:
- '*'
- '**'
workflow_call:
secrets:
CODACY_PROJECT_TOKEN:
required: true

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
pyversion: ['3.6.15', '3.8']
Expand Down Expand Up @@ -44,10 +44,6 @@ jobs:
pip install -r requirements.txt
pip install codacy-coverage
cp decide/local_settings.gactions.py decide/local_settings.py
- name: Run migrations (unnecessary)
run: |
cd decide
python manage.py migrate
- name: Generate translation files
run: |
sudo apt-get install gettext
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/releases_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: release
on:
push:
tags:
- '*'
- '**'

jobs:
buildTest:
Expand All @@ -13,7 +13,7 @@ jobs:

release:
needs: buildTest
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
48 changes: 48 additions & 0 deletions decide/authentication/locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# decide auth translation
# This file is distributed under the same license as the main project

# Translators: Francisco Javier Migueles <[email protected]>, 2022

msgid ""
msgstr ""

"Language: en\n"
"Last-Translator: Francisco Javier Migueles\n"
"POT-Creation-Date: 2022-12-01 18:45+0100\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

msgid "registrar"
msgstr "Registration"

msgid "infoRegistrar"
msgstr "Please fill in this form to create an account."

msgid "first_name"
msgstr "First Name"

msgid "last_name"
msgstr "Last Name"

msgid "username"
msgstr "Username"

msgid "email"
msgstr "Email"

msgid "password"
msgstr "Password"

msgid "acceptRegister"
msgstr "By registering, you accept the"

msgid "terms"
msgstr "Terms & Privacy"

msgid "alreadyAccount"
msgstr "Already have an account?"

msgid "sign"
msgstr "Sign In"
39 changes: 38 additions & 1 deletion decide/authentication/locale/es_ES/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,41 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"


msgid "registrar"
msgstr "Registro"

msgid "infoRegistrar"
msgstr "Por favor, rellene este formulario para crear una cuenta."

msgid "first_name"
msgstr "Nombre"

msgid "last_name"
msgstr "Apellido"

msgid "username"
msgstr "Nombre de usuario"

msgid "email"
msgstr "Email"

msgid "password"
msgstr "Contraseña"

msgid "register"
msgstr "Registrarse"

msgid "sign"
msgstr "Identificarse"

msgid "acceptRegister"
msgstr "Al registrarse, acepta"

msgid "terms"
msgstr "Terminos y Privacidad"

msgid "alreadyAccount"
msgstr "¿Ya estas registrado?"
20 changes: 10 additions & 10 deletions decide/authentication/templates/authentication/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,48 @@
<form method="POST">
{% csrf_token %}
<div class="form-group">
<h1>Register</h1>
<p>Please fill in this form to create an account.</p>
<h1>{% trans "registrar" %}:</h1>
<p>{% trans "infoRegistrar" %}</p>
<hr>
<div class="form-row">
<div class="form-group col-md-6 mb-0">
<label for="first_name"><b>First Name</b></label>
<label for="first_name"><b>{% trans "first_name" %}</b></label>
<input type="text" placeholder="Enter first name" name="first_name" id="first_name">
</div>
<br>
<div class="form-group col-md-6 mb-0">
<label for="last_name"><b>Last Name</b></label>
<label for="last_name"><b>{% trans "last_name" %}</b></label>
<input type="text" placeholder="Enter last name" name="last_name" id="last_name">
</div>
<br>
</div>
<div class="form-row">
<div class="form-group col-md-6 mb-0">
<label for="username"><b>Username</b></label>
<label for="username"><b>{% trans "username" %}</b></label>
<input type="text" placeholder="Enter user name" name="username" id="username">
</div>
<br>
<div class="form-group col-md-6 mb-0">
<label for="email"><b>Email</b></label>
<label for="email"><b>{% trans "email" %}</b></label>
<input type="text" placeholder="Enter Email" name="email" id="email">
</div>
<br>
</div>
<div class="form-row">
<div class="form-group col-md-6 mb-0">
<label for="password"><b>Password</b></label>
<label for="password"><b>{% trans "password" %}</b></label>
<input type="password" placeholder="Enter Password" name="password" id="password">
</div>
</div>
</div>

<p>By registering, you accept the <a href="#">Terms & Privacy</a>.</p>
<p>{% trans "acceptRegister" %}<a href="#">{% trans "terms" %}</a>.</p>

<div class="form-group">
<button class="registerbtn" type="submit">Register</button>
<button class="registerbtn" type="submit">{% trans "registrar" %}</button>
</div>
<div class="container signin">
<p>Already have an account? <a href="/">Sign In</a></p>
<p>{% trans "alreadyAccount" %}<a href="/">{% trans "sign" %}</a></p>
</div>
</form>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{% autoescape off %}
Hi {{ user.username }},
Welcome to Decide Villanueva del Trabuco.
Before you can vote in our system or use Decide, we need you to activate your account.

Please click on the link below to confirm your registration:

{{protocol}}://{{domain}}{% url 'activate' uidb64=uid token=token %}

We hope you enjoy your time using Decide Villanueva del Trbuco.
If you have any suggestion to improve our web, send an e-mail to this account with the subject: BetterDecide!.
{% endautoescape %}
14 changes: 14 additions & 0 deletions decide/authentication/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def setUp(self):
self.client = APIClient()
mods.mock_query(self.client)
u = User(username='voter1')
u.email = '[email protected]'
u.set_password('123')
u.save()

Expand All @@ -38,6 +39,19 @@ def test_login_fail(self):
response = self.client.post('/authentication/login/', data, format='json')
self.assertEqual(response.status_code, 400)

def test_login_email(self):
data = {'username': '[email protected]', 'password': '123'}
response = self.client.post('/authentication/login/', data, format='json')
self.assertEqual(response.status_code, 200)

token = response.json()
self.assertTrue(token.get('token'))

def test_login_fail_email(self):
data = {'username': '[email protected]', 'password': '321'}
response = self.client.post('/authentication/login/', data, format='json')
self.assertEqual(response.status_code, 400)

def test_getuser(self):
data = {'username': 'voter1', 'password': '123'}
response = self.client.post('/authentication/login/', data, format='json')
Expand Down
15 changes: 15 additions & 0 deletions decide/base/locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# decide base translation
# This file is distributed under the same license as the main project

# Translators: Francisco Javier Migueles Dominguez <[email protected]>, 2022

msgid ""
msgstr ""

"Language: es\n"
"Last-Translator: Francisco Javier Migueles Dominguez\n"
"POT-Creation-Date: 2022-12-04 11:00+0100\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
3 changes: 2 additions & 1 deletion decide/base/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
</head>
<body>
{% block content %}
{% endblock %}

{% endblock %}

{% block extrabody %}{% endblock %}
</body>
</html>
76 changes: 76 additions & 0 deletions decide/booth/locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# decide booth translation
# This file is distributed under the same license as the main project

# Translators: Francisco Javier Migueles <[email protected]>, 2022

msgid ""
msgstr ""

"Language: en\n"
"Last-Translator: Francisco Javier Migueles\n"
"POT-Creation-Date: 2022-12-01 18:00+0100\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

# Booth

msgid "decide"
msgstr "Decide"

msgid "logout"
msgstr "Logout"

msgid "vID"
msgstr "ID of Vote"

msgid "vName"
msgstr "Name of voting"

msgid "Login"
msgstr "Login"

msgid "LoginGitHub"
msgstr "Login with GitHub"

msgid "LoginFacebook"
msgstr "Login with Facebook"

msgid "Vote"
msgstr "Vote"

msgid "Error"
msgstr "Error"

msgid "Conglatulations. Your vote has been sent"
msgstr "Conglatulations. Your vote has been sent"

msgid "registered_as_1"
msgstr "You are registered "

msgid "registered_as_2"
msgstr " as "

msgid "vote_with"
msgstr "You have voted with"

# Votings

msgid "voting"
msgstr "Voting"

msgid "link_voting"
msgstr "Link to voting"

msgid "link_census"
msgstr "Link to census"

msgid "booth_voting"
msgstr "Booth to voting"

msgid "closed_voting"
msgstr "Voting closed"

msgid "voting_census"
msgstr "Census of voting"
33 changes: 32 additions & 1 deletion decide/booth/locale/es_ES/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

# Booth

msgid "decide"
msgstr "Decide"

Expand Down Expand Up @@ -42,4 +44,33 @@ msgid "Error"
msgstr "Error"

msgid "Conglatulations. Your vote has been sent"
msgstr "¡Enhorabuena! Tu voto se ha enviado"
msgstr "¡Enhorabuena! Tu voto se ha enviado"

msgid "registered_as_1"
msgstr "Registrado en "

msgid "registered_as_2"
msgstr " como "

msgid "vote_with"
msgstr "Votar como"

# Votings

msgid "voting"
msgstr "Votación"

msgid "link_voting"
msgstr "Enlace a la votación"

msgid "link_census"
msgstr "Enlace al censo"

msgid "booth_voting"
msgstr "Booth votación "

msgid "closed_voting"
msgstr "Votación cerrada"

msgid "voting_census"
msgstr "Censo votación "
Loading

0 comments on commit 8ed9ddb

Please sign in to comment.