Merge pull request 'events' (#76) from events into main

Reviewed-on: https://gitea.pangea.org/trustchain-oc1-orchestral/IdHub/pulls/76
This commit is contained in:
cayop 2023-11-14 16:50:47 +00:00
commit 6636225b7f
30 changed files with 4323 additions and 857 deletions

View File

@ -1,15 +1,18 @@
import csv
import json
import copy
import pandas as pd
from jsonschema import validate
from django import forms
from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ValidationError
from idhub.models import (
DID,
File_datas,
File_datas,
Membership,
Schemas,
Service,
UserRol,
VerificableCredential,
)
from idhub_auth.models import User
@ -104,14 +107,14 @@ class ImportForm(forms.Form):
user = User.objects.filter(email=row.get('email'))
if not user:
txt = _('The user not exist!')
txt = _('The user does not exist!')
msg = "line {}: {}".format(line+1, txt)
self.exception(msg)
return user.first()
def create_credential(self, user, row):
d = copy.copy(self.json_schema)
d = self.json_schema.copy()
d['instance'] = row
return VerificableCredential(
verified=False,
@ -126,3 +129,65 @@ class ImportForm(forms.Form):
class SchemaForm(forms.Form):
file_template = forms.FileField()
class MembershipForm(forms.ModelForm):
class Meta:
model = Membership
fields = ['type', 'start_date', 'end_date']
def clean_end_date(self):
data = super().clean()
start_date = data['start_date']
end_date = data.get('end_date')
members = Membership.objects.filter(
type=data['type'],
user=self.instance.user
)
if self.instance.id:
members = members.exclude(id=self.instance.id)
if (start_date and end_date):
if start_date > end_date:
msg = _("The end date is less than the start date")
raise forms.ValidationError(msg)
members = members.filter(
start_date__lte=end_date,
end_date__gte=start_date,
)
if members.exists():
msg = _("This membership already exists!")
raise forms.ValidationError(msg)
return end_date
class UserRolForm(forms.ModelForm):
class Meta:
model = UserRol
fields = ['service']
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if not self.instance.id:
user = self.instance.user
choices = self.fields['service'].choices
choices.queryset = choices.queryset.exclude(users__user=user)
self.fields['service'].choices = choices
def clean_service(self):
data = super().clean()
service = UserRol.objects.filter(
service=data['service'],
user=self.instance.user
)
if service.exists():
msg = _("Is not possible to have a duplicate role")
raise forms.ValidationError(msg)
return data['service']

View File

@ -1,6 +1,5 @@
import os
import json
import copy
import logging
import pandas as pd
from pathlib import Path
@ -23,11 +22,18 @@ from django.contrib import messages
from utils.apiregiter import iota
from utils import credtools
from idhub_auth.models import User
from idhub_auth.forms import ProfileForm
from idhub.mixins import AdminView
from idhub.email.views import NotifyActivateUserByEmail
from idhub.admin.forms import ImportForm, SchemaForm
from idhub.admin.forms import (
ImportForm,
MembershipForm,
SchemaForm,
UserRolForm,
)
from idhub.models import (
DID,
Event,
File_datas,
Membership,
Rol,
@ -45,34 +51,41 @@ class DashboardView(AdminView, TemplateView):
icon = 'bi bi-bell'
section = "Home"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({
'events': Event.objects.filter(user=None),
})
return context
class People(AdminView):
title = _("People Management")
title = _("User Management")
section = "People"
class AccessControl(AdminView, TemplateView):
title = _("Access Control Management")
title = _("Access control management")
section = "AccessControl"
class Credentials(AdminView, TemplateView):
title = _("Credentials Management")
section = "Credentials"
title = _("Credential Management")
section = "Credential"
class SchemasMix(AdminView, TemplateView):
title = _("Templates Management")
section = "Templates"
title = _("Template Management")
section = "Template"
class ImportExport(AdminView):
title = _("Massive Data Management")
title = _("Data file management")
section = "ImportExport"
class PeopleListView(People, TemplateView):
template_name = "idhub/admin/people.html"
subtitle = _('People list')
subtitle = _('View users')
icon = 'bi bi-person'
def get_context_data(self, **kwargs):
@ -85,7 +98,7 @@ class PeopleListView(People, TemplateView):
class PeopleView(People, TemplateView):
template_name = "idhub/admin/user.html"
subtitle = _('User Profile')
subtitle = _('User personal information')
icon = 'bi bi-person'
model = User
@ -114,8 +127,10 @@ class PeopleActivateView(PeopleView):
if self.object.is_active:
self.object.is_active = False
Event.set_EV_USR_DEACTIVATED_BY_ADMIN(self.object)
else:
self.object.is_active = True
Event.set_EV_USR_ACTIVATED_BY_ADMIN(self.object)
self.object.save()
return redirect('idhub:admin_people', self.object.id)
@ -128,24 +143,57 @@ class PeopleDeleteView(PeopleView):
self.object = get_object_or_404(self.model, pk=self.pk)
if self.object != self.request.user:
Event.set_EV_USR_DELETED_BY_ADMIN(self.object)
self.object.delete()
else:
messages.error(self.request, _('Is not possible delete your account!'))
return redirect('idhub:admin_people_list')
class PeopleEditView(PeopleView, UpdateView):
class PeopleEditView(People, FormView):
template_name = "idhub/admin/user_edit.html"
fields = ('first_name', 'last_name', 'email')
subtitle = _('Update user')
icon = 'bi bi-person'
form_class = ProfileForm
success_url = reverse_lazy('idhub:admin_people_list')
def get(self, request, *args, **kwargs):
self.pk = kwargs['pk']
self.user = get_object_or_404(User, pk=self.pk)
return super().get(request, *args, **kwargs)
def post(self, request, *args, **kwargs):
self.pk = kwargs['pk']
self.user = get_object_or_404(User, pk=self.pk)
return super().post(request, *args, **kwargs)
def get_form_kwargs(self):
kwargs = super().get_form_kwargs()
kwargs['instance'] = self.user
return kwargs
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({
'object': self.user,
})
return context
def form_valid(self, form):
user = form.save()
messages.success(self.request, _('The account is updated successfully'))
Event.set_EV_USR_UPDATED_BY_ADMIN(user)
Event.set_EV_USR_UPDATED(user)
return super().form_valid(form)
class PeopleRegisterView(NotifyActivateUserByEmail, People, CreateView):
template_name = "idhub/admin/people_register.html"
subtitle = _('People Register')
subtitle = _('Add user')
icon = 'bi bi-person'
model = User
fields = ('first_name', 'last_name', 'email')
form_class = ProfileForm
success_url = reverse_lazy('idhub:admin_people_list')
def get_success_url(self):
@ -157,7 +205,10 @@ class PeopleRegisterView(NotifyActivateUserByEmail, People, CreateView):
def form_valid(self, form):
user = form.save()
messages.success(self.request, _('The account is created successfully'))
messages.success(self.request, _('The account was created successfully'))
Event.set_EV_USR_REGISTERED(user)
Event.set_EV_USR_WELCOME(user)
if user.is_active:
try:
self.send_email(user)
@ -166,12 +217,12 @@ class PeopleRegisterView(NotifyActivateUserByEmail, People, CreateView):
return super().form_valid(form)
class PeopleMembershipRegisterView(People, CreateView):
class PeopleMembershipRegisterView(People, FormView):
template_name = "idhub/admin/people_membership_register.html"
subtitle = _('People add membership')
subtitle = _('Associate a membership to the user')
icon = 'bi bi-person'
form_class = MembershipForm
model = Membership
fields = ('type', 'start_date', 'end_date')
success_url = reverse_lazy('idhub:admin_people_list')
def get(self, request, *args, **kwargs):
@ -188,12 +239,19 @@ class PeopleMembershipRegisterView(People, CreateView):
form = super().get_form()
form.fields['start_date'].widget.input_type = 'date'
form.fields['end_date'].widget.input_type = 'date'
form.fields['start_date'].required = True
return form
def get_form_kwargs(self):
self.object = self.model(user=self.user)
kwargs = super().get_form_kwargs()
kwargs['instance'] = self.object
return kwargs
def form_valid(self, form):
form.save()
messages.success(self.request, _('Membership created successfully'))
return super().form_valid(form)
def get_success_url(self):
self.success_url = reverse_lazy(
@ -203,27 +261,43 @@ class PeopleMembershipRegisterView(People, CreateView):
return self.success_url
class PeopleMembershipEditView(People, CreateView):
class PeopleMembershipEditView(People, FormView):
template_name = "idhub/admin/people_membership_register.html"
subtitle = _('People add membership')
subtitle = _('Associate a membership to the user')
icon = 'bi bi-person'
form_class = MembershipForm
model = Membership
fields = ('type', 'start_date', 'end_date')
success_url = reverse_lazy('idhub:admin_people_list')
def get(self, request, *args, **kwargs):
self.pk = kwargs['pk']
self.object = get_object_or_404(self.model, pk=self.pk)
self.user = self.object.user
return super().get(request, *args, **kwargs)
def post(self, request, *args, **kwargs):
self.pk = kwargs['pk']
self.object = get_object_or_404(self.model, pk=self.pk)
self.user = self.object.user
return super().post(request, *args, **kwargs)
def get_form(self):
form = super().get_form()
form.fields['start_date'].widget.input_type = 'date'
form.fields['end_date'].widget.input_type = 'date'
form.fields['start_date'].required = True
return form
def get_form_kwargs(self):
pk = self.kwargs.get('pk')
if pk:
self.object = get_object_or_404(self.model, pk=pk)
kwargs = super().get_form_kwargs()
kwargs['instance'] = self.object
return kwargs
def form_valid(self, form):
form.save()
messages.success(self.request, _('Membership updated successfully'))
return super().form_valid(form)
class PeopleMembershipDeleteView(PeopleView):
model = Membership
@ -241,12 +315,12 @@ class PeopleMembershipDeleteView(PeopleView):
return redirect('idhub:admin_people_edit', user.id)
class PeopleRolRegisterView(People, CreateView):
class PeopleRolRegisterView(People, FormView):
template_name = "idhub/admin/people_rol_register.html"
subtitle = _('Add Rol to User')
subtitle = _('Add a user role to access a service')
icon = 'bi bi-person'
form_class = UserRolForm
model = UserRol
fields = ('service',)
def get(self, request, *args, **kwargs):
self.pk = kwargs['pk']
@ -261,8 +335,14 @@ class PeopleRolRegisterView(People, CreateView):
def get_form_kwargs(self):
self.object = self.model(user=self.user)
kwargs = super().get_form_kwargs()
kwargs['instance'] = self.object
return kwargs
def form_valid(self, form):
form.save()
messages.success(self.request, _('Membership created successfully'))
return super().form_valid(form)
def get_success_url(self):
self.success_url = reverse_lazy(
'idhub:admin_people_edit',
@ -271,20 +351,33 @@ class PeopleRolRegisterView(People, CreateView):
return self.success_url
class PeopleRolEditView(People, CreateView):
class PeopleRolEditView(People, FormView):
template_name = "idhub/admin/people_rol_register.html"
subtitle = _('Edit Rol to User')
subtitle = _('Modify a user role to access a service')
icon = 'bi bi-person'
form_class = UserRolForm
model = UserRol
fields = ('service',)
def get(self, request, *args, **kwargs):
self.pk = kwargs['pk']
self.object = get_object_or_404(self.model, pk=self.pk)
return super().get(request, *args, **kwargs)
def post(self, request, *args, **kwargs):
self.pk = kwargs['pk']
self.object = get_object_or_404(self.model, pk=self.pk)
return super().post(request, *args, **kwargs)
def get_form_kwargs(self):
pk = self.kwargs.get('pk')
if pk:
self.object = get_object_or_404(self.model, pk=pk)
kwargs = super().get_form_kwargs()
kwargs['instance'] = self.object
return kwargs
def form_valid(self, form):
form.save()
messages.success(self.request, _('Membership updated successfully'))
return super().form_valid(form)
def get_success_url(self):
self.success_url = reverse_lazy(
'idhub:admin_people_edit',
@ -308,7 +401,7 @@ class PeopleRolDeleteView(PeopleView):
class RolesView(AccessControl):
template_name = "idhub/admin/roles.html"
subtitle = _('Roles Management')
subtitle = _('Manage roles')
icon = ''
def get_context_data(self, **kwargs):
@ -320,20 +413,26 @@ class RolesView(AccessControl):
class RolRegisterView(AccessControl, CreateView):
template_name = "idhub/admin/rol_register.html"
subtitle = _('Add Rol')
subtitle = _('Add Role')
icon = ''
model = Rol
fields = ('name',)
fields = ('name', "description")
success_url = reverse_lazy('idhub:admin_roles')
object = None
def form_valid(self, form):
form.save()
messages.success(self.request, _('Role created successfully'))
Event.set_EV_ROLE_CREATED_BY_ADMIN()
return super().form_valid(form)
class RolEditView(AccessControl, CreateView):
class RolEditView(AccessControl, UpdateView):
template_name = "idhub/admin/rol_register.html"
subtitle = _('Edit Rol')
subtitle = _('Edit Role')
icon = ''
model = Rol
fields = ('name',)
fields = ('name', "description")
success_url = reverse_lazy('idhub:admin_roles')
def get_form_kwargs(self):
@ -342,6 +441,12 @@ class RolEditView(AccessControl, CreateView):
self.object = get_object_or_404(self.model, pk=pk)
kwargs = super().get_form_kwargs()
return kwargs
def form_valid(self, form):
form.save()
messages.success(self.request, _('Role updated successfully'))
Event.set_EV_ROLE_MODIFIED_BY_ADMIN()
return super().form_valid(form)
class RolDeleteView(AccessControl):
@ -352,12 +457,14 @@ class RolDeleteView(AccessControl):
self.object = get_object_or_404(self.model, pk=self.pk)
self.object.delete()
messages.success(self.request, _('Role deleted successfully'))
Event.set_EV_ROLE_DELETED_BY_ADMIN()
return redirect('idhub:admin_roles')
class ServicesView(AccessControl):
template_name = "idhub/admin/services.html"
subtitle = _('Service Management')
subtitle = _('Manage services')
icon = ''
def get_context_data(self, **kwargs):
@ -369,17 +476,28 @@ class ServicesView(AccessControl):
class ServiceRegisterView(AccessControl, CreateView):
template_name = "idhub/admin/service_register.html"
subtitle = _('Add Service')
subtitle = _('Add service')
icon = ''
model = Service
fields = ('domain', 'description', 'rol')
success_url = reverse_lazy('idhub:admin_services')
object = None
def get_form(self):
form = super().get_form()
form.fields['rol'].required = False
return form
def form_valid(self, form):
form.save()
messages.success(self.request, _('Service created successfully'))
Event.set_EV_SERVICE_CREATED_BY_ADMIN()
return super().form_valid(form)
class ServiceEditView(AccessControl, CreateView):
class ServiceEditView(AccessControl, UpdateView):
template_name = "idhub/admin/service_register.html"
subtitle = _('Edit Service')
subtitle = _('Modify service')
icon = ''
model = Service
fields = ('domain', 'description', 'rol')
@ -392,6 +510,17 @@ class ServiceEditView(AccessControl, CreateView):
kwargs = super().get_form_kwargs()
return kwargs
def get_form(self):
form = super().get_form()
form.fields['rol'].required = False
return form
def form_valid(self, form):
form.save()
messages.success(self.request, _('Service updated successfully'))
Event.set_EV_SERVICE_MODIFIED_BY_ADMIN()
return super().form_valid(form)
class ServiceDeleteView(AccessControl):
model = Service
@ -401,12 +530,14 @@ class ServiceDeleteView(AccessControl):
self.object = get_object_or_404(self.model, pk=self.pk)
self.object.delete()
messages.success(self.request, _('Service deleted successfully'))
Event.set_EV_SERVICE_DELETED_BY_ADMIN()
return redirect('idhub:admin_services')
class CredentialsView(Credentials):
template_name = "idhub/admin/credentials.html"
subtitle = _('Credentials list')
subtitle = _('View credentials')
icon = ''
def get_context_data(self, **kwargs):
@ -462,6 +593,8 @@ class RevokeCredentialsView(Credentials):
self.object.status = VerificableCredential.Status.REVOKED
self.object.save()
messages.success(self.request, _('Credential revoked successfully'))
Event.set_EV_CREDENTIAL_REVOKED_BY_ADMIN(self.object)
Event.set_EV_CREDENTIAL_REVOKED(self.object)
return redirect(self.success_url)
@ -482,13 +615,15 @@ class DeleteCredentialsView(Credentials):
if self.object.status in status:
self.object.delete()
messages.success(self.request, _('Credential deleted successfully'))
Event.set_EV_CREDENTIAL_DELETED(self.object)
Event.set_EV_CREDENTIAL_DELETED_BY_ADMIN(self.object)
return redirect(self.success_url)
class DidsView(Credentials):
template_name = "idhub/admin/dids.html"
subtitle = _('Organization Identities (DID)')
subtitle = _('Manage Identities (DID)')
icon = 'bi bi-patch-check-fill'
wallet = True
@ -514,6 +649,7 @@ class DidRegisterView(Credentials, CreateView):
form.instance.did = iota.issue_did()
form.save()
messages.success(self.request, _('DID created successfully'))
Event.set_EV_ORG_DID_CREATED_BY_ADMIN(form.instance)
return super().form_valid(form)
@ -547,29 +683,29 @@ class DidDeleteView(Credentials, DeleteView):
def get(self, request, *args, **kwargs):
self.pk = kwargs['pk']
self.object = get_object_or_404(self.model, pk=self.pk)
Event.set_EV_ORG_DID_DELETED_BY_ADMIN(self.object)
self.object.delete()
messages.success(self.request, _('DID delete successfully'))
return redirect(self.success_url)
class WalletCredentialsView(Credentials):
template_name = "idhub/admin/wallet_credentials.html"
subtitle = _('Credentials')
subtitle = _('View org. credentials')
icon = 'bi bi-patch-check-fill'
wallet = True
class WalletConfigIssuesView(Credentials):
template_name = "idhub/admin/wallet_issues.html"
subtitle = _('Configure Issues')
subtitle = _('Configure credential issuance')
icon = 'bi bi-patch-check-fill'
wallet = True
class SchemasView(SchemasMix):
template_name = "idhub/admin/schemas.html"
subtitle = _('Template List')
subtitle = _('View credential templates')
icon = ''
def get_context_data(self, **kwargs):
@ -603,7 +739,7 @@ class SchemasDownloadView(SchemasMix):
class SchemasNewView(SchemasMix):
template_name = "idhub/admin/schemas_new.html"
subtitle = _('Upload Template')
subtitle = _('Upload template')
icon = ''
success_url = reverse_lazy('idhub:admin_schemas')
@ -648,7 +784,7 @@ class SchemasNewView(SchemasMix):
class SchemasImportView(SchemasMix):
template_name = "idhub/admin/schemas_import.html"
subtitle = _('Import Template')
subtitle = _('Import template')
icon = ''
def get_context_data(self, **kwargs):
@ -676,7 +812,7 @@ class SchemasImportAddView(SchemasMix):
schema = self.create_schema(file_name)
if schema:
messages.success(self.request, _("The schema add successfully!"))
messages.success(self.request, _("The schema was added sucessfully"))
return redirect('idhub:admin_schemas_import')
def create_schema(self, file_name):
@ -701,7 +837,7 @@ class SchemasImportAddView(SchemasMix):
class ImportView(ImportExport, TemplateView):
template_name = "idhub/admin/import.html"
subtitle = _('Import')
subtitle = _('Import data')
icon = ''
def get_context_data(self, **kwargs):
@ -738,9 +874,12 @@ class ImportAddView(ImportExport, FormView):
return kwargs
def form_valid(self, form):
cred = form.save()
if cred:
creds = form.save()
if creds:
messages.success(self.request, _("The file import was successfully!"))
for cred in creds:
Event.set_EV_CREDENTIAL_ENABLED(cred)
Event.set_EV_CREDENTIAL_CAN_BE_REQUESTED(cred)
else:
messages.error(self.request, _("Error importing the file!"))
return super().form_valid(form)

View File

@ -1,4 +1,4 @@
# Generated by Django 4.2.5 on 2023-11-02 15:08
# Generated by Django 4.2.5 on 2023-11-14 16:32
from django.conf import settings
from django.db import migrations, models
@ -63,7 +63,13 @@ class Migration(migrations.Migration):
verbose_name='ID',
),
),
('name', models.CharField(max_length=250)),
('name', models.CharField(max_length=250, verbose_name='name')),
(
'description',
models.CharField(
max_length=250, null=True, verbose_name='Description'
),
),
],
),
migrations.CreateModel(
@ -95,8 +101,11 @@ class Migration(migrations.Migration):
verbose_name='ID',
),
),
('domain', models.CharField(max_length=250)),
('description', models.CharField(max_length=250)),
('domain', models.CharField(max_length=250, verbose_name='Domain')),
(
'description',
models.CharField(max_length=250, verbose_name='Description'),
),
('rol', models.ManyToManyField(to='idhub.rol')),
],
),
@ -131,7 +140,7 @@ class Migration(migrations.Migration):
('id_string', models.CharField(max_length=250)),
('verified', models.BooleanField()),
('created_on', models.DateTimeField(auto_now=True)),
('issuer_on', models.DateTimeField(null=True)),
('issued_on', models.DateTimeField(null=True)),
('did_issuer', models.CharField(max_length=250)),
('did_subject', models.CharField(max_length=250)),
('data', models.TextField()),
@ -157,6 +166,141 @@ class Migration(migrations.Migration):
),
],
),
migrations.CreateModel(
name='Membership',
fields=[
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
(
'type',
models.PositiveSmallIntegerField(
choices=[(1, 'Beneficiary'), (2, 'Employee'), (3, 'Member')],
verbose_name='Type of membership',
),
),
(
'start_date',
models.DateField(
blank=True,
help_text='What date did the membership start?',
null=True,
verbose_name='Start date',
),
),
(
'end_date',
models.DateField(
blank=True,
help_text='What date will the membership end?',
null=True,
verbose_name='End date',
),
),
(
'user',
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='memberships',
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.CreateModel(
name='Event',
fields=[
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
('created', models.DateTimeField(auto_now=True)),
('message', models.CharField(max_length=350)),
(
'type',
models.PositiveSmallIntegerField(
choices=[
(1, 'EV_USR_REGISTERED'),
(2, 'EV_USR_WELCOME'),
(3, 'EV_DATA_UPDATE_REQUESTED_BY_USER'),
(4, 'EV_DATA_UPDATE_REQUESTED'),
(5, 'EV_USR_UPDATED_BY_ADMIN'),
(6, 'EV_USR_UPDATED'),
(7, 'EV_USR_DELETED_BY_ADMIN'),
(8, 'EV_DID_CREATED_BY_USER'),
(9, 'EV_DID_CREATED'),
(10, 'EV_DID_DELETED'),
(11, 'EV_CREDENTIAL_DELETED_BY_ADMIN'),
(12, 'EV_CREDENTIAL_DELETED'),
(13, 'EV_CREDENTIAL_ISSUED_FOR_USER'),
(14, 'EV_CREDENTIAL_ISSUED'),
(15, 'EV_CREDENTIAL_PRESENTED_BY_USER'),
(16, 'EV_CREDENTIAL_PRESENTED'),
(17, 'EV_CREDENTIAL_ENABLED'),
(18, 'EV_CREDENTIAL_CAN_BE_REQUESTED'),
(19, 'EV_CREDENTIAL_REVOKED_BY_ADMIN'),
(20, 'EV_CREDENTIAL_REVOKED'),
(21, 'EV_ROLE_CREATED_BY_ADMIN'),
(22, 'EV_ROLE_MODIFIED_BY_ADMIN'),
(23, 'EV_ROLE_DELETED_BY_ADMIN'),
(24, 'EV_SERVICE_CREATED_BY_ADMIN'),
(25, 'EV_SERVICE_MODIFIED_BY_ADMIN'),
(26, 'EV_SERVICE_DELETED_BY_ADMIN'),
(27, 'EV_ORG_DID_CREATED_BY_ADMIN'),
(28, 'EV_ORG_DID_DELETED_BY_ADMIN'),
(29, 'EV_USR_DEACTIVATED_BY_ADMIN'),
(30, 'EV_USR_ACTIVATED_BY_ADMIN'),
]
),
),
(
'user',
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name='events',
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.CreateModel(
name='DID',
fields=[
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
('created_at', models.DateTimeField(auto_now=True)),
('did', models.CharField(max_length=250, unique=True)),
('label', models.CharField(max_length=50)),
(
'user',
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name='dids',
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.CreateModel(
name='UserRol',
fields=[
@ -186,78 +330,8 @@ class Migration(migrations.Migration):
),
),
],
),
migrations.CreateModel(
name='Membership',
fields=[
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
(
'type',
models.PositiveSmallIntegerField(
choices=[(1, 'Beneficiary'), (2, 'Employee'), (3, 'Partner')],
verbose_name='Type of membership',
),
),
(
'start_date',
models.DateField(
blank=True,
help_text='What date did the membership start?',
null=True,
verbose_name='Start date',
),
),
(
'end_date',
models.DateField(
blank=True,
help_text='What date did the membership end?',
null=True,
verbose_name='End date',
),
),
(
'user',
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='memberships',
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.CreateModel(
name='DID',
fields=[
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
('created_at', models.DateTimeField(auto_now=True)),
('did', models.CharField(max_length=250, unique=True)),
('label', models.CharField(max_length=50)),
(
'user',
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name='dids',
to=settings.AUTH_USER_MODEL,
),
),
],
options={
'unique_together': {('user', 'service')},
},
),
]

View File

@ -1,16 +1,398 @@
import json
import requests
import datetime
from django.db import models
from django.utils.translation import gettext_lazy as _
from idhub_auth.models import User
# class Event(models.Model):
# Para los "audit logs" que se requieren en las pantallas.
# timestamp = models.DateTimeField()
# Los eventos no tienen relación con otros objetos a nivel de BBDD.
# event_data = models.CharField(max_length=250)
class Event(models.Model):
class Types(models.IntegerChoices):
EV_USR_REGISTERED = 1, "EV_USR_REGISTERED"
EV_USR_WELCOME = 2, "EV_USR_WELCOME"
EV_DATA_UPDATE_REQUESTED_BY_USER = 3, "EV_DATA_UPDATE_REQUESTED_BY_USER"
EV_DATA_UPDATE_REQUESTED = 4, "EV_DATA_UPDATE_REQUESTED"
EV_USR_UPDATED_BY_ADMIN = 5, "EV_USR_UPDATED_BY_ADMIN"
EV_USR_UPDATED = 6, "EV_USR_UPDATED"
EV_USR_DELETED_BY_ADMIN = 7, "EV_USR_DELETED_BY_ADMIN"
EV_DID_CREATED_BY_USER = 8, "EV_DID_CREATED_BY_USER"
EV_DID_CREATED = 9, "EV_DID_CREATED"
EV_DID_DELETED = 10, "EV_DID_DELETED"
EV_CREDENTIAL_DELETED_BY_ADMIN = 11, "EV_CREDENTIAL_DELETED_BY_ADMIN"
EV_CREDENTIAL_DELETED = 12, "EV_CREDENTIAL_DELETED"
EV_CREDENTIAL_ISSUED_FOR_USER = 13, "EV_CREDENTIAL_ISSUED_FOR_USER"
EV_CREDENTIAL_ISSUED = 14, "EV_CREDENTIAL_ISSUED"
EV_CREDENTIAL_PRESENTED_BY_USER = 15, "EV_CREDENTIAL_PRESENTED_BY_USER"
EV_CREDENTIAL_PRESENTED = 16, "EV_CREDENTIAL_PRESENTED"
EV_CREDENTIAL_ENABLED = 17, "EV_CREDENTIAL_ENABLED"
EV_CREDENTIAL_CAN_BE_REQUESTED = 18, "EV_CREDENTIAL_CAN_BE_REQUESTED"
EV_CREDENTIAL_REVOKED_BY_ADMIN = 19, "EV_CREDENTIAL_REVOKED_BY_ADMIN"
EV_CREDENTIAL_REVOKED = 20, "EV_CREDENTIAL_REVOKED"
EV_ROLE_CREATED_BY_ADMIN = 21, "EV_ROLE_CREATED_BY_ADMIN"
EV_ROLE_MODIFIED_BY_ADMIN = 22, "EV_ROLE_MODIFIED_BY_ADMIN"
EV_ROLE_DELETED_BY_ADMIN = 23, "EV_ROLE_DELETED_BY_ADMIN"
EV_SERVICE_CREATED_BY_ADMIN = 24, "EV_SERVICE_CREATED_BY_ADMIN"
EV_SERVICE_MODIFIED_BY_ADMIN = 25, "EV_SERVICE_MODIFIED_BY_ADMIN"
EV_SERVICE_DELETED_BY_ADMIN = 26, "EV_SERVICE_DELETED_BY_ADMIN"
EV_ORG_DID_CREATED_BY_ADMIN = 27, "EV_ORG_DID_CREATED_BY_ADMIN"
EV_ORG_DID_DELETED_BY_ADMIN = 28, "EV_ORG_DID_DELETED_BY_ADMIN"
EV_USR_DEACTIVATED_BY_ADMIN = 29, "EV_USR_DEACTIVATED_BY_ADMIN"
EV_USR_ACTIVATED_BY_ADMIN = 30, "EV_USR_ACTIVATED_BY_ADMIN"
created = models.DateTimeField(auto_now=True)
message = models.CharField(max_length=350)
type = models.PositiveSmallIntegerField(
choices=Types.choices,
)
user = models.ForeignKey(
User,
on_delete=models.CASCADE,
related_name='events',
null=True,
)
def get_type(self):
return self.Types(self.type).label
@classmethod
def set_EV_USR_REGISTERED(cls, user):
msg = _("The user {username} was registered: name: {first_name}, last name: {last_name}").format(
username=user.username,
first_name=user.first_name,
last_name=user.last_name
)
cls.objects.create(
type=cls.Types.EV_USR_REGISTERED,
message=msg
)
@classmethod
def set_EV_USR_WELCOME(cls, user):
msg = _("Welcome. You has been registered: name: {first_name}, last name: {last_name}").format(
first_name=user.first_name,
last_name=user.last_name
)
cls.objects.create(
type=cls.Types.EV_USR_WELCOME,
message=msg,
user=user
)
# Is required?
@classmethod
def set_EV_DATA_UPDATE_REQUESTED_BY_USER(cls, user):
msg = _("The user '{username}' has request the update of the following information: ")
msg += "['field1':'value1', 'field2':'value2'>,...]".format(
username=user.username,
)
cls.objects.create(
type=cls.Types.EV_DATA_UPDATE_REQUESTED_BY_USER,
message=msg,
)
# Is required?
@classmethod
def set_EV_DATA_UPDATE_REQUESTED(cls, user):
msg = _("You have requested the update of the following information: ")
msg += "['field1':'value1', 'field2':'value2'>,...]"
cls.objects.create(
type=cls.Types.EV_DATA_UPDATE_REQUESTED,
message=msg,
user=user
)
@classmethod
def set_EV_USR_UPDATED_BY_ADMIN(cls, user):
msg = "The admin has updated the following user 's information: "
msg += "name: {first_name}, last name: {last_name}"
msg = _(msg).format(
first_name=user.first_name,
last_name=user.last_name
)
cls.objects.create(
type=cls.Types.EV_USR_UPDATED_BY_ADMIN,
message=msg
)
@classmethod
def set_EV_USR_UPDATED(cls, user):
msg = "The admin has updated your personal information: "
msg += "name: {first_name}, last name: {last_name}"
msg = _(msg).format(
first_name=user.first_name,
last_name=user.last_name
)
cls.objects.create(
type=cls.Types.EV_USR_UPDATED,
message=msg,
user=user
)
@classmethod
def set_EV_USR_DELETED_BY_ADMIN(cls, user):
msg = _("The admin has deleted the user: username: {username}").format(
username=user.username,
)
cls.objects.create(
type=cls.Types.EV_USR_DELETED_BY_ADMIN,
message=msg
)
@classmethod
def set_EV_DID_CREATED_BY_USER(cls, did):
msg = _("New DID with DID-ID: '{did}' created by user '{username}'").format(
did=did.did,
username=did.user.username
)
cls.objects.create(
type=cls.Types.EV_DID_CREATED_BY_USER,
message=msg,
)
@classmethod
def set_EV_DID_CREATED(cls, did):
msg = _("New DID with label: '{label}' and DID-ID: '{did}' was created'").format(
label=did.label,
did=did.did
)
cls.objects.create(
type=cls.Types.EV_DID_CREATED,
message=msg,
user=did.user
)
@classmethod
def set_EV_DID_DELETED(cls, did):
msg = _("The DID with label '{label}' and DID-ID: '{did}' was deleted from your wallet").format(
label=did.label,
did=did.did
)
cls.objects.create(
type=cls.Types.EV_DID_DELETED,
message=msg,
user=did.user
)
@classmethod
def set_EV_CREDENTIAL_DELETED_BY_ADMIN(cls, cred):
msg = _("The credential of type '{type}' and ID: '{id}' was deleted").format(
type=cred.type(),
id=cred.id,
)
cls.objects.create(
type=cls.Types.EV_CREDENTIAL_DELETED_BY_ADMIN,
message=msg,
)
@classmethod
def set_EV_CREDENTIAL_DELETED(cls, cred):
msg = _("The credential of type '{type}' and ID: '{id}' was deleted from your wallet").format(
type=cred.type(),
id=cred.id
)
cls.objects.create(
type=cls.Types.EV_CREDENTIAL_DELETED,
message=msg,
user=cred.user
)
@classmethod
def set_EV_CREDENTIAL_ISSUED_FOR_USER(cls, cred):
msg = _("The credential of type '{type}' and ID: '{id}' was issued for user {username}").format(
type=cred.type(),
id=cred.id,
username=cred.user.username
)
cls.objects.create(
type=cls.Types.EV_CREDENTIAL_ISSUED_FOR_USER,
message=msg,
)
@classmethod
def set_EV_CREDENTIAL_ISSUED(cls, cred):
msg = _("The credential of type '{type}' and ID: '{id}' was issued and stored in your wallet").format(
type=cred.type(),
id=cred.id
)
cls.objects.create(
type=cls.Types.EV_CREDENTIAL_ISSUED,
message=msg,
user=cred.user
)
@classmethod
def set_EV_CREDENTIAL_PRESENTED_BY_USER(cls, cred, verifier):
msg = "The credential of type '{type}' and ID: '{id}' "
msg += "was presented by user {username} to verifier '{verifier}"
msg = _(msg).format(
type=cred.type(),
id=cred.id,
username=cred.user.username,
verifier=verifier
)
cls.objects.create(
type=cls.Types.EV_CREDENTIAL_PRESENTED_BY_USER,
message=msg,
)
@classmethod
def set_EV_CREDENTIAL_PRESENTED(cls, cred, verifier):
msg = "The credential of type '{type}' and ID: '{id}' "
msg += "was presented to verifier '{verifier}'"
msg = _(msg).format(
type=cred.type(),
id=cred.id,
verifier=verifier
)
cls.objects.create(
type=cls.Types.EV_CREDENTIAL_PRESENTED,
message=msg,
user=cred.user
)
@classmethod
def set_EV_CREDENTIAL_ENABLED(cls, cred):
msg = _("The credential of type '{type}' was enabled for user {username}").format(
type=cred.type(),
username=cred.user.username
)
cls.objects.create(
type=cls.Types.EV_CREDENTIAL_ENABLED,
message=msg,
)
@classmethod
def set_EV_CREDENTIAL_CAN_BE_REQUESTED(cls, cred):
msg = _("You can request the '{type}' credential").format(
type=cred.type()
)
cls.objects.create(
type=cls.Types.EV_CREDENTIAL_CAN_BE_REQUESTED,
message=msg,
user=cred.user
)
@classmethod
def set_EV_CREDENTIAL_REVOKED_BY_ADMIN(cls, cred):
msg = _("The credential of type '{type}' and ID: '{id}' was revoked for ").format(
type=cred.type(),
id=cred.id
)
cls.objects.create(
type=cls.Types.EV_CREDENTIAL_REVOKED_BY_ADMIN,
message=msg,
)
@classmethod
def set_EV_CREDENTIAL_REVOKED(cls, cred):
msg = _("The credential of type '{type}' and ID: '{id}' was revoked by admin").format(
type=cred.type(),
id=cred.id
)
cls.objects.create(
type=cls.Types.EV_CREDENTIAL_REVOKED,
message=msg,
user=cred.user
)
@classmethod
def set_EV_ROLE_CREATED_BY_ADMIN(cls):
msg = _('A new role was created by admin')
cls.objects.create(
type=cls.Types.EV_ROLE_CREATED_BY_ADMIN,
message=msg,
)
@classmethod
def set_EV_ROLE_MODIFIED_BY_ADMIN(cls):
msg = _('The role was modified by admin')
cls.objects.create(
type=cls.Types.EV_ROLE_MODIFIED_BY_ADMIN,
message=msg,
)
@classmethod
def set_EV_ROLE_DELETED_BY_ADMIN(cls):
msg = _('The role was removed by admin')
cls.objects.create(
type=cls.Types.EV_ROLE_DELETED_BY_ADMIN,
message=msg,
)
@classmethod
def set_EV_SERVICE_CREATED_BY_ADMIN(cls):
msg = _('A new service was created by admin')
cls.objects.create(
type=cls.Types.EV_SERVICE_CREATED_BY_ADMIN,
message=msg,
)
@classmethod
def set_EV_SERVICE_MODIFIED_BY_ADMIN(cls):
msg = _('The service was modified by admin')
cls.objects.create(
type=cls.Types.EV_SERVICE_MODIFIED_BY_ADMIN,
message=msg,
)
@classmethod
def set_EV_SERVICE_DELETED_BY_ADMIN(cls):
msg = _('The service was removed by admin')
cls.objects.create(
type=cls.Types.EV_SERVICE_DELETED_BY_ADMIN,
message=msg,
)
@classmethod
def set_EV_ORG_DID_CREATED_BY_ADMIN(cls, did):
msg = _("New Organisational DID with label: '{label}' and DID-ID: '{did}' was created").format(
label=did.label,
did=did.did
)
cls.objects.create(
type=cls.Types.EV_ORG_DID_CREATED_BY_ADMIN,
message=msg,
)
@classmethod
def set_EV_ORG_DID_DELETED_BY_ADMIN(cls, did):
msg = _("Organisational DID with label: '{label}' and DID-ID: '{did}' was removed").format(
label=did.label,
did=did.did
)
cls.objects.create(
type=cls.Types.EV_ORG_DID_DELETED_BY_ADMIN,
message=msg,
)
@classmethod
def set_EV_USR_DEACTIVATED_BY_ADMIN(cls, user):
msg = "The user '{username}' was temporarily deactivated: "
msg += "[name:'{first_name}', last name:'{last_name}']"
msg = _(msg).format(
username=user.username,
first_name=user.first_name,
last_name=user.last_name
)
cls.objects.create(
type=cls.Types.EV_USR_DEACTIVATED_BY_ADMIN,
message=msg,
)
@classmethod
def set_EV_USR_ACTIVATED_BY_ADMIN(cls, user):
msg = "The user '{username}' was activated: "
msg += "name:'{first_name}', last name:'{last_name}']"
msg = _(msg).format(
username=user.username,
first_name=user.first_name,
last_name=user.last_name
)
cls.objects.create(
type=cls.Types.EV_USR_ACTIVATED_BY_ADMIN,
message=msg,
)
class DID(models.Model):
created_at = models.DateTimeField(auto_now=True)
@ -62,7 +444,7 @@ class VerificableCredential(models.Model):
id_string = models.CharField(max_length=250)
verified = models.BooleanField()
created_on = models.DateTimeField(auto_now=True)
issuer_on = models.DateTimeField(null=True)
issued_on = models.DateTimeField(null=True)
did_issuer = models.CharField(max_length=250)
did_subject = models.CharField(max_length=250)
data = models.TextField()
@ -95,9 +477,13 @@ class VerificableCredential(models.Model):
data = json.loads(self.data).get('instance').items()
return data
def get_issued(self, did):
def issue(self, did):
self.status = self.Status.ISSUED
self.did_subject = did
self.issued_on = datetime.datetime.now()
def get_issued_on(self):
return self.issued_on.strftime("%m/%d/%Y")
class VCTemplate(models.Model):
wkit_template_id = models.CharField(max_length=250)
@ -117,7 +503,7 @@ class Membership(models.Model):
class Types(models.IntegerChoices):
BENEFICIARY = 1, _('Beneficiary')
EMPLOYEE = 2, _('Employee')
PARTNER = 3, _('Partner')
MEMBER = 3, _('Member')
type = models.PositiveSmallIntegerField(_('Type of membership'), choices=Types.choices)
start_date = models.DateField(
@ -128,7 +514,7 @@ class Membership(models.Model):
)
end_date = models.DateField(
_('End date'),
help_text=_('What date did the membership end?'),
help_text=_('What date will the membership end?'),
blank=True,
null=True
)
@ -144,21 +530,24 @@ class Membership(models.Model):
class Rol(models.Model):
name = models.CharField(max_length=250)
name = models.CharField(_("name"), max_length=250)
description = models.CharField(_("Description"), max_length=250, null=True)
def __str__(self):
return self.name
class Service(models.Model):
domain = models.CharField(max_length=250)
description = models.CharField(max_length=250)
domain = models.CharField(_("Domain"), max_length=250)
description = models.CharField(_("Description"), max_length=250)
rol = models.ManyToManyField(
Rol,
)
def get_roles(self):
return ", ".join([x.name for x in self.rol.all()])
if self.rol.exists():
return ", ".join([x.name for x in self.rol.all()])
return _("None")
def __str__(self):
return "{} -> {}".format(self.domain, self.get_roles())
@ -176,6 +565,9 @@ class UserRol(models.Model):
related_name='users',
)
class Meta:
unique_together = ('user', 'service',)
class Organization(models.Model):
name = models.CharField(max_length=250)

View File

@ -14,8 +14,8 @@
<tr>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Type' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Details' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Issue' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Status' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Issued' %}</button></th>
<th scope="col" class="text-center"><button type="button" class="btn btn-grey border border-dark">{% trans 'Status' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'User' %}</button></th>
<th scope="col"></th>
</tr>
@ -25,8 +25,8 @@
<tr style="font-size:15px;">
<td>{{ f.type }}</td>
<td>{{ f.description }}</td>
<td>{{ f.issue_on }}</td>
<td>{{ f.get_status }}</td>
<td>{{ f.get_issued_on }}</td>
<td class="text-center">{{ f.get_status }}</td>
<td>{{ f.user.email }}</td>
<td><a href="{% url 'idhub:admin_credential' f.id %}" class="btn btn-green-admin">{% trans 'View' %}</a></td>
</tr>

View File

@ -10,131 +10,20 @@
<table class="table table-striped table-sm">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col"><button type="button" class="btn btn-green-admin border border-dark">Header</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">Header</button></th>
<th scope="col"><button type="button" class="btn btn-green-admin">Header</button></th>
<th scope="col"><button type="button" class="btn btn-grey ">Header</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Type' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Description' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Date' %}</button></th>
</tr>
</thead>
<tbody>
{% for ev in events %}
<tr>
<td>1,001</td>
<td>random</td>
<td>data</td>
<td>placeholder</td>
<td>text</td>
</tr>
<tr>
<td>1,002</td>
<td>placeholder</td>
<td>irrelevant</td>
<td>visual</td>
<td>layout</td>
</tr>
<tr>
<td>1,003</td>
<td>data</td>
<td>rich</td>
<td>dashboard</td>
<td>tabular</td>
</tr>
<tr>
<td>1,003</td>
<td>information</td>
<td>placeholder</td>
<td>illustrative</td>
<td>data</td>
</tr>
<tr>
<td>1,004</td>
<td>text</td>
<td>random</td>
<td>layout</td>
<td>dashboard</td>
</tr>
<tr>
<td>1,005</td>
<td>dashboard</td>
<td>irrelevant</td>
<td>text</td>
<td>placeholder</td>
</tr>
<tr>
<td>1,006</td>
<td>dashboard</td>
<td>illustrative</td>
<td>rich</td>
<td>data</td>
</tr>
<tr>
<td>1,007</td>
<td>placeholder</td>
<td>tabular</td>
<td>information</td>
<td>irrelevant</td>
</tr>
<tr>
<td>1,008</td>
<td>random</td>
<td>data</td>
<td>placeholder</td>
<td>text</td>
</tr>
<tr>
<td>1,009</td>
<td>placeholder</td>
<td>irrelevant</td>
<td>visual</td>
<td>layout</td>
</tr>
<tr>
<td>1,010</td>
<td>data</td>
<td>rich</td>
<td>dashboard</td>
<td>tabular</td>
</tr>
<tr>
<td>1,011</td>
<td>information</td>
<td>placeholder</td>
<td>illustrative</td>
<td>data</td>
</tr>
<tr>
<td>1,012</td>
<td>text</td>
<td>placeholder</td>
<td>layout</td>
<td>dashboard</td>
</tr>
<tr>
<td>1,013</td>
<td>dashboard</td>
<td>irrelevant</td>
<td>text</td>
<td>visual</td>
</tr>
<tr>
<td>1,014</td>
<td>dashboard</td>
<td>illustrative</td>
<td>rich</td>
<td>data</td>
</tr>
<tr>
<td>1,015</td>
<td>random</td>
<td>tabular</td>
<td>information</td>
<td>text</td>
<td>{{ ev.get_type }}</td>
<td>{{ ev.message }}</td>
<td>{{ ev.created }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="row">
<div class="col-6"><button type="button" class="btn btn-grey rounded-pill">Cancel</button></div>
<div class="col-6"><button type="button" class="btn btn-green-admin rounded-pill">Revoke</button></div>
<div>
{% endblock %}

View File

@ -32,7 +32,7 @@
</tbody>
</table>
<div class="form-actions-no-box">
<a class="btn btn-green-admin" href="{% url 'idhub:admin_dids_new' %}">{% translate "Add Identity" %} <i class="bi bi-plus"></i></a>
<a class="btn btn-green-admin" href="{% url 'idhub:admin_dids_new' %}">{% translate "Add identity" %} <i class="bi bi-plus"></i></a>
</div>
</div>
</div>

View File

@ -14,7 +14,7 @@
<tr>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Created at' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'File' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'success' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Success' %}</button></th>
</tr>
</thead>
<tbody>
@ -28,7 +28,7 @@
</tbody>
</table>
<div class="form-actions-no-box">
<a class="btn btn-green-admin" href="{% url 'idhub:admin_import_add' %}">{% translate "Import Datas" %} <i class="bi bi-plus"></i></a>
<a class="btn btn-green-admin" href="{% url 'idhub:admin_import_add' %}">{% translate "Import data" %} <i class="bi bi-plus"></i></a>
</div>
</div>
</div>

View File

@ -13,26 +13,22 @@
<th scope="col"><button type="button" class="btn btn-green-admin border border-dark">{% trans 'Last name' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'First name' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">Email</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Membership' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Role' %}</button></th>
<th scope="col" class="text-center"><button type="button" class="btn btn-grey border border-dark">{% trans 'Membership' %}</button></th>
<th scope="col" class="text-center"><button type="button" class="btn btn-grey border border-dark">{% trans 'Role' %}</button></th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user.last_name }}</td>
<td>{{ user.first_name }}</td>
<td>{{ user.last_name|default:'' }}</td>
<td>{{ user.first_name|default:'' }}</td>
<td>{{ user.email }}</td>
<td>
{% for m in user.memberships.all %}
{{ m.get_type }}
{% endfor %}
<td class="text-center">
{{ user.get_memberships }}
</td>
<td>
{% for r in user.roles.all %}
{{ r.service.get_roles }}
{% endfor %}
<td class="text-center">
{{ user.get_roles }}
</td>
<td><a type="button" class="btn btn-green-admin rounded-pill" href="{% url 'idhub:admin_people' user.id %}">{% trans 'View' %}</td>
</tr>

View File

@ -12,7 +12,8 @@
<table class="table table-striped table-sm">
<thead>
<tr>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Rol' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Role' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Description' %}</button></th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
@ -21,6 +22,7 @@
{% for rol in roles.all %}
<tr>
<td>{{ rol.name }}</td>
<td>{{ rol.description|default:""}}</td>
<td><a href="{% url 'idhub:admin_rol_edit' rol.id %}" title="{% trans 'Edit' %}"><i class="bi bi-pencil-square"></i></a></td>
<td><a href="{% url 'idhub:admin_rol_del' rol.id %}" title="{% trans 'Delete' %}"><i class="bi bi-trash"></i></a></td>
</tr>
@ -28,7 +30,7 @@
</tbody>
</table>
<div class="form-actions-no-box">
<a class="btn btn-green-admin" href="{% url 'idhub:admin_rol_new' %}">{% translate "Add Rol" %} <i class="bi bi-plus"></i></a>
<a class="btn btn-green-admin" href="{% url 'idhub:admin_rol_new' %}">{% translate "Add Role" %} <i class="bi bi-plus"></i></a>
</div>
</div>
</div>

View File

@ -34,7 +34,7 @@
</tbody>
</table>
<div class="form-actions-no-box">
<a class="btn btn-green-admin" href="{% url 'idhub:admin_schemas_import' %}">{% translate "Add Template" %} <i class="bi bi-plus"></i></a>
<a class="btn btn-green-admin" href="{% url 'idhub:admin_schemas_import' %}">{% translate "Add template" %} <i class="bi bi-plus"></i></a>
</div>
</div>
</div>
@ -45,7 +45,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">{% trans 'Delete Template' %} {{ schema.file_schema }}</h5>
<h5 class="modal-title" id="exampleModalLabel">{% trans 'Delete template' %} {{ schema.file_schema }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">

View File

@ -12,7 +12,7 @@
<table class="table table-striped table-sm">
<thead>
<tr>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Template available' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Available templates' %}</button></th>
<th scope="col"></th>
</tr>
</thead>

View File

@ -14,7 +14,7 @@
<tr>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Service' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Description' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Rol' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Role' %}</button></th>
<th scope="col"></th>
<th scope="col"></th>
</tr>

View File

@ -24,7 +24,7 @@
First Name:
</div>
<div class="col-9 text-secondary">
{{ object.first_name }}
{{ object.first_name|default:'' }}
</div>
</div>
<div class="row border-bottom mt-3">
@ -32,7 +32,7 @@
Last Name:
</div>
<div class="col-9 text-secondary">
{{ object.last_name }}
{{ object.last_name|default:'' }}
</div>
</div>
<div class="row mt-3">
@ -84,7 +84,7 @@
<table class="table table-striped table-sm">
<thead>
<tr>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Rol' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Role' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Description' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Service' %}</button></th>
</tr>

View File

@ -70,7 +70,7 @@
<table class="table table-striped table-sm">
<thead>
<tr>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Rol' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Role' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Description' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Service' %}</button></th>
<th scope="col"></th>
@ -90,7 +90,7 @@
</tbody>
</table>
<div class="form-actions-no-box">
<a class="btn btn-green-admin" href="{% url 'idhub:admin_people_rol_new' object.id %}">{% translate "Add Rol" %} <i class="bi bi-plus"></i></a>
<a class="btn btn-green-admin" href="{% url 'idhub:admin_people_rol_new' object.id %}">{% translate "Add Role" %} <i class="bi bi-plus"></i></a>
</div>
</div>
</div>

View File

@ -66,29 +66,29 @@
<li class="nav-item">
<a class="nav-link {% if section == 'Home' %}active {% endif %}fw-bold" aria-current="page" href="{% url 'idhub:user_dashboard' %}">
<i class="bi bi-house-door icon_sidebar"></i>
Home
{% trans 'Dashboard' %}
</a>
<hr />
</li>
<li class="nav-item">
<span class="nav-link {% if section == 'MyProfile' %}active {% endif %}fw-bold">
<i class="fa-regular fa-user icon_sidebar"></i>
My datas
{% trans 'My information' %}
</span>
<ul class="flex-column mb-2 ul_sidebar">
<li class="nav-item">
<a class="nav-link {% if path == 'user_profile' %}active2{% endif %}" href="{% url 'idhub:user_profile' %}">
My personal data
{% trans 'My personal information' %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if path == 'user_roles' %}active2{% endif %}" href="{% url 'idhub:user_roles' %}">
My roles
{% trans 'My roles' %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if path == 'user_gdpr' %}active2{% endif %}" href="{% url 'idhub:user_gdpr' %}">
GDPR info
{% trans 'GDPR info' %}
</a>
</li>
</ul>
@ -96,27 +96,27 @@
<li class="nav-item">
<span class="nav-link {% if section == 'MyWallet' %}active {% endif %}fw-bold" href="#">
<i class="bi bi-patch-check icon_sidebar"></i>
My Wallet
{% trans 'My wallet' %}
</span>
<ul class="flex-column mb-2 ul_sidebar">
<li class="nav-item">
<a class="nav-link {% if path == 'user_dids' %}active2{% endif %}" href="{% url 'idhub:user_dids' %}">
Identities (DID)
{% trans 'Identities (DIDs)' %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if path == 'user_credentials' %}active2{% endif %}" href="{% url 'idhub:user_credentials' %}">
Credentials
{% trans 'My credentials' %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if path == 'user_credentials_request' %}active2{% endif %}" href="{% url 'idhub:user_credentials_request' %}">
Credentials request
{% trans 'Request a credential' %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if path == 'user_credentials_presentation' %}active2{% endif %}" href="{% url 'idhub:user_credentials_presentation' %}">
Credentials Presentation
{% trans 'Present a credential' %}
</a>
</li>
</ul>

View File

@ -66,24 +66,24 @@
<li class="nav-item">
<a class="admin nav-link {% if section == 'Home' %}active {% endif %}fw-bold" href="{% url 'idhub:admin_dashboard' %}">
<i class="bi bi-house-door icon_sidebar"></i>
Home
{% trans 'Dashboard' %}
</a>
<hr />
</li>
<li class="nav-item">
<a class="admin {% if section == 'People' %}active {% endif %}nav-link fw-bold" data-bs-toggle="collapse" data-bs-target="#people" aria-expanded="false" aria-controls="people" href="javascript:void()">
<i class="bi bi-people icon_sidebar"></i>
People
{% trans 'User managament' %}
</a>
<ul class="flex-column mb-2 ul_sidebar accordion-collapse {% if section == 'People' %}expanded{% else %}collapse{% endif %}" id="people" data-bs-parent="#sidebarMenu">
<li class="nav-item">
<a class="nav-link{% if path == 'admin_people_list' %} active2{% endif %}" href="{% url 'idhub:admin_people_list' %}">
People list
{% trans 'View users' %}
</a>
</li>
<li class="nav-item">
<a class="nav-link{% if path == 'admin_people_new' %} active2{% endif %}" href="{% url 'idhub:admin_people_new' %}">
Register a new user
{% trans 'Add user' %}
</a>
</li>
</ul>
@ -91,50 +91,50 @@
<li class="nav-item">
<a class="admin nav-link {% if section == 'AccessControl' %}active {% endif %}fw-bold" data-bs-toggle="collapse" data-bs-target="#control-access" aria-expanded="false" aria-controls="control-access" href="javascript:void()">
<i class="fa-solid fa-arrow-right-from-bracket icon_sidebar"></i>
Access Control
{% trans 'Access control managament' %}
</a>
<ul class="flex-column mb-2 ul_sidebar accordion-collapse {% if section == 'AccessControl' %}expanded{% else %}collapse{% endif %}" id="control-access" data-bs-parent="#sidebarMenu">
<li class="nav-item">
<a class="nav-link{% if path == 'admin_roles' %} active2{% endif %}" href="{% url 'idhub:admin_roles' %}">
roles
{% trans 'Manage roles' %}
</a>
</li>
<li class="nav-item">
<a class="nav-link{% if path == 'admin_services' %} active2{% endif %}" href="{% url 'idhub:admin_services' %}">
Services
{% trans 'Manage services' %}
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="admin nav-link {% if section == 'Credentials' %}active {% endif %}fw-bold" data-bs-toggle="collapse" data-bs-target="#credentials" aria-expanded="false" aria-controls="credentials" href="javascript:void()">
<a class="admin nav-link {% if section == 'Credential' %}active {% endif %}fw-bold" data-bs-toggle="collapse" data-bs-target="#credential" aria-expanded="false" aria-controls="credential" href="javascript:void()">
<i class="bi bi-patch-check icon_sidebar"></i>
Credentials
{% trans 'Credential management' %}
</a>
<ul class="flex-column mb-2 ul_sidebar accordion-collapse {% if section == 'Credentials' %}expanded{% else %}collapse{% endif %}" id="credentials" data-bs-parent="#sidebarMenu">
<ul class="flex-column mb-2 ul_sidebar accordion-collapse {% if section == 'Credential' %}expanded{% else %}collapse{% endif %}" id="credential" data-bs-parent="#sidebarMenu">
<li class="nav-item">
<a class="nav-link{% if path == 'admin_credentials' %} active2{% endif %}" href="{% url 'idhub:admin_credentials' %}">
Credentials list
{% trans 'View credentials' %}
</a>
</li>
<li class="nav-item">
<a id="wallet" class="nav-link" data-bs-toggle="collapse" data-bs-target="#lwallet" aria-expanded="false" aria-controls="lwallet" href="javascript:void()">
Wallet
{% trans "Organization's wallet" %}
</a>
<ul class="flex-column mb-2 accordion-collapse {% if wallet %}expanded{% else %}collapse{% endif %}" id="lwallet" data-bs-parent="#wallet">
<li class="nav-item">
<a class="nav-link{% if path == 'admin_dids' %} active2{% endif %}" href="{% url 'idhub:admin_dids' %}">
Identities (DID)
{% trans 'Manage Identities (DIDs)' %}
</a>
</li>
<li class="nav-item">
<a class="nav-link{% if path == 'admin_wallet_credentials' %} active2{% endif %}" href="{% url 'idhub:admin_wallet_credentials' %}">
Credentials
{% trans 'View org. credentials' %}
</a>
</li>
<li class="nav-item">
<a class="nav-link{% if path == 'admin_wallet_config_issue' %} active2{% endif %}" href="{% url 'idhub:admin_wallet_config_issue' %}">
Configure Issue
{% trans 'Configure credential issuance' %}
</a>
</li>
</ul>
@ -144,13 +144,13 @@
<li class="nav-item">
<a class="admin nav-link {% if section == 'Templates' %}active {% endif %}fw-bold" href="{% url 'idhub:admin_schemas' %}">
<i class="bi bi-file-earmark-text icon_sidebar"></i>
Templates
{% trans 'Credential template management' %}
</a>
</li>
<li class="nav-item">
<a class="admin nav-link {% if section == 'ImportExport' %}active {% endif %}fw-bold" href="{% url 'idhub:admin_import' %}">
<i class="bi bi-arrow-down-square icon_sidebar"></i>
Import Datas
{% trans 'Import data' %}
</a>
</li>
</ul>

View File

@ -14,8 +14,8 @@
<tr>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Type' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Details' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Issue' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Status' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Issued' %}</button></th>
<th scope="col" class="text-center"><button type="button" class="btn btn-grey border border-dark">{% trans 'Status' %}</button></th>
<th scope="col"></th>
</tr>
</thead>
@ -24,8 +24,8 @@
<tr style="font-size:15px;">
<td>{{ f.type }}</td>
<td>{{ f.description }}</td>
<td>{{ f.issue_on }}</td>
<td>{{ f.get_status }}</td>
<td>{{ f.get_issued_on }}</td>
<td class="text-center">{{ f.get_status }}</td>
<td>
<a href="{% url 'idhub:user_credential' f.id %}" class="text-primary">
<i class="bi bi-eye"></i>

View File

@ -10,131 +10,20 @@
<table class="table table-striped table-sm">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col"><button type="button" class="btn btn-green-user border border-dark">Header</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">Header</button></th>
<th scope="col"><button type="button" class="btn btn-green-user">Header</button></th>
<th scope="col"><button type="button" class="btn btn-grey">Header</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Type' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Description' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Date' %}</button></th>
</tr>
</thead>
<tbody>
{% for ev in user.events.all %}
<tr>
<td>1,001</td>
<td>random</td>
<td>data</td>
<td>placeholder</td>
<td>text</td>
</tr>
<tr>
<td>1,002</td>
<td>placeholder</td>
<td>irrelevant</td>
<td>visual</td>
<td>layout</td>
</tr>
<tr>
<td>1,003</td>
<td>data</td>
<td>rich</td>
<td>dashboard</td>
<td>tabular</td>
</tr>
<tr>
<td>1,003</td>
<td>information</td>
<td>placeholder</td>
<td>illustrative</td>
<td>data</td>
</tr>
<tr>
<td>1,004</td>
<td>text</td>
<td>random</td>
<td>layout</td>
<td>dashboard</td>
</tr>
<tr>
<td>1,005</td>
<td>dashboard</td>
<td>irrelevant</td>
<td>text</td>
<td>placeholder</td>
</tr>
<tr>
<td>1,006</td>
<td>dashboard</td>
<td>illustrative</td>
<td>rich</td>
<td>data</td>
</tr>
<tr>
<td>1,007</td>
<td>placeholder</td>
<td>tabular</td>
<td>information</td>
<td>irrelevant</td>
</tr>
<tr>
<td>1,008</td>
<td>random</td>
<td>data</td>
<td>placeholder</td>
<td>text</td>
</tr>
<tr>
<td>1,009</td>
<td>placeholder</td>
<td>irrelevant</td>
<td>visual</td>
<td>layout</td>
</tr>
<tr>
<td>1,010</td>
<td>data</td>
<td>rich</td>
<td>dashboard</td>
<td>tabular</td>
</tr>
<tr>
<td>1,011</td>
<td>information</td>
<td>placeholder</td>
<td>illustrative</td>
<td>data</td>
</tr>
<tr>
<td>1,012</td>
<td>text</td>
<td>placeholder</td>
<td>layout</td>
<td>dashboard</td>
</tr>
<tr>
<td>1,013</td>
<td>dashboard</td>
<td>irrelevant</td>
<td>text</td>
<td>visual</td>
</tr>
<tr>
<td>1,014</td>
<td>dashboard</td>
<td>illustrative</td>
<td>rich</td>
<td>data</td>
</tr>
<tr>
<td>1,015</td>
<td>random</td>
<td>tabular</td>
<td>information</td>
<td>text</td>
<td>{{ ev.get_type }}</td>
<td>{{ ev.message }}</td>
<td>{{ ev.created }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="row">
<div class="col-6"><button type="button" class="btn btn-yellow rounded-pill">Cancel</button></div>
<div class="col-6"><button type="button" class="btn btn-green-user rounded-pill">Revoke</button></div>
<div>
{% endblock %}

View File

@ -31,11 +31,6 @@
</div>
{% endif %}
{% bootstrap_form form %}
<div class="form-actions-no-box">
<a class="btn btn-secondary" href="{% url 'idhub:user_profile' %}">{% translate "Cancel" %}</a>
<input class="btn btn-success" type="submit" name="submit" value="{% translate 'Save' %}" />
</div>
</form>
<hr />

View File

@ -12,7 +12,7 @@
<table class="table table-striped table-sm">
<thead>
<tr>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Rol' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Role' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Description' %}</button></th>
<th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Service' %}</button></th>
</tr>

View File

@ -44,7 +44,7 @@ class RequestCredentialForm(forms.Form):
did = did[0].did
cred = cred[0]
cred.get_issued(did)
cred.issue(did)
if commit:
cred.save()
@ -72,23 +72,23 @@ class CredentialPresentationForm(forms.Form):
]
def save(self, commit=True):
org = Organization.objects.filter(
self.org = Organization.objects.filter(
id=self.data['organization']
)
cred = VerificableCredential.objects.filter(
self.cred = VerificableCredential.objects.filter(
user=self.user,
id=self.data['credential'],
status=VerificableCredential.Status.ISSUED
)
if not all([org.exists(), cred.exists()]):
if not all([self.org.exists(), self.cred.exists()]):
return
org =org[0]
cred = cred[0]
self.org = self.org[0]
self.cred = self.cred[0]
if commit:
org.send(cred)
return cred
self.org.send(self.cred)
return self.cred
return

View File

@ -15,7 +15,7 @@ from django.contrib import messages
from utils.apiregiter import iota
from idhub.user.forms import ProfileForm, RequestCredentialForm, CredentialPresentationForm
from idhub.mixins import UserView
from idhub.models import DID, VerificableCredential
from idhub.models import DID, VerificableCredential, Event
class MyProfile(UserView):
@ -24,7 +24,7 @@ class MyProfile(UserView):
class MyWallet(UserView):
title = _("My Wallet")
title = _("My wallet")
section = "MyWallet"
@ -38,7 +38,7 @@ class DashboardView(UserView, TemplateView):
class ProfileView(MyProfile, UpdateView):
template_name = "idhub/user/profile.html"
subtitle = _('My personal Data')
subtitle = _('My personal data')
icon = 'bi bi-person'
from_class = ProfileForm
fields = ('first_name', 'last_name', 'email')
@ -47,6 +47,16 @@ class ProfileView(MyProfile, UpdateView):
def get_object(self):
return self.request.user
def get_form(self):
form = super().get_form()
form.fields['first_name'].disabled = True
form.fields['last_name'].disabled = True
form.fields['email'].disabled = True
return form
def form_valid(self, form):
return super().form_valid(form)
class RolesView(MyProfile, TemplateView):
template_name = "idhub/user/roles.html"
@ -62,7 +72,7 @@ class GDPRView(MyProfile, TemplateView):
class CredentialsView(MyWallet, TemplateView):
template_name = "idhub/user/credentials.html"
subtitle = _('Credentials')
subtitle = _('Credential management')
icon = 'bi bi-patch-check-fill'
def get_context_data(self, **kwargs):
@ -111,7 +121,7 @@ class CredentialJsonView(MyWallet, TemplateView):
class CredentialsRequestView(MyWallet, FormView):
template_name = "idhub/user/credentials_request.html"
subtitle = _('Credentials request')
subtitle = _('Credential request')
icon = 'bi bi-patch-check-fill'
form_class = RequestCredentialForm
success_url = reverse_lazy('idhub:user_credentials')
@ -124,15 +134,17 @@ class CredentialsRequestView(MyWallet, FormView):
def form_valid(self, form):
cred = form.save()
if cred:
messages.success(self.request, _("The credential was required successfully!"))
messages.success(self.request, _("The credential was issued successfully!"))
Event.set_EV_CREDENTIAL_ISSUED_FOR_USER(cred)
Event.set_EV_CREDENTIAL_ISSUED(cred)
else:
messages.error(self.request, _("Not exists the credential!"))
messages.error(self.request, _("The credential does not exist!"))
return super().form_valid(form)
class CredentialsPresentationView(MyWallet, FormView):
template_name = "idhub/user/credentials_presentation.html"
subtitle = _('Credentials Presentation')
subtitle = _('Credential presentation')
icon = 'bi bi-patch-check-fill'
form_class = CredentialPresentationForm
success_url = reverse_lazy('idhub:user_credentials')
@ -145,6 +157,8 @@ class CredentialsPresentationView(MyWallet, FormView):
def form_valid(self, form):
cred = form.save()
if cred:
Event.set_EV_CREDENTIAL_PRESENTED_BY_USER(cred, form.org)
Event.set_EV_CREDENTIAL_PRESENTED(cred, form.org)
messages.success(self.request, _("The credential was presented successfully!"))
else:
messages.error(self.request, _("Error sending credential!"))
@ -153,7 +167,7 @@ class CredentialsPresentationView(MyWallet, FormView):
class DidsView(MyWallet, TemplateView):
template_name = "idhub/user/dids.html"
subtitle = _('Identities (DID)')
subtitle = _('Identities (DIDs)')
icon = 'bi bi-patch-check-fill'
def get_context_data(self, **kwargs):
@ -166,7 +180,7 @@ class DidsView(MyWallet, TemplateView):
class DidRegisterView(MyWallet, CreateView):
template_name = "idhub/user/did_register.html"
subtitle = _('Add a new Identities (DID)')
subtitle = _('Add a new Identity (DID)')
icon = 'bi bi-patch-check-fill'
wallet = True
model = DID
@ -174,24 +188,20 @@ class DidRegisterView(MyWallet, CreateView):
success_url = reverse_lazy('idhub:user_dids')
object = None
# def get_form_kwargs(self):
# kwargs = super().get_form_kwargs()
# kwargs['initial'] = {
# 'user': self.request.user
# }
# return kwargs
def form_valid(self, form):
form.instance.user = self.request.user
form.instance.did = iota.issue_did()
form.save()
messages.success(self.request, _('DID created successfully'))
Event.set_EV_DID_CREATED(form.instance)
Event.set_EV_DID_CREATED_BY_USER(form.instance)
return super().form_valid(form)
class DidEditView(MyWallet, UpdateView):
template_name = "idhub/user/did_register.html"
subtitle = _('Identities (DID)')
subtitle = _('Identities (DIDs)')
icon = 'bi bi-patch-check-fill'
wallet = True
model = DID
@ -210,7 +220,7 @@ class DidEditView(MyWallet, UpdateView):
class DidDeleteView(MyWallet, DeleteView):
subtitle = _('Identities (DID)')
subtitle = _('Identities (DIDs)')
icon = 'bi bi-patch-check-fill'
wallet = True
model = DID
@ -219,7 +229,9 @@ class DidDeleteView(MyWallet, DeleteView):
def get(self, request, *args, **kwargs):
self.pk = kwargs['pk']
self.object = get_object_or_404(self.model, pk=self.pk)
Event.set_EV_DID_DELETED(self.object)
self.object.delete()
messages.success(self.request, _('DID delete successfully'))
return redirect(self.success_url)

32
idhub_auth/forms.py Normal file
View File

@ -0,0 +1,32 @@
import re
from django import forms
from django.utils.translation import gettext_lazy as _
from idhub_auth.models import User
class ProfileForm(forms.ModelForm):
first_name = forms.CharField(required=True)
last_name = forms.CharField(required=True)
class Meta:
model = User
fields = ['first_name', 'last_name', 'email']
def clean_first_name(self):
first_name = super().clean()['first_name']
if not re.match(r'^[a-zA-Z\s]+$', first_name):
txt = _("The string must contain only characters and spaces")
raise forms.ValidationError(txt)
return first_name
def clean_last_name(self):
last_name = super().clean()['last_name']
if not re.match(r'^[a-zA-Z\s]+$', last_name):
txt = _("The string must contain only characters and spaces")
raise forms.ValidationError(txt)
return last_name

View File

@ -1,4 +1,4 @@
# Generated by Django 4.2.5 on 2023-11-02 15:08
# Generated by Django 4.2.5 on 2023-11-14 16:32
from django.db import migrations, models

View File

@ -72,3 +72,16 @@ class User(AbstractBaseUser):
def username(self):
"Is the email of the user"
return self.email
def get_memberships(self):
members = set(
str(dict(x.Types.choices)[x.type]) for x in self.memberships.all()
)
return ", ".join(members)
def get_roles(self):
roles = []
for s in self.roles.all():
for r in s.service.rol.all():
roles.append(r.name)
return ", ".join(set(roles))

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-07 17:57+0100\n"
"POT-Creation-Date: 2023-11-13 11:11+0100\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"
@ -1533,233 +1533,400 @@ msgstr ""
msgid "show this help message and exit"
msgstr ""
#: idhub/admin/views.py:39 idhub/user/views.py:33
#: idhub/admin/forms.py:106
msgid "The user does not exist!"
msgstr ""
#: idhub/admin/views.py:43 idhub/templates/idhub/base.html:69
#: idhub/templates/idhub/base_admin.html:69 idhub/user/views.py:33
msgid "Dashboard"
msgstr ""
#: idhub/admin/views.py:40 idhub/user/views.py:34
#: idhub/admin/views.py:44 idhub/templates/idhub/admin/import.html:17
#: idhub/user/views.py:34
msgid "Success"
msgstr ""
#: idhub/admin/views.py:45
msgid "People Management"
#: idhub/admin/views.py:56
msgid "User Management"
msgstr ""
#: idhub/admin/views.py:50
msgid "Access Control Management"
#: idhub/admin/views.py:61
msgid "Access control management"
msgstr ""
#: idhub/admin/views.py:55
msgid "Credentials Management"
msgstr ""
#: idhub/admin/views.py:60
msgid "Templates Management"
msgstr ""
#: idhub/admin/views.py:65
msgid "Massive Data Management"
#: idhub/admin/views.py:66
msgid "Credential Management"
msgstr ""
#: idhub/admin/views.py:71
msgid "People list"
msgid "Template Management"
msgstr ""
#: idhub/admin/views.py:84
msgid "User Profile"
#: idhub/admin/views.py:76
msgid "Data file management"
msgstr ""
#: idhub/admin/views.py:108
#: idhub/admin/views.py:82 idhub/templates/idhub/base_admin.html:81
msgid "View users"
msgstr ""
#: idhub/admin/views.py:95
msgid "User personal information"
msgstr ""
#: idhub/admin/views.py:119
msgid "Is not possible deactivate your account!"
msgstr ""
#: idhub/admin/views.py:129 idhub/admin/views.py:235
#: idhub/admin/views.py:143 idhub/admin/views.py:261
msgid "Is not possible delete your account!"
msgstr ""
#: idhub/admin/views.py:141
msgid "People Register"
#: idhub/admin/views.py:155
msgid "The account is updated successfully"
msgstr ""
#: idhub/admin/views.py:156
msgid "The account is created successfully"
#: idhub/admin/views.py:164 idhub/templates/idhub/base_admin.html:86
msgid "Add user"
msgstr ""
#: idhub/admin/views.py:167 idhub/admin/views.py:204
#: idhub/admin/views.py:179
msgid "The account was created successfully"
msgstr ""
#: idhub/admin/views.py:193
msgid "Associate a membership to the user"
msgstr ""
#: idhub/admin/views.py:230
msgid "People add membership"
msgstr ""
#: idhub/admin/views.py:242
msgid "Add Rol to User"
#: idhub/admin/views.py:268
msgid "Add a user role to access a service"
msgstr ""
#: idhub/admin/views.py:272
msgid "Edit Rol to User"
#: idhub/admin/views.py:298
msgid "Modify a user role to access a service"
msgstr ""
#: idhub/admin/views.py:307
msgid "Roles Management"
#: idhub/admin/views.py:333 idhub/templates/idhub/base_admin.html:99
msgid "Manage roles"
msgstr ""
#: idhub/admin/views.py:319 idhub/templates/idhub/admin/roles.html:31
#: idhub/admin/views.py:345 idhub/templates/idhub/admin/roles.html:31
#: idhub/templates/idhub/admin/user_edit.html:93
msgid "Add Rol"
msgid "Add Role"
msgstr ""
#: idhub/admin/views.py:329
msgid "Edit Rol"
#: idhub/admin/views.py:354
msgid "Role created successfully"
msgstr ""
#: idhub/admin/views.py:356
msgid "Service Management"
#: idhub/admin/views.py:361
msgid "Edit Role"
msgstr ""
#: idhub/admin/views.py:368 idhub/templates/idhub/admin/services.html:35
msgid "Add Service"
#: idhub/admin/views.py:376
msgid "Role updated successfully"
msgstr ""
#: idhub/admin/views.py:378
msgid "Edit Service"
#: idhub/admin/views.py:389
msgid "Role deleted successfully"
msgstr ""
#: idhub/admin/views.py:405
msgid "Credentials list"
#: idhub/admin/views.py:396 idhub/templates/idhub/base_admin.html:104
msgid "Manage services"
msgstr ""
#: idhub/admin/views.py:418
#: idhub/admin/views.py:408
msgid "Add service"
msgstr ""
#: idhub/admin/views.py:417
msgid "Service created successfully"
msgstr ""
#: idhub/admin/views.py:424
msgid "Modify service"
msgstr ""
#: idhub/admin/views.py:439
msgid "Service updated successfully"
msgstr ""
#: idhub/admin/views.py:452
msgid "Service deleted successfully"
msgstr ""
#: idhub/admin/views.py:459 idhub/templates/idhub/base_admin.html:117
msgid "View credentials"
msgstr ""
#: idhub/admin/views.py:472
msgid "Change status of Credential"
msgstr ""
#: idhub/admin/views.py:460
#: idhub/admin/views.py:514
msgid "Credential revoked successfully"
msgstr ""
#: idhub/admin/views.py:480
#: idhub/admin/views.py:536
msgid "Credential deleted successfully"
msgstr ""
#: idhub/admin/views.py:487 idhub/admin/views.py:518 idhub/admin/views.py:537
msgid "Organization Identities (DID)"
#: idhub/admin/views.py:545
msgid "Manage Identities (DID)"
msgstr ""
#: idhub/admin/views.py:500
#: idhub/admin/views.py:558
msgid "Add a new Organization Identities (DID)"
msgstr ""
#: idhub/admin/views.py:512 idhub/user/views.py:188
#: idhub/admin/views.py:570 idhub/user/views.py:195
msgid "DID created successfully"
msgstr ""
#: idhub/admin/views.py:532 idhub/user/views.py:208
#: idhub/admin/views.py:577 idhub/admin/views.py:596
msgid "Organization Identities (DID)"
msgstr ""
#: idhub/admin/views.py:591 idhub/user/views.py:218
msgid "DID updated successfully"
msgstr ""
#: idhub/admin/views.py:547 idhub/user/views.py:223
#: idhub/admin/views.py:607 idhub/user/views.py:234
msgid "DID delete successfully"
msgstr ""
#: idhub/admin/views.py:554 idhub/templates/idhub/user/profile.html:51
#: idhub/user/views.py:65
msgid "Credentials"
#: idhub/admin/views.py:613 idhub/templates/idhub/base_admin.html:132
msgid "View org. credentials"
msgstr ""
#: idhub/admin/views.py:561
msgid "Configure Issues"
#: idhub/admin/views.py:620 idhub/templates/idhub/base_admin.html:137
msgid "Configure credential issuance"
msgstr ""
#: idhub/admin/views.py:568
msgid "Template List"
#: idhub/admin/views.py:627
msgid "View credential templates"
msgstr ""
#: idhub/admin/views.py:602
msgid "Upload Template"
#: idhub/admin/views.py:661
msgid "Upload template"
msgstr ""
#: idhub/admin/views.py:618 idhub/admin/views.py:744
#: idhub/admin/views.py:677
msgid "There are some errors in the file"
msgstr ""
#: idhub/admin/views.py:632
#: idhub/admin/views.py:691
msgid "This template already exists!"
msgstr ""
#: idhub/admin/views.py:638 idhub/admin/views.py:683
#: idhub/admin/views.py:697 idhub/admin/views.py:742
msgid "This is not a schema valid!"
msgstr ""
#: idhub/admin/views.py:647
msgid "Import Template"
#: idhub/admin/views.py:706
msgid "Import template"
msgstr ""
#: idhub/admin/views.py:675
msgid "The schema add successfully!"
#: idhub/admin/views.py:734
msgid "The schema was added sucessfully"
msgstr ""
#: idhub/admin/views.py:700 idhub/admin/views.py:713 idhub/admin/views.py:726
#: idhub/admin/views.py:759 idhub/templates/idhub/admin/import.html:31
#: idhub/templates/idhub/base_admin.html:153
msgid "Import data"
msgstr ""
#: idhub/admin/views.py:772 idhub/admin/views.py:785
msgid "Import"
msgstr ""
#: idhub/admin/views.py:755
msgid "There aren't file"
#: idhub/admin/views.py:798
msgid "The file import was successfully!"
msgstr ""
#: idhub/admin/views.py:760
msgid "This file already exists!"
msgstr ""
#: idhub/admin/views.py:799
msgid "The user not exist!"
msgstr ""
#: idhub/models.py:57
msgid "Enabled"
#: idhub/admin/views.py:803
msgid "Error importing the file!"
msgstr ""
#: idhub/models.py:58
#, python-brace-format
msgid ""
"The user {username} was registered: name: {first_name}, last name: "
"{last_name}"
msgstr ""
#: idhub/models.py:70
#, python-brace-format
msgid ""
"Welcome. You has been registered: name: {first_name}, last name: {last_name}"
msgstr ""
#: idhub/models.py:83
#, python-brace-format
msgid ""
"The user '{username}' has request the update of the following information: "
msgstr ""
#: idhub/models.py:95
msgid "You have requested the update of the following information: "
msgstr ""
#: idhub/models.py:132
#, python-brace-format
msgid "The admin has deleted the user: username: {username}"
msgstr ""
#: idhub/models.py:142
#, python-brace-format
msgid "New DID with DID-ID: '{did}' created by user '{username}'"
msgstr ""
#: idhub/models.py:153
#, python-brace-format
msgid "New DID with label: '{label}' and DID-ID: '{did}' was created'"
msgstr ""
#: idhub/models.py:165
#, python-brace-format
msgid ""
"The DID with label '{label}' and DID-ID: '{did}' was deleted from your wallet"
msgstr ""
#: idhub/models.py:177
#, python-brace-format
msgid "The credential of type '{type}' and ID: '{id}' was deleted"
msgstr ""
#: idhub/models.py:188
#, python-brace-format
msgid ""
"The credential of type '{type}' and ID: '{id}' was deleted from your wallet"
msgstr ""
#: idhub/models.py:200
#, python-brace-format
msgid ""
"The credential of type '{type}' and ID: '{id}' was issued for user {username}"
msgstr ""
#: idhub/models.py:212
#, python-brace-format
msgid ""
"The credential of type '{type}' and ID: '{id}' was issued and stored in your "
"wallet"
msgstr ""
#: idhub/models.py:254
#, python-brace-format
msgid "The credential of type '{type}' was enabled for user {username}"
msgstr ""
#: idhub/models.py:265
#, python-brace-format
msgid "You can request the '{type}' credential"
msgstr ""
#: idhub/models.py:276
#, python-brace-format
msgid "The credential of type '{type}' and ID: '{id}' was revoked for "
msgstr ""
#: idhub/models.py:287
#, python-brace-format
msgid "The credential of type '{type}' and ID: '{id}' was revoked by admin"
msgstr ""
#: idhub/models.py:299
msgid "A new role was created by admin"
msgstr ""
#: idhub/models.py:307
msgid "The role was modified by admin"
msgstr ""
#: idhub/models.py:315
msgid "The role was removed by admin"
msgstr ""
#: idhub/models.py:323
msgid "A new service was created by admin"
msgstr ""
#: idhub/models.py:331
msgid "The service was modified by admin"
msgstr ""
#: idhub/models.py:339
msgid "The service was removed by admin"
msgstr ""
#: idhub/models.py:347
#, python-brace-format
msgid ""
"New Organisational DID with label: '{label}' and DID-ID: '{did}' was created"
msgstr ""
#: idhub/models.py:358
#, python-brace-format
msgid ""
"Organisational DID with label: '{label}' and DID-ID: '{did}' was removed"
msgstr ""
#: idhub/models.py:438
msgid "Enabled"
msgstr ""
#: idhub/models.py:439 idhub/templates/idhub/admin/credentials.html:17
#: idhub/templates/idhub/user/credentials.html:17
msgid "Issued"
msgstr ""
#: idhub/models.py:59
#: idhub/models.py:440
msgid "Revoked"
msgstr ""
#: idhub/models.py:60
#: idhub/models.py:441
msgid "Expired"
msgstr ""
#: idhub/models.py:118
#: idhub/models.py:499
msgid "Beneficiary"
msgstr ""
#: idhub/models.py:119
#: idhub/models.py:500
msgid "Employee"
msgstr ""
#: idhub/models.py:120
msgid "Partner"
#: idhub/models.py:501
msgid "Member"
msgstr ""
#: idhub/models.py:122
#: idhub/models.py:503
msgid "Type of membership"
msgstr ""
#: idhub/models.py:124
#: idhub/models.py:505
msgid "Start date"
msgstr ""
#: idhub/models.py:125
#: idhub/models.py:506
msgid "What date did the membership start?"
msgstr ""
#: idhub/models.py:130
#: idhub/models.py:511
msgid "End date"
msgstr ""
#: idhub/models.py:131
msgid "What date did the membership end?"
#: idhub/models.py:512
msgid "What date will the membership end?"
msgstr ""
#: idhub/models.py:183
#: idhub/models.py:564
msgid "Url where to send the presentation"
msgstr ""
@ -1889,7 +2056,9 @@ msgid "Password reset on %(site_name)s"
msgstr ""
#: idhub/templates/idhub/admin/credentials.html:15
#: idhub/templates/idhub/admin/dashboard.html:13
#: idhub/templates/idhub/user/credentials.html:15
#: idhub/templates/idhub/user/dashboard.html:13
#: idhub/templates/templates/musician/billing.html:21
#: idhub/templates/templates/musician/databases.html:17
#: idhub/templates/templates/musician/domain_detail.html:17
@ -1901,11 +2070,6 @@ msgstr ""
msgid "Details"
msgstr ""
#: idhub/templates/idhub/admin/credentials.html:17
#: idhub/templates/idhub/user/credentials.html:17
msgid "Issue"
msgstr ""
#: idhub/templates/idhub/admin/credentials.html:18
#: idhub/templates/idhub/user/credentials.html:18
msgid "Status"
@ -1921,8 +2085,25 @@ msgstr ""
msgid "View"
msgstr ""
#: idhub/templates/idhub/admin/dashboard.html:14
#: idhub/templates/idhub/admin/schemas.html:18
#: idhub/templates/idhub/admin/services.html:16
#: idhub/templates/idhub/admin/user.html:88
#: idhub/templates/idhub/admin/user_edit.html:74
#: idhub/templates/idhub/user/dashboard.html:14
#: idhub/templates/idhub/user/roles.html:16
msgid "Description"
msgstr ""
#: idhub/templates/idhub/admin/dashboard.html:15
#: idhub/templates/idhub/admin/dids.html:15
#: idhub/templates/idhub/user/dashboard.html:15
#: idhub/templates/idhub/user/dids.html:15
msgid "Date"
msgstr ""
#: idhub/templates/idhub/admin/did_register.html:29
#: idhub/templates/idhub/admin/import_step3.html:27
#: idhub/templates/idhub/admin/import_add.html:27
#: idhub/templates/idhub/admin/people_membership_register.html:29
#: idhub/templates/idhub/admin/people_register.html:25
#: idhub/templates/idhub/admin/people_rol_register.html:29
@ -1933,7 +2114,6 @@ msgstr ""
#: idhub/templates/idhub/user/credentials_presentation.html:29
#: idhub/templates/idhub/user/credentials_request.html:29
#: idhub/templates/idhub/user/did_register.html:29
#: idhub/templates/idhub/user/profile.html:35
#: idhub/templates/templates/musician/address_check_delete.html:10
#: idhub/templates/templates/musician/address_form.html:11
#: idhub/templates/templates/musician/mailbox_change_password.html:11
@ -1943,7 +2123,7 @@ msgid "Cancel"
msgstr ""
#: idhub/templates/idhub/admin/did_register.html:30
#: idhub/templates/idhub/admin/import_step3.html:28
#: idhub/templates/idhub/admin/import_add.html:28
#: idhub/templates/idhub/admin/people_membership_register.html:30
#: idhub/templates/idhub/admin/people_register.html:26
#: idhub/templates/idhub/admin/people_rol_register.html:30
@ -1952,18 +2132,12 @@ msgstr ""
#: idhub/templates/idhub/admin/service_register.html:30
#: idhub/templates/idhub/admin/user_edit.html:28
#: idhub/templates/idhub/user/did_register.html:30
#: idhub/templates/idhub/user/profile.html:36
#: idhub/templates/templates/musician/address_form.html:12
#: idhub/templates/templates/musician/mailbox_change_password.html:12
#: idhub/templates/templates/musician/mailbox_form.html:21
msgid "Save"
msgstr ""
#: idhub/templates/idhub/admin/dids.html:15
#: idhub/templates/idhub/user/dids.html:15
msgid "Date"
msgstr ""
#: idhub/templates/idhub/admin/dids.html:16
#: idhub/templates/idhub/user/dids.html:16
msgid "Label"
@ -1985,8 +2159,7 @@ msgid "Remove"
msgstr ""
#: idhub/templates/idhub/admin/dids.html:35
#: idhub/templates/idhub/user/dids.html:35
msgid "Add Identity"
msgid "Add identity"
msgstr ""
#: idhub/templates/idhub/admin/dids.html:46
@ -2000,28 +2173,10 @@ msgid "Are you sure that you want delete this DID?"
msgstr ""
#: idhub/templates/idhub/admin/import.html:15
#: idhub/templates/idhub/admin/import_step2.html:15
#: idhub/templates/idhub/admin/schemas.html:15
msgid "Created at"
msgstr ""
#: idhub/templates/idhub/admin/import.html:17
msgid "success"
msgstr ""
#: idhub/templates/idhub/admin/import.html:31
msgid "Import Datas"
msgstr ""
#: idhub/templates/idhub/admin/import_step2.html:16
#: idhub/templates/idhub/admin/schemas.html:16
msgid "Template file"
msgstr ""
#: idhub/templates/idhub/admin/import_step2.html:26
msgid "Import Dates"
msgstr ""
#: idhub/templates/idhub/admin/issue_credentials.html:14
#: idhub/templates/idhub/admin/issue_credentials.html:72
msgid "Revoke"
@ -2059,11 +2214,16 @@ msgstr ""
#: idhub/templates/idhub/admin/people.html:16
#: idhub/templates/idhub/admin/user.html:62
#: idhub/templates/idhub/admin/user_edit.html:41
#: idhub/templates/idhub/user/profile.html:48
#: idhub/templates/idhub/user/profile.html:43
msgid "Membership"
msgstr ""
#: idhub/templates/idhub/admin/people.html:17
#: idhub/templates/idhub/admin/roles.html:15
#: idhub/templates/idhub/admin/services.html:17
#: idhub/templates/idhub/admin/user.html:87
#: idhub/templates/idhub/admin/user_edit.html:73
#: idhub/templates/idhub/user/roles.html:15
msgid "Role"
msgstr ""
@ -2105,12 +2265,8 @@ msgstr ""
msgid "User activation on %(site)s"
msgstr ""
#: idhub/templates/idhub/admin/roles.html:15
#: idhub/templates/idhub/admin/services.html:17
#: idhub/templates/idhub/admin/user.html:87
#: idhub/templates/idhub/admin/user_edit.html:73
#: idhub/templates/idhub/user/roles.html:15
msgid "Rol"
#: idhub/templates/idhub/admin/schemas.html:16
msgid "Template file"
msgstr ""
#: idhub/templates/idhub/admin/schemas.html:17
@ -2118,20 +2274,13 @@ msgstr ""
msgid "Name"
msgstr ""
#: idhub/templates/idhub/admin/schemas.html:18
#: idhub/templates/idhub/admin/services.html:16
#: idhub/templates/idhub/admin/user.html:88
#: idhub/templates/idhub/admin/user_edit.html:74
#: idhub/templates/idhub/user/roles.html:16
msgid "Description"
msgstr ""
#: idhub/templates/idhub/admin/schemas.html:37
msgid "Add Template"
#: idhub/templates/idhub/admin/schemas_import.html:29
msgid "Add template"
msgstr ""
#: idhub/templates/idhub/admin/schemas.html:48
msgid "Delete Template"
msgid "Delete template"
msgstr ""
#: idhub/templates/idhub/admin/schemas.html:52
@ -2139,17 +2288,13 @@ msgid "Are you sure that you want delete this template?"
msgstr ""
#: idhub/templates/idhub/admin/schemas_import.html:15
msgid "Template available"
msgid "Available templates"
msgstr ""
#: idhub/templates/idhub/admin/schemas_import.html:23
msgid "Add"
msgstr ""
#: idhub/templates/idhub/admin/schemas_import.html:29
msgid "Add template"
msgstr ""
#: idhub/templates/idhub/admin/services.html:15
#: idhub/templates/idhub/admin/user.html:89
#: idhub/templates/idhub/admin/user_edit.html:75
@ -2157,6 +2302,10 @@ msgstr ""
msgid "Service"
msgstr ""
#: idhub/templates/idhub/admin/services.html:35
msgid "Add Service"
msgstr ""
#: idhub/templates/idhub/admin/user.html:13
msgid "Modify"
msgstr ""
@ -2171,13 +2320,13 @@ msgstr ""
#: idhub/templates/idhub/admin/user.html:63
#: idhub/templates/idhub/admin/user_edit.html:42
#: idhub/templates/idhub/user/profile.html:49
#: idhub/templates/idhub/user/profile.html:44
msgid "From"
msgstr ""
#: idhub/templates/idhub/admin/user.html:64
#: idhub/templates/idhub/admin/user_edit.html:43
#: idhub/templates/idhub/user/profile.html:50
#: idhub/templates/idhub/user/profile.html:45
msgid "To"
msgstr ""
@ -2193,6 +2342,67 @@ msgstr ""
msgid "Add membership"
msgstr ""
#: idhub/templates/idhub/base.html:76
msgid "My information"
msgstr ""
#: idhub/templates/idhub/base.html:81
msgid "My personal information"
msgstr ""
#: idhub/templates/idhub/base.html:86 idhub/user/views.py:63
msgid "My roles"
msgstr ""
#: idhub/templates/idhub/base.html:91 idhub/user/views.py:69
msgid "GDPR info"
msgstr ""
#: idhub/templates/idhub/base.html:99 idhub/user/views.py:27
msgid "My wallet"
msgstr ""
#: idhub/templates/idhub/base.html:104 idhub/user/views.py:170
#: idhub/user/views.py:204 idhub/user/views.py:223
msgid "Identities (DIDs)"
msgstr ""
#: idhub/templates/idhub/base.html:109
msgid "My credentials"
msgstr ""
#: idhub/templates/idhub/base.html:114
msgid "Request a credential"
msgstr ""
#: idhub/templates/idhub/base.html:119
msgid "Present a credential"
msgstr ""
#: idhub/templates/idhub/base_admin.html:76
msgid "User managament"
msgstr ""
#: idhub/templates/idhub/base_admin.html:94
msgid "Access control managament"
msgstr ""
#: idhub/templates/idhub/base_admin.html:112 idhub/user/views.py:75
msgid "Credential management"
msgstr ""
#: idhub/templates/idhub/base_admin.html:122
msgid "Organization's wallet"
msgstr ""
#: idhub/templates/idhub/base_admin.html:127
msgid "Manage Identities (DIDs)"
msgstr ""
#: idhub/templates/idhub/base_admin.html:147
msgid "Credential template management"
msgstr ""
#: idhub/templates/idhub/user/credentials_presentation.html:30
msgid "Send"
msgstr ""
@ -2201,6 +2411,10 @@ msgstr ""
msgid "Request"
msgstr ""
#: idhub/templates/idhub/user/dids.html:35
msgid "Add Identity"
msgstr ""
#: idhub/templates/idhub/user/profile.html:13
msgid "ARCO Forms"
msgstr ""
@ -2209,6 +2423,10 @@ msgstr ""
msgid "Notice of Privacy"
msgstr ""
#: idhub/templates/idhub/user/profile.html:46
msgid "Credentials"
msgstr ""
#: idhub/templates/templates/musician/address_check_delete.html:7
#, python-format
msgid "Are you sure that you want remove the address: \"%(address_name)s\"?"
@ -2510,54 +2728,38 @@ msgstr ""
msgid "My profile"
msgstr ""
#: idhub/user/views.py:27
msgid "My Wallet"
msgstr ""
#: idhub/user/views.py:41
msgid "My personal Data"
msgid "My personal data"
msgstr ""
#: idhub/user/views.py:53
msgid "My roles"
msgstr ""
#: idhub/user/views.py:59
msgid "GDPR info"
msgstr ""
#: idhub/user/views.py:78
#: idhub/user/views.py:88
msgid "Credential"
msgstr ""
#: idhub/user/views.py:114
msgid "Credentials request"
#: idhub/user/views.py:124
msgid "Credential request"
msgstr ""
#: idhub/user/views.py:127
msgid "The credential was required successfully!"
#: idhub/user/views.py:137
msgid "The credential was issued successfully!"
msgstr ""
#: idhub/user/views.py:129
msgid "Not exists the credential!"
#: idhub/user/views.py:141
msgid "The credential does not exist!"
msgstr ""
#: idhub/user/views.py:135
msgid "Credentials Presentation"
#: idhub/user/views.py:147
msgid "Credential presentation"
msgstr ""
#: idhub/user/views.py:148
#: idhub/user/views.py:162
msgid "The credential was presented successfully!"
msgstr ""
#: idhub/user/views.py:150
#: idhub/user/views.py:164
msgid "Error sending credential!"
msgstr ""
#: idhub/user/views.py:156 idhub/user/views.py:194 idhub/user/views.py:213
msgid "Identities (DID)"
msgstr ""
#: idhub/user/views.py:169
msgid "Add a new Identities (DID)"
#: idhub/user/views.py:183
msgid "Add a new Identity (DID)"
msgstr ""

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-07 17:54+0100\n"
"POT-Creation-Date: 2023-11-13 11:12+0100\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"
@ -1533,233 +1533,400 @@ msgstr ""
msgid "show this help message and exit"
msgstr ""
#: idhub/admin/views.py:39 idhub/user/views.py:33
#: idhub/admin/forms.py:106
msgid "The user does not exist!"
msgstr ""
#: idhub/admin/views.py:43 idhub/templates/idhub/base.html:69
#: idhub/templates/idhub/base_admin.html:69 idhub/user/views.py:33
msgid "Dashboard"
msgstr ""
#: idhub/admin/views.py:40 idhub/user/views.py:34
#: idhub/admin/views.py:44 idhub/templates/idhub/admin/import.html:17
#: idhub/user/views.py:34
msgid "Success"
msgstr ""
#: idhub/admin/views.py:45
msgid "People Management"
#: idhub/admin/views.py:56
msgid "User Management"
msgstr ""
#: idhub/admin/views.py:50
msgid "Access Control Management"
#: idhub/admin/views.py:61
msgid "Access control management"
msgstr ""
#: idhub/admin/views.py:55
msgid "Credentials Management"
msgstr ""
#: idhub/admin/views.py:60
msgid "Templates Management"
msgstr ""
#: idhub/admin/views.py:65
msgid "Massive Data Management"
#: idhub/admin/views.py:66
msgid "Credential Management"
msgstr ""
#: idhub/admin/views.py:71
msgid "People list"
msgid "Template Management"
msgstr ""
#: idhub/admin/views.py:84
msgid "User Profile"
#: idhub/admin/views.py:76
msgid "Data file management"
msgstr ""
#: idhub/admin/views.py:108
#: idhub/admin/views.py:82 idhub/templates/idhub/base_admin.html:81
msgid "View users"
msgstr ""
#: idhub/admin/views.py:95
msgid "User personal information"
msgstr ""
#: idhub/admin/views.py:119
msgid "Is not possible deactivate your account!"
msgstr ""
#: idhub/admin/views.py:129 idhub/admin/views.py:235
#: idhub/admin/views.py:143 idhub/admin/views.py:261
msgid "Is not possible delete your account!"
msgstr ""
#: idhub/admin/views.py:141
msgid "People Register"
#: idhub/admin/views.py:155
msgid "The account is updated successfully"
msgstr ""
#: idhub/admin/views.py:156
msgid "The account is created successfully"
#: idhub/admin/views.py:164 idhub/templates/idhub/base_admin.html:86
msgid "Add user"
msgstr ""
#: idhub/admin/views.py:167 idhub/admin/views.py:204
#: idhub/admin/views.py:179
msgid "The account was created successfully"
msgstr ""
#: idhub/admin/views.py:193
msgid "Associate a membership to the user"
msgstr ""
#: idhub/admin/views.py:230
msgid "People add membership"
msgstr ""
#: idhub/admin/views.py:242
msgid "Add Rol to User"
#: idhub/admin/views.py:268
msgid "Add a user role to access a service"
msgstr ""
#: idhub/admin/views.py:272
msgid "Edit Rol to User"
#: idhub/admin/views.py:298
msgid "Modify a user role to access a service"
msgstr ""
#: idhub/admin/views.py:307
msgid "Roles Management"
#: idhub/admin/views.py:333 idhub/templates/idhub/base_admin.html:99
msgid "Manage roles"
msgstr ""
#: idhub/admin/views.py:319 idhub/templates/idhub/admin/roles.html:31
#: idhub/admin/views.py:345 idhub/templates/idhub/admin/roles.html:31
#: idhub/templates/idhub/admin/user_edit.html:93
msgid "Add Rol"
msgid "Add Role"
msgstr ""
#: idhub/admin/views.py:329
msgid "Edit Rol"
#: idhub/admin/views.py:354
msgid "Role created successfully"
msgstr ""
#: idhub/admin/views.py:356
msgid "Service Management"
#: idhub/admin/views.py:361
msgid "Edit Role"
msgstr ""
#: idhub/admin/views.py:368 idhub/templates/idhub/admin/services.html:35
msgid "Add Service"
#: idhub/admin/views.py:376
msgid "Role updated successfully"
msgstr ""
#: idhub/admin/views.py:378
msgid "Edit Service"
#: idhub/admin/views.py:389
msgid "Role deleted successfully"
msgstr ""
#: idhub/admin/views.py:405
msgid "Credentials list"
#: idhub/admin/views.py:396 idhub/templates/idhub/base_admin.html:104
msgid "Manage services"
msgstr ""
#: idhub/admin/views.py:418
#: idhub/admin/views.py:408
msgid "Add service"
msgstr ""
#: idhub/admin/views.py:417
msgid "Service created successfully"
msgstr ""
#: idhub/admin/views.py:424
msgid "Modify service"
msgstr ""
#: idhub/admin/views.py:439
msgid "Service updated successfully"
msgstr ""
#: idhub/admin/views.py:452
msgid "Service deleted successfully"
msgstr ""
#: idhub/admin/views.py:459 idhub/templates/idhub/base_admin.html:117
msgid "View credentials"
msgstr ""
#: idhub/admin/views.py:472
msgid "Change status of Credential"
msgstr ""
#: idhub/admin/views.py:460
#: idhub/admin/views.py:514
msgid "Credential revoked successfully"
msgstr ""
#: idhub/admin/views.py:480
#: idhub/admin/views.py:536
msgid "Credential deleted successfully"
msgstr ""
#: idhub/admin/views.py:487 idhub/admin/views.py:518 idhub/admin/views.py:537
msgid "Organization Identities (DID)"
#: idhub/admin/views.py:545
msgid "Manage Identities (DID)"
msgstr ""
#: idhub/admin/views.py:500
#: idhub/admin/views.py:558
msgid "Add a new Organization Identities (DID)"
msgstr ""
#: idhub/admin/views.py:512 idhub/user/views.py:188
#: idhub/admin/views.py:570 idhub/user/views.py:195
msgid "DID created successfully"
msgstr ""
#: idhub/admin/views.py:532 idhub/user/views.py:208
#: idhub/admin/views.py:577 idhub/admin/views.py:596
msgid "Organization Identities (DID)"
msgstr ""
#: idhub/admin/views.py:591 idhub/user/views.py:218
msgid "DID updated successfully"
msgstr ""
#: idhub/admin/views.py:547 idhub/user/views.py:223
#: idhub/admin/views.py:607 idhub/user/views.py:234
msgid "DID delete successfully"
msgstr ""
#: idhub/admin/views.py:554 idhub/templates/idhub/user/profile.html:51
#: idhub/user/views.py:65
msgid "Credentials"
#: idhub/admin/views.py:613 idhub/templates/idhub/base_admin.html:132
msgid "View org. credentials"
msgstr ""
#: idhub/admin/views.py:561
msgid "Configure Issues"
#: idhub/admin/views.py:620 idhub/templates/idhub/base_admin.html:137
msgid "Configure credential issuance"
msgstr ""
#: idhub/admin/views.py:568
msgid "Template List"
#: idhub/admin/views.py:627
msgid "View credential templates"
msgstr ""
#: idhub/admin/views.py:602
msgid "Upload Template"
#: idhub/admin/views.py:661
msgid "Upload template"
msgstr ""
#: idhub/admin/views.py:618 idhub/admin/views.py:744
#: idhub/admin/views.py:677
msgid "There are some errors in the file"
msgstr ""
#: idhub/admin/views.py:632
#: idhub/admin/views.py:691
msgid "This template already exists!"
msgstr ""
#: idhub/admin/views.py:638 idhub/admin/views.py:683
#: idhub/admin/views.py:697 idhub/admin/views.py:742
msgid "This is not a schema valid!"
msgstr ""
#: idhub/admin/views.py:647
msgid "Import Template"
#: idhub/admin/views.py:706
msgid "Import template"
msgstr ""
#: idhub/admin/views.py:675
msgid "The schema add successfully!"
#: idhub/admin/views.py:734
msgid "The schema was added sucessfully"
msgstr ""
#: idhub/admin/views.py:700 idhub/admin/views.py:713 idhub/admin/views.py:726
#: idhub/admin/views.py:759 idhub/templates/idhub/admin/import.html:31
#: idhub/templates/idhub/base_admin.html:153
msgid "Import data"
msgstr ""
#: idhub/admin/views.py:772 idhub/admin/views.py:785
msgid "Import"
msgstr ""
#: idhub/admin/views.py:755
msgid "There aren't file"
#: idhub/admin/views.py:798
msgid "The file import was successfully!"
msgstr ""
#: idhub/admin/views.py:760
msgid "This file already exists!"
msgstr ""
#: idhub/admin/views.py:799
msgid "The user not exist!"
msgstr ""
#: idhub/models.py:57
msgid "Enabled"
#: idhub/admin/views.py:803
msgid "Error importing the file!"
msgstr ""
#: idhub/models.py:58
#, python-brace-format
msgid ""
"The user {username} was registered: name: {first_name}, last name: "
"{last_name}"
msgstr ""
#: idhub/models.py:70
#, python-brace-format
msgid ""
"Welcome. You has been registered: name: {first_name}, last name: {last_name}"
msgstr ""
#: idhub/models.py:83
#, python-brace-format
msgid ""
"The user '{username}' has request the update of the following information: "
msgstr ""
#: idhub/models.py:95
msgid "You have requested the update of the following information: "
msgstr ""
#: idhub/models.py:132
#, python-brace-format
msgid "The admin has deleted the user: username: {username}"
msgstr ""
#: idhub/models.py:142
#, python-brace-format
msgid "New DID with DID-ID: '{did}' created by user '{username}'"
msgstr ""
#: idhub/models.py:153
#, python-brace-format
msgid "New DID with label: '{label}' and DID-ID: '{did}' was created'"
msgstr ""
#: idhub/models.py:165
#, python-brace-format
msgid ""
"The DID with label '{label}' and DID-ID: '{did}' was deleted from your wallet"
msgstr ""
#: idhub/models.py:177
#, python-brace-format
msgid "The credential of type '{type}' and ID: '{id}' was deleted"
msgstr ""
#: idhub/models.py:188
#, python-brace-format
msgid ""
"The credential of type '{type}' and ID: '{id}' was deleted from your wallet"
msgstr ""
#: idhub/models.py:200
#, python-brace-format
msgid ""
"The credential of type '{type}' and ID: '{id}' was issued for user {username}"
msgstr ""
#: idhub/models.py:212
#, python-brace-format
msgid ""
"The credential of type '{type}' and ID: '{id}' was issued and stored in your "
"wallet"
msgstr ""
#: idhub/models.py:254
#, python-brace-format
msgid "The credential of type '{type}' was enabled for user {username}"
msgstr ""
#: idhub/models.py:265
#, python-brace-format
msgid "You can request the '{type}' credential"
msgstr ""
#: idhub/models.py:276
#, python-brace-format
msgid "The credential of type '{type}' and ID: '{id}' was revoked for "
msgstr ""
#: idhub/models.py:287
#, python-brace-format
msgid "The credential of type '{type}' and ID: '{id}' was revoked by admin"
msgstr ""
#: idhub/models.py:299
msgid "A new role was created by admin"
msgstr ""
#: idhub/models.py:307
msgid "The role was modified by admin"
msgstr ""
#: idhub/models.py:315
msgid "The role was removed by admin"
msgstr ""
#: idhub/models.py:323
msgid "A new service was created by admin"
msgstr ""
#: idhub/models.py:331
msgid "The service was modified by admin"
msgstr ""
#: idhub/models.py:339
msgid "The service was removed by admin"
msgstr ""
#: idhub/models.py:347
#, python-brace-format
msgid ""
"New Organisational DID with label: '{label}' and DID-ID: '{did}' was created"
msgstr ""
#: idhub/models.py:358
#, python-brace-format
msgid ""
"Organisational DID with label: '{label}' and DID-ID: '{did}' was removed"
msgstr ""
#: idhub/models.py:438
msgid "Enabled"
msgstr ""
#: idhub/models.py:439 idhub/templates/idhub/admin/credentials.html:17
#: idhub/templates/idhub/user/credentials.html:17
msgid "Issued"
msgstr ""
#: idhub/models.py:59
#: idhub/models.py:440
msgid "Revoked"
msgstr ""
#: idhub/models.py:60
#: idhub/models.py:441
msgid "Expired"
msgstr ""
#: idhub/models.py:118
#: idhub/models.py:499
msgid "Beneficiary"
msgstr ""
#: idhub/models.py:119
#: idhub/models.py:500
msgid "Employee"
msgstr ""
#: idhub/models.py:120
msgid "Partner"
#: idhub/models.py:501
msgid "Member"
msgstr ""
#: idhub/models.py:122
#: idhub/models.py:503
msgid "Type of membership"
msgstr ""
#: idhub/models.py:124
#: idhub/models.py:505
msgid "Start date"
msgstr ""
#: idhub/models.py:125
#: idhub/models.py:506
msgid "What date did the membership start?"
msgstr ""
#: idhub/models.py:130
#: idhub/models.py:511
msgid "End date"
msgstr ""
#: idhub/models.py:131
msgid "What date did the membership end?"
#: idhub/models.py:512
msgid "What date will the membership end?"
msgstr ""
#: idhub/models.py:183
#: idhub/models.py:564
msgid "Url where to send the presentation"
msgstr ""
@ -1889,7 +2056,9 @@ msgid "Password reset on %(site_name)s"
msgstr ""
#: idhub/templates/idhub/admin/credentials.html:15
#: idhub/templates/idhub/admin/dashboard.html:13
#: idhub/templates/idhub/user/credentials.html:15
#: idhub/templates/idhub/user/dashboard.html:13
#: idhub/templates/templates/musician/billing.html:21
#: idhub/templates/templates/musician/databases.html:17
#: idhub/templates/templates/musician/domain_detail.html:17
@ -1901,11 +2070,6 @@ msgstr ""
msgid "Details"
msgstr ""
#: idhub/templates/idhub/admin/credentials.html:17
#: idhub/templates/idhub/user/credentials.html:17
msgid "Issue"
msgstr ""
#: idhub/templates/idhub/admin/credentials.html:18
#: idhub/templates/idhub/user/credentials.html:18
msgid "Status"
@ -1921,8 +2085,25 @@ msgstr ""
msgid "View"
msgstr ""
#: idhub/templates/idhub/admin/dashboard.html:14
#: idhub/templates/idhub/admin/schemas.html:18
#: idhub/templates/idhub/admin/services.html:16
#: idhub/templates/idhub/admin/user.html:88
#: idhub/templates/idhub/admin/user_edit.html:74
#: idhub/templates/idhub/user/dashboard.html:14
#: idhub/templates/idhub/user/roles.html:16
msgid "Description"
msgstr ""
#: idhub/templates/idhub/admin/dashboard.html:15
#: idhub/templates/idhub/admin/dids.html:15
#: idhub/templates/idhub/user/dashboard.html:15
#: idhub/templates/idhub/user/dids.html:15
msgid "Date"
msgstr ""
#: idhub/templates/idhub/admin/did_register.html:29
#: idhub/templates/idhub/admin/import_step3.html:27
#: idhub/templates/idhub/admin/import_add.html:27
#: idhub/templates/idhub/admin/people_membership_register.html:29
#: idhub/templates/idhub/admin/people_register.html:25
#: idhub/templates/idhub/admin/people_rol_register.html:29
@ -1933,7 +2114,6 @@ msgstr ""
#: idhub/templates/idhub/user/credentials_presentation.html:29
#: idhub/templates/idhub/user/credentials_request.html:29
#: idhub/templates/idhub/user/did_register.html:29
#: idhub/templates/idhub/user/profile.html:35
#: idhub/templates/templates/musician/address_check_delete.html:10
#: idhub/templates/templates/musician/address_form.html:11
#: idhub/templates/templates/musician/mailbox_change_password.html:11
@ -1943,7 +2123,7 @@ msgid "Cancel"
msgstr ""
#: idhub/templates/idhub/admin/did_register.html:30
#: idhub/templates/idhub/admin/import_step3.html:28
#: idhub/templates/idhub/admin/import_add.html:28
#: idhub/templates/idhub/admin/people_membership_register.html:30
#: idhub/templates/idhub/admin/people_register.html:26
#: idhub/templates/idhub/admin/people_rol_register.html:30
@ -1952,18 +2132,12 @@ msgstr ""
#: idhub/templates/idhub/admin/service_register.html:30
#: idhub/templates/idhub/admin/user_edit.html:28
#: idhub/templates/idhub/user/did_register.html:30
#: idhub/templates/idhub/user/profile.html:36
#: idhub/templates/templates/musician/address_form.html:12
#: idhub/templates/templates/musician/mailbox_change_password.html:12
#: idhub/templates/templates/musician/mailbox_form.html:21
msgid "Save"
msgstr ""
#: idhub/templates/idhub/admin/dids.html:15
#: idhub/templates/idhub/user/dids.html:15
msgid "Date"
msgstr ""
#: idhub/templates/idhub/admin/dids.html:16
#: idhub/templates/idhub/user/dids.html:16
msgid "Label"
@ -1985,8 +2159,7 @@ msgid "Remove"
msgstr ""
#: idhub/templates/idhub/admin/dids.html:35
#: idhub/templates/idhub/user/dids.html:35
msgid "Add Identity"
msgid "Add identity"
msgstr ""
#: idhub/templates/idhub/admin/dids.html:46
@ -2000,28 +2173,10 @@ msgid "Are you sure that you want delete this DID?"
msgstr ""
#: idhub/templates/idhub/admin/import.html:15
#: idhub/templates/idhub/admin/import_step2.html:15
#: idhub/templates/idhub/admin/schemas.html:15
msgid "Created at"
msgstr ""
#: idhub/templates/idhub/admin/import.html:17
msgid "success"
msgstr ""
#: idhub/templates/idhub/admin/import.html:31
msgid "Import Datas"
msgstr ""
#: idhub/templates/idhub/admin/import_step2.html:16
#: idhub/templates/idhub/admin/schemas.html:16
msgid "Template file"
msgstr ""
#: idhub/templates/idhub/admin/import_step2.html:26
msgid "Import Dates"
msgstr ""
#: idhub/templates/idhub/admin/issue_credentials.html:14
#: idhub/templates/idhub/admin/issue_credentials.html:72
msgid "Revoke"
@ -2059,11 +2214,16 @@ msgstr ""
#: idhub/templates/idhub/admin/people.html:16
#: idhub/templates/idhub/admin/user.html:62
#: idhub/templates/idhub/admin/user_edit.html:41
#: idhub/templates/idhub/user/profile.html:48
#: idhub/templates/idhub/user/profile.html:43
msgid "Membership"
msgstr ""
#: idhub/templates/idhub/admin/people.html:17
#: idhub/templates/idhub/admin/roles.html:15
#: idhub/templates/idhub/admin/services.html:17
#: idhub/templates/idhub/admin/user.html:87
#: idhub/templates/idhub/admin/user_edit.html:73
#: idhub/templates/idhub/user/roles.html:15
msgid "Role"
msgstr ""
@ -2105,12 +2265,8 @@ msgstr ""
msgid "User activation on %(site)s"
msgstr ""
#: idhub/templates/idhub/admin/roles.html:15
#: idhub/templates/idhub/admin/services.html:17
#: idhub/templates/idhub/admin/user.html:87
#: idhub/templates/idhub/admin/user_edit.html:73
#: idhub/templates/idhub/user/roles.html:15
msgid "Rol"
#: idhub/templates/idhub/admin/schemas.html:16
msgid "Template file"
msgstr ""
#: idhub/templates/idhub/admin/schemas.html:17
@ -2118,20 +2274,13 @@ msgstr ""
msgid "Name"
msgstr ""
#: idhub/templates/idhub/admin/schemas.html:18
#: idhub/templates/idhub/admin/services.html:16
#: idhub/templates/idhub/admin/user.html:88
#: idhub/templates/idhub/admin/user_edit.html:74
#: idhub/templates/idhub/user/roles.html:16
msgid "Description"
msgstr ""
#: idhub/templates/idhub/admin/schemas.html:37
msgid "Add Template"
#: idhub/templates/idhub/admin/schemas_import.html:29
msgid "Add template"
msgstr ""
#: idhub/templates/idhub/admin/schemas.html:48
msgid "Delete Template"
msgid "Delete template"
msgstr ""
#: idhub/templates/idhub/admin/schemas.html:52
@ -2139,17 +2288,13 @@ msgid "Are you sure that you want delete this template?"
msgstr ""
#: idhub/templates/idhub/admin/schemas_import.html:15
msgid "Template available"
msgid "Available templates"
msgstr ""
#: idhub/templates/idhub/admin/schemas_import.html:23
msgid "Add"
msgstr ""
#: idhub/templates/idhub/admin/schemas_import.html:29
msgid "Add template"
msgstr ""
#: idhub/templates/idhub/admin/services.html:15
#: idhub/templates/idhub/admin/user.html:89
#: idhub/templates/idhub/admin/user_edit.html:75
@ -2157,6 +2302,10 @@ msgstr ""
msgid "Service"
msgstr ""
#: idhub/templates/idhub/admin/services.html:35
msgid "Add Service"
msgstr ""
#: idhub/templates/idhub/admin/user.html:13
msgid "Modify"
msgstr ""
@ -2171,13 +2320,13 @@ msgstr ""
#: idhub/templates/idhub/admin/user.html:63
#: idhub/templates/idhub/admin/user_edit.html:42
#: idhub/templates/idhub/user/profile.html:49
#: idhub/templates/idhub/user/profile.html:44
msgid "From"
msgstr ""
#: idhub/templates/idhub/admin/user.html:64
#: idhub/templates/idhub/admin/user_edit.html:43
#: idhub/templates/idhub/user/profile.html:50
#: idhub/templates/idhub/user/profile.html:45
msgid "To"
msgstr ""
@ -2193,6 +2342,67 @@ msgstr ""
msgid "Add membership"
msgstr ""
#: idhub/templates/idhub/base.html:76
msgid "My information"
msgstr ""
#: idhub/templates/idhub/base.html:81
msgid "My personal information"
msgstr ""
#: idhub/templates/idhub/base.html:86 idhub/user/views.py:63
msgid "My roles"
msgstr ""
#: idhub/templates/idhub/base.html:91 idhub/user/views.py:69
msgid "GDPR info"
msgstr ""
#: idhub/templates/idhub/base.html:99 idhub/user/views.py:27
msgid "My wallet"
msgstr ""
#: idhub/templates/idhub/base.html:104 idhub/user/views.py:170
#: idhub/user/views.py:204 idhub/user/views.py:223
msgid "Identities (DIDs)"
msgstr ""
#: idhub/templates/idhub/base.html:109
msgid "My credentials"
msgstr ""
#: idhub/templates/idhub/base.html:114
msgid "Request a credential"
msgstr ""
#: idhub/templates/idhub/base.html:119
msgid "Present a credential"
msgstr ""
#: idhub/templates/idhub/base_admin.html:76
msgid "User managament"
msgstr ""
#: idhub/templates/idhub/base_admin.html:94
msgid "Access control managament"
msgstr ""
#: idhub/templates/idhub/base_admin.html:112 idhub/user/views.py:75
msgid "Credential management"
msgstr ""
#: idhub/templates/idhub/base_admin.html:122
msgid "Organization's wallet"
msgstr ""
#: idhub/templates/idhub/base_admin.html:127
msgid "Manage Identities (DIDs)"
msgstr ""
#: idhub/templates/idhub/base_admin.html:147
msgid "Credential template management"
msgstr ""
#: idhub/templates/idhub/user/credentials_presentation.html:30
msgid "Send"
msgstr ""
@ -2201,6 +2411,10 @@ msgstr ""
msgid "Request"
msgstr ""
#: idhub/templates/idhub/user/dids.html:35
msgid "Add Identity"
msgstr ""
#: idhub/templates/idhub/user/profile.html:13
msgid "ARCO Forms"
msgstr ""
@ -2209,6 +2423,10 @@ msgstr ""
msgid "Notice of Privacy"
msgstr ""
#: idhub/templates/idhub/user/profile.html:46
msgid "Credentials"
msgstr ""
#: idhub/templates/templates/musician/address_check_delete.html:7
#, python-format
msgid "Are you sure that you want remove the address: \"%(address_name)s\"?"
@ -2510,54 +2728,38 @@ msgstr ""
msgid "My profile"
msgstr ""
#: idhub/user/views.py:27
msgid "My Wallet"
msgstr ""
#: idhub/user/views.py:41
msgid "My personal Data"
msgid "My personal data"
msgstr ""
#: idhub/user/views.py:53
msgid "My roles"
msgstr ""
#: idhub/user/views.py:59
msgid "GDPR info"
msgstr ""
#: idhub/user/views.py:78
#: idhub/user/views.py:88
msgid "Credential"
msgstr ""
#: idhub/user/views.py:114
msgid "Credentials request"
#: idhub/user/views.py:124
msgid "Credential request"
msgstr ""
#: idhub/user/views.py:127
msgid "The credential was required successfully!"
#: idhub/user/views.py:137
msgid "The credential was issued successfully!"
msgstr ""
#: idhub/user/views.py:129
msgid "Not exists the credential!"
#: idhub/user/views.py:141
msgid "The credential does not exist!"
msgstr ""
#: idhub/user/views.py:135
msgid "Credentials Presentation"
#: idhub/user/views.py:147
msgid "Credential presentation"
msgstr ""
#: idhub/user/views.py:148
#: idhub/user/views.py:162
msgid "The credential was presented successfully!"
msgstr ""
#: idhub/user/views.py:150
#: idhub/user/views.py:164
msgid "Error sending credential!"
msgstr ""
#: idhub/user/views.py:156 idhub/user/views.py:194 idhub/user/views.py:213
msgid "Identities (DID)"
msgstr ""
#: idhub/user/views.py:169
msgid "Add a new Identities (DID)"
#: idhub/user/views.py:183
msgid "Add a new Identity (DID)"
msgstr ""

View File

@ -143,12 +143,8 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/4.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = config('TIME_ZONE', 'UTC')
USE_I18N = True
USE_TZ = True
@ -181,5 +177,8 @@ MESSAGE_TAGS = {
LOCALE_PATHS = [
os.path.join(BASE_DIR, 'locale'),
]
LANGUAGE_CODE="es"
USE_I18N = True
USE_L10N = True
AUTH_USER_MODEL = 'idhub_auth.User'