Skip to content
Snippets Groups Projects
Commit de1b3828 authored by Patricio Kumagae's avatar Patricio Kumagae
Browse files

Incidentes BFA

parent 7235c450
No related branches found
No related tags found
No related merge requests found
Showing
with 523 additions and 193 deletions
......@@ -9,7 +9,7 @@ You should have received a copy of the GNU General Public License along with thi
"""
from django.db import models
from api.models import Institution, Service
from api.models import Institution, Service, CustomUser
from dapp import validators
from dapp.managers import AccountManager, StatusManager
......@@ -33,6 +33,7 @@ class Account(models.Model):
institution = models.ForeignKey(Institution, on_delete=models.PROTECT, null=True, blank=True)
service = models.ForeignKey(Service, on_delete=models.PROTECT, null=True)
clave = models.CharField(max_length=255, null=True, default='', blank=True)
owner = models.ForeignKey(CustomUser, on_delete=models.PROTECT, null=False)
objects = AccountManager()
def __str__(self):
......
This diff is collapsed.
<!--
Copyright 2019 de la Dirección General de Sistemas Informáticos – Secretaría Legal y Técnica - Nación.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
-->
{% extends 'header.html' %}
{% load i18n %}
{% load static %}
......@@ -36,12 +27,14 @@ You should have received a copy of the GNU General Public License along with thi
<div>
<div><h1 class="page-header">Cuentas</h1></div>
<div>
<div style="margin-right: 266px;">
<div {% if services %} style="margin-right: 266px;" {% endif %}>
<a href="#" class="btn-default btn btn-lg btn-header" id="agregarNuevaCuenta" data-toggle="modal" data-target="#modalNuevaCuenta">+ Agregar nueva cuenta</a></li>
</div>
<div>
<a href="#" class="btn-default btn btn-lg btn-header" id="agregarCuentaExistente" data-toggle="modal" data-target="#modalCuentaExistente">+ Agregar cuenta existente</a></li>
</div>
{% if services %}
<div>
<a href="#" class="btn-default btn btn-lg btn-header" id="agregarCuentaExistente" data-toggle="modal" data-target="#modalCuentaExistente">+ Agregar cuenta existente</a></li>
</div>
{% endif %}
</div>
</div>
<div class="table-responsive">
......@@ -73,21 +66,26 @@ You should have received a copy of the GNU General Public License along with thi
{{ item.account.address }}
</div>
</td>
<td>{{ item.account.status.descripcion }}</td>
<td>
{% if item.status.id == 1 %}
{{ item.status.descripcion }}
{% else %}
{{ item.account.status.descripcion }}
{% endif %}
</td>
<td>{{ item.account.balance }} <span class="mwei">Wei</span></td>
<td>{{ item.account.tope }} <span class="mwei">Wei</span></td>
<td>
{% if item.account.status.descripcion == 'Sin verificar' %}
<button type="button" id="btn-verificar" clave="{{ item.account.clave }}" id-account="{{ item.account.id }}" class="btn btn-primary" data-toggle="modal" data-target="#modalInstrucciones">Verificar mi cuenta</button>
{% else %}
{% if item.account.status.descripcion == 'Satisfecho' or item.account.status.descripcion == 'Lista para gestion' %}
<button type="submit" class="btn btn-primary">Quiero más carga</button>
{% if item.status.id == 2 %}
{% if item.account.status.descripcion == 'Sin verificar' %}
<button type="button" id="btn-verificar" clave="{{ item.account.clave }}" id-account="{{ item.account.id }}" class="btn btn-primary" data-toggle="modal" data-target="#modalInstrucciones">Verificar mi cuenta</button>
{% else %}
{% if item.account.status.descripcion == 'Satisfecho' or item.account.status.descripcion == 'Lista para gestion' %}
<button type="submit" class="btn btn-primary">Quiero más carga</button>
{% endif %}
{% endif %}
{% endif %}
<!--
Comentado a pedido 18/12/2018 18:30 hs - pkumagae
<button type="button" id="{{ item.account.id }}" class="btn btn-default pull-right" data-toggle="modal" data-target="#modalEditarCuenta">Editar</button>
-->
<button type="button" id="{{ item.account.id }}" customuser-account-id="{{ item.id }}" class="btn btn-default pull-right" data-toggle="modal" data-target="#modalEditarCuenta">Editar</button>
</td>
</form>
</tr>
......@@ -106,7 +104,6 @@ You should have received a copy of the GNU General Public License along with thi
<div class="modal" id="modalInstrucciones" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg modal-content" role="document">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h2 class="modal-title">Instrucciones para verificar mi cuenta</h2>
......@@ -132,7 +129,7 @@ You should have received a copy of the GNU General Public License along with thi
</div>
<div class="modal-body">
<a href="#" class="btn-default btn btn-lg btn-header" id="agregarNuevaCuenta" data-toggle="modal" data-target="#modalNuevaCuenta">+ Agregar nueva cuenta</a>
<a href="#" class="btn-default btn btn-lg btn-header" id="agregarNuevaCuenta" data-toggle="modal" data-target="#modalCuentaExistente">+ Agregar cuenta existente</a>
<a href="#" class="btn-default btn btn-lg btn-header" id="agregarCuentaExistente" data-toggle="modal" data-target="#modalCuentaExistente">+ Agregar cuenta existente</a>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-lg" data-dismiss="modal">Cancelar</button>
......@@ -199,7 +196,7 @@ You should have received a copy of the GNU General Public License along with thi
<div class="form-group form-group-lg">
<label for="institucion" class="form-required">Servicio </label>
<select class="form-control" id="service" name="service">
<option>Seleccione</option>
<option value="">Seleccione</option>
{% for service in services %}
<option value="{{ service.id }}">{{ service.name }}</option>
{% endfor %}
......@@ -235,15 +232,15 @@ You should have received a copy of the GNU General Public License along with thi
<h2 class="modal-title">Editar cuenta</h2>
</div>
<div class="modal-body">
<div class="alert alert-danger" role="alert">
<p>Comprobá los siguientes errores del formulario:</p>
<ul></ul>
</div>
<div class="form-group form-group-lg">
<label for="direccionCuenta-edit">Dirección</label>
<a role="button" target="_blank" data-container="body" data-toggle="popover" data-placement="right" data-content="Para saber tu dirección debés tener instalado el núcleo de BFA. Visitá nuestro <a href='https://gitlab.bfa.ar/' target='_blank'>GitLab</a> para saber cómo instalar el núcleo y obtenerla."><i class="far fa-question-circle" aria-hidden="true"></i><span class="sr-only">Más información</span></a>
<input class="form-control" type="text" id="direccionCuenta-edit" name="direccionCuenta-edit" value="-" size="60" placeholder="0x + 40 caractéres hexadecimales" maxlength="42" required="required" aria-required="true" readonly disabled>
</div>
<div class="alert alert-danger" role="alert">
<p>Comprobá los siguientes errores del formulario:</p>
<ul></ul>
</div>
<div class="form-group form-group-lg">
<label for="direccionCuenta-edit">Dirección</label>
<a role="button" target="_blank" data-container="body" data-toggle="popover" data-placement="right" data-content="Para saber tu dirección debés tener instalado el núcleo de BFA. Visitá nuestro <a href='https://gitlab.bfa.ar/' target='_blank'>GitLab</a> para saber cómo instalar el núcleo y obtenerla."><i class="far fa-question-circle" aria-hidden="true"></i><span class="sr-only">Más información</span></a>
<input class="form-control" type="text" id="direccionCuenta-edit" name="direccionCuenta-edit" value="-" size="60" placeholder="0x + 40 caractéres hexadecimales" maxlength="42" required="required" aria-required="true" readonly disabled>
</div>
</div>
<div class="modal-footer">
<form id="form-delete-account" method="post">
......@@ -259,37 +256,6 @@ You should have received a copy of the GNU General Public License along with thi
</div>
<div class="modal fade" id="modalEditarCuentaBloqueada" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<form class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h2 class="modal-title">Editar cuenta</h2>
</div>
<div class="modal-body">
<div class="alert alert-danger" role="alert">
<p>Comprobá los siguientes errores del formulario:</p>
<ul></ul>
</div>
<div class="form-group form-group-lg">
<label for="nombreCuenta-blocked" class="form-required">Nombre de la cuenta (alias)</label>
<input class="form-control" type="text" id="nombreCuenta-blocked" name="nombreCuenta-blocked" value="Nombre cuenta #1" size="60" maxlength="255"
required="required" aria-required="true" disabled>
</div>
<div class="form-group form-group-lg">
<label for="direccionCuenta-blocked" class="form-required">Dirección </label>
<a role="button" target="_blank" data-container="body" data-toggle="popover" data-placement="right" data-content="Para saber tu dirección debés tener instalado el núcleo de BFA. Visitá nuestro <a href='https://gitlab.bfa.ar/' target='_blank'>GitLab</a> para saber cómo instalar el núcleo y obtenerla."><i class="far fa-question-circle" aria-hidden="true"></i><span class="sr-only">Más información</span></a>
<input class="form-control" type="text" id="direccionCuenta-blocked" name="direccionCuenta-blocked" value="0x6546546542desf34234652346524232ase32" size="60" placeholder="0x + 40 caractéres hexadecimales" maxlength="42" required="required" aria-required="true" disabled>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default eliminar pull-left" data-dismiss="modal">Borrar cuenta</button>
<button type="button" class="btn btn-default btn-lg" data-dismiss="modal">Cancelar</button>
<!-- <button type="submit" id="agregar" class="btn btn-primary btn-lg">Guardar cambios</button> -->
</div>
</form>
</div>
</div>
{% include 'footer.html' %}
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap.min.js"></script>
......@@ -435,14 +401,11 @@ You should have received a copy of the GNU General Public License along with thi
$('#modalEditarCuenta').on('shown.bs.modal', function(e) {
var address_id = $(e.relatedTarget).attr('id');
$('#direccionCuenta-edit').val($('#address-'+$(e.relatedTarget).attr('id')).val());
$('#direccionCuenta-edit').val($('#address-'+address_id).val());
$('#delete-account-id').val($(e.relatedTarget).attr('id'));
$('#delete-account-id').val(address_id);
$('#form-delete-account').attr('action', '/accounts/delete/'+address_id+'/');
$('#form-delete-account').attr('action', '/accounts/delete/'+$(e.relatedTarget).attr('customuser-account-id')+'/');
});
$('#modalCuentaExistente').on('shown.bs.modal', function(){
......@@ -453,17 +416,11 @@ You should have received a copy of the GNU General Public License along with thi
$('#modalInstrucciones').on('shown.bs.modal', function(e) {
var button = e.relatedTarget;
var account_id = $(button).attr('id-account');
$('#label-cuenta').html($('#address-'+account_id).val());
$('#label-clave').html($(button).attr('clave'));
$('#label-cuenta').html($('#address-'+$(e.relatedTarget).attr('id-account')).val());
$('#label-clave').html($(e.relatedTarget).attr('clave'));
$('#label-contract-address').html($('#distillery_address').val());
});
</script>
{% endblock %}
\ No newline at end of file
......@@ -170,8 +170,7 @@
<table role="presentation" cellspacing="0" cellpadding="0" border="0" align="center" width="400" style="margin: auto;" class="email-container">
<tr>
<td style="padding: 30px; text-align: center; border-bottom: #DDD 1px solid" bgcolor="#ffffff" width="100px">
<a href="https://bfa.ar"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIsAAABkCAMAAACB1TOaAAABa1BMVEX///9cXGDltEmEhIetra9qmtHW1tf2+fza5/NxqNHt8/nc6/Nuo9HCwsNmZmnb6fNwcHP19fVwptGPtNx6u9Dr6+u0zOjg4OGZmZt6en240+i20ejd7fP47NHe7/NtodG1zuh5udCOjpFxqtFrndG3t7lsn9F3ttB2s9G83efI2u5zoNTu9vmjo6XMzM2iweJ8ptdzrdH3+/yRt9yCv9N1sdHj7fabzdyWwtyKwtZ0r9F7vdC62OiZyty41eiTu9yCs9d/udTR4PGYxtx+qtd5rtTK3u7A1+uvzuWsx+WYut93p9STvtyJs9mHvNeBr9e72uilxuKFrdl8tNR0o9S+1Oufxt+cwd/m8vbk7vbM4+6s1OKq0eL68d2Sxtl4rNTS5PHV6vDE4eqz1uWny+Kjz9+cztyEttd3qtR2ptT14rjy2aTU5/HN5u3C2+uLudnuzYTrxnPovV/9+fDK4O7358bw1ZjnuFSp0OJ5fEQBAAAJ6ElEQVRo3sSY70/aQBjH701zvdKkydHwAogtoSkdNHEMcUpQUX7N8cPhDya6TDZZpsk23+zF/vw9BWehd9Q2FPfEKJYnd5/r873nnntQGMOJQlwK7n0svJfQmiz/WgA7xgG9C453AqM12HZcEOJiQhAKFwG8xVNBOBUA/nU+chK8CcMewQfpPXwQ/Z0fnUQhIU0XEC1KoiAUEu6S/YWAH18esMAveDeb0QVqNt7c7BcgBR37yQpENWVx1xGNcd4zPjaM8zyfO24Y8W2EXBY3vqsaPubqT4IpT0X28aZhNGBal8XVvbTyPi4s25dHDdPc9Iyvn5vnuvuKDJ0NXHgLJFP93rzXMUvHsszypG82CLAzT0Xfja5pjfy/OJQ0rQTeDIsbP2Y4fwu+EBdg2/EeaFrHIyvR1EO8ZtZCBzh/IssD3O7IcgojloUvv3AWXPg41ZHBPoI3y8LNg69DBgoyZz6orHqyfKLwlK/pfBUmwrIEPEjw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s9tdEsMB4sekOYBU+WXYt4sGxBdimz9saDJQNkZmFbA3BPlrLU6d7v4AdL3XvkDxYrIpwFDOkXBMUy2yvEzXL3CGoW/Dt4l47JR+1yR5N4yD/XS/QgcimW6TqEZbWNZukAfekxgJ9d3g6WO1uOn7r8zOIAzS3kqFgY8xIWOak0S/T7NGnkxYNbs2axxMrNb3XWTpa25r2PimX2aRjCsk4zVZ5uvXVsBaiCByPOOQ9dWAiGoceXPbZ2sqRvFxZwmoUX3ywBESuAT1wkOGUwDPg5t07g7EnHhvfgmIWtPvJ7pFiKPzzUk6WD+TYCHiyxArGoVzGqJrzCfu/KkrLdmYURGbZLdXrzskd1H5QBkmKRTv1YFvFzRt9nroHYOk+ypNtlWayNbFwBLoNoXHy7vxjuBPZK3/uL3cbPr/zK/4hH5IssSmugb/FhCVnqX249usp6W5GCXLp9bXaF4CmamBoisIntaFkjqe6r2hWfGrHUhyV19qnljaVWRkDqMSagLkkqhK/fHwIehCVE0VKgsdo8lxUaxTdC1pbCT16uEE+W1FyX8KXsPyAqKBbzztKbaMPREwVeapHG5QtZWQyf7dGb6k6WgSPwDhqfFguiCooxWGFRAxINymI0r3sUHhZXaKBv6/BkCdbKmS0TtsZPRhUCPzm8s0S222avwEZdqZiXxQndLMpG5lkaRkpS9oEoxwrMifG16YZAMr6zfC7k7af4fwCKrEw8rC+NzAAAAABJRU5ErkJggg==
" width="139" height="100" alt="NIC Argentina" border="0" style="background: #dddddd; color: #555555;"></a>
<a href="https://bfa.ar"><img src="https://bfa.ar/themes/bfa/logo.svg" width="139" height="100" alt="NIC Argentina" border="0" style="background: #ffffff; color: #555555;"></a>
</td>
</tr>
</table>
......
{#
Copyright 2019 de la Dirección General de Sistemas Informáticos – Secretaría Legal y Técnica - Nación.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
#}
Poppins | Nuevo usuario registrado
\ No newline at end of file
{% autoescape off %}
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="x-apple-disable-message-reformatting">
<title>Blockchain Federal Argentina</title>
<style>
html,
body {
margin: 0 auto !important;
padding: 0 !important;
height: 100% !important;
width: 100% !important;
}
* {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
div[style*="margin: 16px 0"] {
margin: 0 !important;
}
table,
td {
mso-table-lspace: 0pt !important;
mso-table-rspace: 0pt !important;
}
table {
border-spacing: 0 !important;
border-collapse: collapse !important;
table-layout: fixed !important;
margin: 0 auto !important;
}
table table table {
table-layout: auto;
}
img {
-ms-interpolation-mode:bicubic;
}
*[x-apple-data-detectors], /* iOS */
.x-gmail-data-detectors, /* Gmail */
.x-gmail-data-detectors *,
.aBn {
border-bottom: 0 !important;
cursor: default !important;
color: inherit !important;
text-decoration: none !important;
font-size: inherit !important;
font-family: inherit !important;
line-height: inherit !important;
}
.a6S {
display: none !important;
opacity: 0.01 !important;
}
img.g-img + div {
display: none !important;
}
.button-link {
text-decoration: none !important;
}
@media only screen and (min-device-width: 320px) and (max-device-width: 374px) {
.email-container {
min-width: 320px !important;
}
}
@media only screen and (min-device-width: 375px) and (max-device-width: 413px) {
.email-container {
min-width: 375px !important;
}
}
@media only screen and (min-device-width: 414px) {
.email-container {
min-width: 414px !important;
}
}
</style>
<!-- CSS Reset : END -->
<!-- Progressive Enhancements : BEGIN -->
<style>
/* What it does: Hover styles for buttons */
.button-td,
.button-a {
transition: all 100ms ease-in;
}
.button-td:hover,
.button-a:hover, .button-a:visited {
color: #FFFFFF !important;
background: #0094d4 !important;
border-color: #0094d4 !important;
}
/* Media Queries */
@media screen and (max-width: 600px) {
.email-container {
width: 100% !important;
margin: auto !important;
}
/* What it does: Forces elements to resize to the full width of their container. Useful for resizing images beyond their max-width. */
.fluid {
max-width: 100% !important;
height: auto !important;
margin-left: auto !important;
margin-right: auto !important;
}
/* What it does: Forces table cells into full-width rows. */
.stack-column,
.stack-column-center {
display: block !important;
width: 100% !important;
max-width: 100% !important;
direction: ltr !important;
}
/* And center justify these ones. */
.stack-column-center {
text-align: center !important;
}
/* What it does: Generic utility class for centering. Useful for images, buttons, and nested tables. */
.center-on-narrow {
text-align: center !important;
display: block !important;
margin-left: auto !important;
margin-right: auto !important;
float: none !important;
}
table.center-on-narrow {
display: inline-block !important;
}
/* What it does: Adjust typography on small screens to improve readability */
.email-container p {
font-size: 17px !important;
}
}
</style>
<!-- Progressive Enhancements : END -->
<!-- What it does: Makes background images in 72ppi Outlook render at correct size. -->
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
</head>
<body width="100%" style="margin: 0; mso-line-height-rule: exactly;">
<center style="width: 100%; text-align: left;">
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#EEEEEE">
<tr>
<td>
<table role="presentation" cellspacing="0" cellpadding="0" border="0" align="center" width="400" style="margin: auto;" class="email-container">
<tr>
<td style="padding: 30px; text-align: center; border-bottom: #DDD 1px solid" bgcolor="#ffffff" width="100px">
<a href="https://bfa.ar"><img src="https://bfa.ar/themes/bfa/logo.svg" width="139" height="100" alt="NIC Argentina" border="0" style="background: #ffffff; color: #555555;"></a>
</td>
</tr>
</table>
<table role="presentation" cellspacing="0" cellpadding="" border="0" align="center" width="400" style="margin: auto;" class="email-container">
<tr>
<td bgcolor="#ffffff" style="padding: 30px 30px; font-family: sans-serif; font-size: 16px; line-height: 190%; color: #555555; text-align: center;">
<h1>Cuenta agregada</h1>
<p>El usuario {{ username }} ha agregado la cuenta {{ address }}. Para aprobar al usuario ingrese al siguiente link:</p>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" style="margin-top: 15px; padding: 0 40px 40px; font-family: sans-serif; font-size: 15px; line-height: 140%; color: #555555; border-bottom: #DDD 1px solid">
<!-- Button : BEGIN -->
<table role="presentation" cellspacing="0" cellpadding="0" border="0" align="center" style="margin: auto">
<tr>
<td style="border-radius: 50px; background: #1C5D82; text-align: center;" class="button-td">
<a href="{{ scheme }}://{{ site }}/accounts/approve/{{ account_id }}/" style="color:#ffffff; background: #0094d4; border: 15px solid #0094d4; font-family: sans-serif; font-size: 16px; line-height: 110%; text-align: center; text-decoration: none; display: block; border-radius: 50px; " class="button-a">
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#ffffff !important; font-weight: bold">Aprobar</span>&nbsp;&nbsp;&nbsp;&nbsp;
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table role="presentation" cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="max-width: 680px; font-family: sans-serif; color: #333333; font-size: 14px; line-height: 140%;">
<tr>
<td style="padding: 20px; width: 100%; font-family: sans-serif; font-size: 14px; line-height: 140%; text-align: center; color: #333333;" class="x-gmail-data-detectors">
<span style="font-weight: bold !important;">Blockchain Federal Argentina</span><br>
<a href="https://bfa.ar" style=" color: #333333; text-decoration: underline !important;">https://bfa.ar</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</body>
</html>
{% endautoescape %}
\ No newline at end of file
{#
Copyright 2019 de la Dirección General de Sistemas Informáticos – Secretaría Legal y Técnica - Nación.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
#}
{% autoescape off %}
El usuario {{ username }} ha agregado la cuenta {{ address }}. Para aprobar al usuario ingrese al siguiente link:
{{ scheme }}://{{ site }}/accounts/approve/{{ account_id }}/
{% endautoescape %}
\ No newline at end of file
{#
Copyright 2019 de la Dirección General de Sistemas Informáticos – Secretaría Legal y Técnica - Nación.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
#}
Nueva cuenta BFA registrada
\ No newline at end of file
......@@ -34,7 +34,7 @@
<div class="input-group">
<input class="form-control" type="password" id="new_password1" name="new_password1" size="60" maxlength="255" required="required" aria-required="true">
<div class="input-group-addon">
<button id="toggle-password" class="toggle-button"><i class="fa fa-eye fa-lg toggle-icon"></i><span class="sr-only">Mostrar y ocultar contraseña</span></button>
<button id="toggle-password1" class="toggle-button"><i class="fa fa-eye fa-lg toggle-icon"></i><span class="sr-only">Mostrar y ocultar contraseña</span></button>
</div>
</div>
</div>
......@@ -43,7 +43,7 @@
<div class="input-group">
<input class="form-control" type="password" id="new_password2" name="new_password2" size="60" maxlength="255" required="required" aria-required="true">
<div class="input-group-addon">
<button id="toggle-newPassword" class="toggle-button"><i class="fa fa-eye fa-lg toggle-icon"></i><span class="sr-only">Mostrar y ocultar contraseña</span></button>
<button id="toggle-password2" class="toggle-button"><i class="fa fa-eye fa-lg toggle-icon"></i><span class="sr-only">Mostrar y ocultar contraseña</span></button>
</div>
</div>
</div>
......@@ -99,5 +99,36 @@
}
});
$("#toggle-password1").on("click",function(a){
a.preventDefault();
if("text"==$("#new_password1").attr("type")){
$("#new_password1").attr("type","password")
$("#toggle-password1 .toggle-icon").removeClass("fa-eye-slash");
$("#toggle-password1 .toggle-icon").addClass("fa-eye");
}else{
$("#new_password1").attr("type","text")
$("#toggle-password1 .toggle-icon").addClass("fa-eye-slash");
$("#toggle-password1 .toggle-icon").removeClass("fa-eye");
}
});
$("#toggle-password2").on("click",function(a){
a.preventDefault();
if("text"==$("#new_password2").attr("type")){
$("#new_password2").attr("type","password")
$("#toggle-password2 .toggle-icon").removeClass("fa-eye-slash");
$("#toggle-password2 .toggle-icon").addClass("fa-eye");
}else{
$("#new_password2").attr("type","text")
$("#toggle-password2 .toggle-icon").addClass("fa-eye-slash");
$("#toggle-password2 .toggle-icon").removeClass("fa-eye");
}
});
</script>
{% endblock %}
......@@ -32,18 +32,18 @@
<div class="form-group form-group-lg col-sm-12">
<label for="password" class="form-required">Nueva Contraseña</label>
<div class="input-group">
<input class="form-control" type="password" id="pwd" name="new_password1" size="60" maxlength="255" required="required" aria-required="true">
<input class="form-control" type="password" id="new_password1" name="new_password1" size="60" maxlength="255" required="required" aria-required="true">
<div class="input-group-addon">
<button id="toggle-password" class="toggle-button"><i class="fa fa-eye fa-lg toggle-icon"></i><span class="sr-only">Mostrar y ocultar contraseña</span></button>
<button id="toggle-password1" class="toggle-button"><i class="fa fa-eye fa-lg toggle-icon"></i><span class="sr-only">Mostrar y ocultar contraseña</span></button>
</div>
</div>
</div>
<div class="form-group form-group-lg col-sm-12">
<label for="newPassword" class="form-required">Nueva contraseña (Confirmación)</label>
<div class="input-group">
<input class="form-control" type="password" id="newPwd" name="new_password2" size="60" maxlength="255" required="required" aria-required="true">
<input class="form-control" type="password" id="new_password2" name="new_password2" size="60" maxlength="255" required="required" aria-required="true">
<div class="input-group-addon">
<button id="toggle-newPassword" class="toggle-button"><i class="fa fa-eye fa-lg toggle-icon"></i><span class="sr-only">Mostrar y ocultar contraseña</span></button>
<button id="toggle-password2" class="toggle-button"><i class="fa fa-eye fa-lg toggle-icon"></i><span class="sr-only">Mostrar y ocultar contraseña</span></button>
</div>
</div>
</div>
......@@ -58,7 +58,82 @@
</div>
</main>
{% include 'footer.html' %}
<script>
var container = $('div.alert');
$("form").validate({
focusInvalid: false,
errorContainer: container,
errorLabelContainer: $("ul", container),
wrapper: 'li',
highlight: function(element) {
$(element).closest('.form-group').addClass('has-error');
},
unhighlight: function(element) {
$(element).closest('.form-group').removeClass('has-error');
},
messages: {
new_password1: {
required: "Ingresá una contraseña",
minlength: "La contraseña debe tener al menos 8 caracteres"
},
new_password2: {
required: "Ingresá la confirmación de la contraseña",
minlength: "La confirmación de la contraseña debe tener al menos 8 caracteres",
equalTo: "Ingresá el mismo valor en la confirmación"
}
},
rules:{
new_password1: {
required: true,
minlength: 8,
maxlength: 40
},
new_password2: {
required: true,
equalTo: '#new_password1'
}
}
});
$("#toggle-password1").on("click",function(a){
a.preventDefault();
if("text"==$("#new_password1").attr("type")){
$("#new_password1").attr("type","password")
$("#toggle-password1 .toggle-icon").removeClass("fa-eye-slash");
$("#toggle-password1 .toggle-icon").addClass("fa-eye");
}else{
$("#new_password1").attr("type","text")
$("#toggle-password1 .toggle-icon").addClass("fa-eye-slash");
$("#toggle-password1 .toggle-icon").removeClass("fa-eye");
}
});
$("#toggle-password2").on("click",function(a){
a.preventDefault();
if("text"==$("#new_password2").attr("type")){
$("#new_password2").attr("type","password")
$("#toggle-password2 .toggle-icon").removeClass("fa-eye-slash");
$("#toggle-password2 .toggle-icon").addClass("fa-eye");
}else{
$("#new_password2").attr("type","text")
$("#toggle-password2 .toggle-icon").addClass("fa-eye-slash");
$("#toggle-password2 .toggle-icon").removeClass("fa-eye");
}
});
</script>
</body>
</html>
......
......@@ -167,8 +167,7 @@
<table role="presentation" cellspacing="0" cellpadding="0" border="0" align="center" width="400" style="margin: auto;" class="email-container">
<tr>
<td style="padding: 30px; text-align: center; border-bottom: #DDD 1px solid" bgcolor="#ffffff" width="100px">
<a href="https://bfa.ar"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIsAAABkCAMAAACB1TOaAA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CGoW/Dt4l47JR+1yR5N4yD/XS/QgcimW6TqEZbWNZukAfekxgJ9d3g6WO1uOn7r8zOIAzS3kqFgY8xIWOak0S/T7NGnkxYNbs2axxMrNb3XWTpa25r2PimX2aRjCsk4zVZ5uvXVsBaiCByPOOQ9dWAiGoceXPbZ2sqRvFxZwmoUX3ywBESuAT1wkOGUwDPg5t07g7EnHhvfgmIWtPvJ7pFiKPzzUk6WD+TYCHiyxArGoVzGqJrzCfu/KkrLdmYURGbZLdXrzskd1H5QBkmKRTv1YFvFzRt9nroHYOk+ypNtlWayNbFwBLoNoXHy7vxjuBPZK3/uL3cbPr/zK/4hH5IssSmugb/FhCVnqX249usp6W5GCXLp9bXaF4CmamBoisIntaFkjqe6r2hWfGrHUhyV19qnljaVWRkDqMSagLkkqhK/fHwIehCVE0VKgsdo8lxUaxTdC1pbCT16uEE+W1FyX8KXsPyAqKBbzztKbaMPREwVeapHG5QtZWQyf7dGb6k6WgSPwDhqfFguiCooxWGFRAxINymI0r3sUHhZXaKBv6/BkCdbKmS0TtsZPRhUCPzm8s0S222avwEZdqZiXxQndLMpG5lkaRkpS9oEoxwrMifG16YZAMr6zfC7k7af4fwCKrEw8rC+NzAAAAABJRU5ErkJggg==
" width="139" height="100" alt="NIC Argentina" border="0" style="background: #dddddd; color: #555555;"></a>
<a href="https://bfa.ar"><img src="https://bfa.ar/themes/bfa/logo.svg" width="139" height="100" alt="NIC Argentina" border="0" style="background: #ffffff; color: #555555;"></a>
</td>
</tr>
</table>
......
......@@ -36,7 +36,7 @@
<div class="alert alert-danger" role="alert">
<p>El usuario y/o contraseña que ingresaste son inválidos. <a href="#">¿Olvidaste tu contraseña?</a></p>
<p>El usuario y/o contraseña que ingresaste son inválidos. <a href="/password_reset/">¿Olvidaste tu contraseña?</a></p>
<ul></ul>
</div>
......
......@@ -52,6 +52,7 @@ class RegistrationView(RegistrationView):
Handle POST requests: instantiate a form instance with the passed
POST variables and then check if it's valid.
"""
form = self.get_form()
if form.is_valid():
......@@ -126,7 +127,7 @@ class RegistrationView(RegistrationView):
try:
user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL, html_message=message)
except Exception:
except Exception as e:
pass
......@@ -224,10 +225,11 @@ class CustomUserAccountCreateView(LoginRequiredMixin, CreateView):
send_mail(
render_to_string('django_registration/approve_account_subject.txt'),
render_to_string('django_registration/approve_account_body.txt', body_context),
render_to_string('django_registration/approve_account_body.html', body_context),
settings.DEFAULT_FROM_EMAIL,
list(account_users.values_list('email', flat=True)),
fail_silently=False,
html_message=render_to_string('django_registration/approve_account_body.html', body_context)
)
messages.success(request, (_('existing_account_added') % (account.address)))
......@@ -248,7 +250,54 @@ class AccountDeleteView(LoginRequiredMixin, DeleteView):
model = CustomUserAccount
success_url = '/accounts/list/'
def post(self, request, *args, **kwargs):
try:
with transaction.atomic():
customuser_account = self.get_object()
custom_user = CustomUser.objects.get(user_id=request.user.id)
if customuser_account.account.owner == custom_user:
accounts = CustomUserAccount.objects.filter(account_id=customuser_account.account_id)
if accounts.count() > 1:
error_message = 'Los siguientes usuarios tienen vinculada la cuenta, deben desvincularla para poder ser borrada: <br/><ul>'
for a in accounts:
if a.user.user.id != request.user.id:
error_message = error_message + '<li>' + a.user.user.username + ' - ' + a.user.user.email + '</li>'
error_message = error_message + '</ul>'
messages.error(request, error_message, extra_tags='danger')
else:
account = Account.objects.get(pk=customuser_account.account_id)
account_address = customuser_account.account.address
customuser_account.delete()
account.delete()
service = Service.objects.get(pk=account.service_id)
service.delete()
messages.success(request, _('cuenta_borrada') % account_address)
else:
customuser_account.delete()
messages.success(request, _('cuenta_desvinculada') % customuser_account.account.address)
except Exception as e:
client.captureException()
messages.error(request, _('error_borrar_cuenta'), extra_tags='danger')
logger.error(str(e))
return HttpResponseRedirect(self.success_url)
@login_required(login_url='/accounts/login/')
def require_ether(request):
try:
petitorio = PetitorioEtherCuenta()
......@@ -278,6 +327,8 @@ class CaptchaLoginView(LoginView):
form = self.get_form()
if form.is_valid():
return self.form_valid(form)
''' Begin reCAPTCHA validation '''
recaptcha_response = request.POST.get('g-recaptcha-response')
data = {
......@@ -299,6 +350,9 @@ class CaptchaLoginView(LoginView):
@csrf_exempt
def get_service_address(request):
if not request.POST['service']:
return JsonResponse({'status': 'success', 'address': ''})
account = Account.objects.filter(service=Service.objects.get(pk=request.POST['service']))
return JsonResponse({'status':'success', 'address': account.values().first()['address']})
......@@ -312,7 +366,6 @@ def approve_account(request, pk):
return HttpResponseRedirect('/accounts/approved/')
def account_approved(request):
return render(request, 'django_registration/account_approved.html')
......@@ -333,18 +386,23 @@ def update_user(request):
return render(request, 'django_registration/update_user.html', context)
else:
user.first_name = request.POST['first_name']
user.last_name = request.POST['last_name']
user.email = request.POST['email']
user.save()
try:
with transaction.atomic():
custom_user.cuit = request.POST['cuit']
custom_user.organization = request.POST['organization']
custom_user.rol = request.POST['rol']
custom_user.section_id = request.POST['section']
custom_user.save()
user.first_name = request.POST['first_name']
user.last_name = request.POST['last_name']
user.email = request.POST['email']
user.save()
messages.success(request, _('user_updated'))
custom_user.cuit = request.POST['cuit']
custom_user.organization = request.POST['organization']
custom_user.rol = request.POST['rol']
custom_user.section_id = request.POST['section']
custom_user.save()
messages.success(request, _('user_updated'))
except Exception:
messages.error(request, _('user_update_error'), extra_tags='danger')
return HttpResponseRedirect('/mis_datos/')
......
No preview for this file type
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-18 15:06-0300\n"
"POT-Creation-Date: 2019-01-31 11:11-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -27,39 +27,39 @@ msgstr ""
msgid "%(address)s is not a valid address"
msgstr ""
#: frontend/forms.py:22
#: frontend/forms.py:21
msgid "public"
msgstr ""
#: frontend/forms.py:23
#: frontend/forms.py:22
msgid "private"
msgstr ""
#: frontend/forms.py:24
#: frontend/forms.py:23
msgid "academic"
msgstr ""
#: frontend/forms.py:25
#: frontend/forms.py:24
msgid "person"
msgstr ""
#: frontend/forms.py:28
#: frontend/forms.py:27
msgid "first_name"
msgstr ""
#: frontend/forms.py:29
#: frontend/forms.py:28
msgid "last_name"
msgstr ""
#: frontend/forms.py:31
#: frontend/forms.py:30
msgid "email"
msgstr ""
#: frontend/forms.py:38
#: frontend/forms.py:37
msgid "ya_existe_usuario_email"
msgstr ""
#: frontend/forms.py:41
#: frontend/forms.py:40
msgid "ya_existe_usuario_username"
msgstr ""
......@@ -86,16 +86,16 @@ msgstr ""
msgid "cancelar"
msgstr ""
#: frontend/templates/dapp/account_list.html:19
#: frontend/templates/dapp/account_list.html:10
msgid "cuentas"
msgstr ""
#: frontend/templates/dapp/account_list.html:95
#: frontend/templates/dapp/account_list.html:100
#: frontend/templates/dapp/account_list.html:93
#: frontend/templates/dapp/account_list.html:98
msgid "no_se_encontraron_cuentas"
msgstr ""
#: frontend/templates/dapp/account_list.html:215
#: frontend/templates/dapp/account_list.html:212
msgid "no_se_encontraron_cuentas_existentes"
msgstr ""
......@@ -143,32 +143,32 @@ msgstr ""
msgid "password_reset_complete"
msgstr ""
#: frontend/views.py:72 frontend/views.py:298
#: frontend/views.py:72 frontend/views.py:344
msgid "invalid_captcha"
msgstr "No reCAPTCHA"
#: frontend/views.py:99
#: frontend/views.py:98
msgid "error_register"
msgstr ""
#: frontend/views.py:177
#: frontend/views.py:176
msgid "account_added"
msgstr ""
#: frontend/views.py:179
#: frontend/views.py:178
msgid "existing_account"
msgstr ""
#: frontend/views.py:181
#: frontend/views.py:180
msgid "address_not_valid"
msgstr ""
#: frontend/views.py:184 frontend/views.py:186 frontend/views.py:189
#: frontend/views.py:183 frontend/views.py:185 frontend/views.py:188
#: frontend/views.py:240 frontend/views.py:243
msgid "error_create_view"
msgstr ""
#: frontend/views.py:184
#: frontend/views.py:183
msgid "existing_service"
msgstr ""
......@@ -180,18 +180,34 @@ msgstr ""
msgid "user_already_has_account"
msgstr ""
#: frontend/views.py:259
#: frontend/views.py:286
msgid "cuenta_borrada"
msgstr ""
#: frontend/views.py:290
msgid "cuenta_desvinculada"
msgstr ""
#: frontend/views.py:293
msgid "error_borrar_cuenta"
msgstr ""
#: frontend/views.py:305
msgid "ether_solicitado"
msgstr ""
#: frontend/views.py:262
#: frontend/views.py:308
msgid "error_peticion_ether"
msgstr ""
#: frontend/views.py:351
#: frontend/views.py:403
msgid "user_updated"
msgstr ""
#: frontend/views.py:365
#: frontend/views.py:405
msgid "user_update_error"
msgstr ""
#: frontend/views.py:420
msgid "password_changed"
msgstr ""
No preview for this file type
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-18 15:06-0300\n"
"POT-Creation-Date: 2019-01-31 11:11-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -27,39 +27,39 @@ msgstr ""
msgid "%(address)s is not a valid address"
msgstr ""
#: frontend/forms.py:22
#: frontend/forms.py:21
msgid "public"
msgstr "Público"
#: frontend/forms.py:23
#: frontend/forms.py:22
msgid "private"
msgstr "Privado"
#: frontend/forms.py:24
#: frontend/forms.py:23
msgid "academic"
msgstr "Académico"
#: frontend/forms.py:25
#: frontend/forms.py:24
msgid "person"
msgstr "Persona"
#: frontend/forms.py:28
#: frontend/forms.py:27
msgid "first_name"
msgstr "Nombre"
#: frontend/forms.py:29
#: frontend/forms.py:28
msgid "last_name"
msgstr "Apellido"
#: frontend/forms.py:31
#: frontend/forms.py:30
msgid "email"
msgstr "E-Mail"
#: frontend/forms.py:38
#: frontend/forms.py:37
msgid "ya_existe_usuario_email"
msgstr "Ya existe un registro con ese E-mail"
#: frontend/forms.py:41
#: frontend/forms.py:40
msgid "ya_existe_usuario_username"
msgstr "Ya existe un registro con ese usuario"
......@@ -86,16 +86,16 @@ msgstr "Agregar"
msgid "cancelar"
msgstr "Cancelar"
#: frontend/templates/dapp/account_list.html:19
#: frontend/templates/dapp/account_list.html:10
msgid "cuentas"
msgstr "Cuentas"
#: frontend/templates/dapp/account_list.html:95
#: frontend/templates/dapp/account_list.html:100
#: frontend/templates/dapp/account_list.html:93
#: frontend/templates/dapp/account_list.html:98
msgid "no_se_encontraron_cuentas"
msgstr "Todavía no tenés cuentas asociadas a tu usuario."
#: frontend/templates/dapp/account_list.html:215
#: frontend/templates/dapp/account_list.html:212
msgid "no_se_encontraron_cuentas_existentes"
msgstr "No se encontraron cuentas existentes para agregar"
......@@ -143,32 +143,32 @@ msgstr "¿Olvidaste tu contraseña?"
msgid "password_reset_complete"
msgstr "Tu contraseña ha sido cambiada"
#: frontend/views.py:72 frontend/views.py:298
#: frontend/views.py:72 frontend/views.py:344
msgid "invalid_captcha"
msgstr "Completá el captcha"
#: frontend/views.py:99
#: frontend/views.py:98
msgid "error_register"
msgstr "Ocurrió un error al realizar el registro"
#: frontend/views.py:177
#: frontend/views.py:176
msgid "account_added"
msgstr "Cuenta %s agregada"
#: frontend/views.py:179
#: frontend/views.py:178
msgid "existing_account"
msgstr "La cuenta %s ya se encuentra registrada"
#: frontend/views.py:181
#: frontend/views.py:180
msgid "address_not_valid"
msgstr "La dirección %s no es válida"
#: frontend/views.py:184 frontend/views.py:186 frontend/views.py:189
#: frontend/views.py:183 frontend/views.py:185 frontend/views.py:188
#: frontend/views.py:240 frontend/views.py:243
msgid "error_create_view"
msgstr "Ocurrió un error al intentar agregar la cuenta"
#: frontend/views.py:184
#: frontend/views.py:183
msgid "existing_service"
msgstr "Ya existe un servicio llamado %s"
......@@ -180,20 +180,36 @@ msgstr "La cuenta existente %s fue agregada"
msgid "user_already_has_account"
msgstr "La cuenta %s ya ha sido vinculada"
#: frontend/views.py:259
#: frontend/views.py:286
msgid "cuenta_borrada"
msgstr "La cuenta %s ha sido borrada"
#: frontend/views.py:290
msgid "cuenta_desvinculada"
msgstr "La cuenta %s ha sido desvinculada"
#: frontend/views.py:293
msgid "error_borrar_cuenta"
msgstr "Ocurrió un error al intentar borrar la cuenta"
#: frontend/views.py:305
msgid "ether_solicitado"
msgstr ""
"Su solicitud de carga para la cuenta %s será evaluada por los "
"administradores. Nos contactaremos a la brevedad."
#: frontend/views.py:262
#: frontend/views.py:308
msgid "error_peticion_ether"
msgstr "No se pudo realizar la petición"
#: frontend/views.py:351
#: frontend/views.py:403
msgid "user_updated"
msgstr "Usuario modificado"
#: frontend/views.py:365
#: frontend/views.py:405
msgid "user_update_error"
msgstr "Ocurrió un error al intentar modificar el usuario"
#: frontend/views.py:420
msgid "password_changed"
msgstr "Contraseña modificada. Por favor ingresá nuevamente"
......@@ -26,6 +26,7 @@ class AltaCuentaEthereum:
tope_manager = TopeEsperado.objects
verificador_cuenta = VerificacionCuenta()
relacion_sin_verificar = RelacionUsuarioAccountStatus.objects.get_sin_verificar_relacion
relacion_verificada = RelacionUsuarioAccountStatus.objects.get_relacion_verificada
def alta_cuenta_ethereum(self, address, institution, service, user, tope=0):
if self.relacion_manager.cant_cuentas_sin_verificar_por_user(user) > 4:
......@@ -33,11 +34,11 @@ class AltaCuentaEthereum:
with transaction.atomic():
self.account_manager.create(address=address, institution=institution,
service=service)
service=service, owner=user)
account = self.account_manager.filter(address=address).first()
self.tope_manager.create(valor=tope, account=account)
clave = self.verificador_cuenta.iniciar_verificacion(account)
funcion = self.relacion_sin_verificar
funcion = self.relacion_verificada
self.relacion_manager.create(user=user, account=account, status=funcion())
return account, clave
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment