From 2d4af14b7519f9cdf91aeba0c1f474ac9a83b0fe Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 9 Oct 2023 17:59:15 +0200 Subject: [PATCH] admin sections --- idhub/admin/__init__.py | 0 idhub/admin/views.py | 128 ++++++++++++++++++ idhub/templates/idhub/admin_credentials.html | 5 + idhub/templates/idhub/admin_dashboard.html | 4 - idhub/templates/idhub/admin_export.html | 5 + idhub/templates/idhub/admin_import.html | 5 + .../idhub/admin_issue_credentials.html | 5 + idhub/templates/idhub/admin_people.html | 5 + .../idhub/admin_people_register.html | 5 + .../idhub/admin_revoke_credentials.html | 5 + idhub/templates/idhub/admin_roles.html | 5 + idhub/templates/idhub/admin_schemes.html | 5 + .../templates/idhub/admin_schemes_export.html | 5 + .../templates/idhub/admin_schemes_import.html | 5 + idhub/templates/idhub/admin_services.html | 5 + .../idhub/admin_wallet_credentials.html | 5 + .../idhub/admin_wallet_identities.html | 5 + .../templates/idhub/admin_wallet_issues.html | 5 + idhub/templates/idhub/base_admin.html | 60 ++++---- idhub/urls.py | 40 +++++- 20 files changed, 272 insertions(+), 35 deletions(-) create mode 100644 idhub/admin/__init__.py create mode 100644 idhub/admin/views.py create mode 100644 idhub/templates/idhub/admin_credentials.html create mode 100644 idhub/templates/idhub/admin_export.html create mode 100644 idhub/templates/idhub/admin_import.html create mode 100644 idhub/templates/idhub/admin_issue_credentials.html create mode 100644 idhub/templates/idhub/admin_people.html create mode 100644 idhub/templates/idhub/admin_people_register.html create mode 100644 idhub/templates/idhub/admin_revoke_credentials.html create mode 100644 idhub/templates/idhub/admin_roles.html create mode 100644 idhub/templates/idhub/admin_schemes.html create mode 100644 idhub/templates/idhub/admin_schemes_export.html create mode 100644 idhub/templates/idhub/admin_schemes_import.html create mode 100644 idhub/templates/idhub/admin_services.html create mode 100644 idhub/templates/idhub/admin_wallet_credentials.html create mode 100644 idhub/templates/idhub/admin_wallet_identities.html create mode 100644 idhub/templates/idhub/admin_wallet_issues.html diff --git a/idhub/admin/__init__.py b/idhub/admin/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/idhub/admin/views.py b/idhub/admin/views.py new file mode 100644 index 0000000..221a59c --- /dev/null +++ b/idhub/admin/views.py @@ -0,0 +1,128 @@ +import logging + +from django.utils.translation import gettext_lazy as _ +from django.urls import reverse_lazy +from django.contrib import messages +from idhub.mixins import AdminView + + +class AdminDashboardView(AdminView): + template_name = "idhub/admin_dashboard.html" + title = _('Dashboard') + subtitle = _('Success') + icon = 'bi bi-bell' + section = "Home" + +class People(AdminView): + title = _("People Management") + section = "People" + + +class AccessControl(AdminView): + title = _("Access Control Management") + section = "AccessControl" + + +class Credentials(AdminView): + title = _("Credentials Management") + section = "Credentials" + + +class Schemes(AdminView): + title = _("Schemes Management") + section = "Schemes" + + +class ImportExport(AdminView): + title = _("Massive Data Management") + section = "ImportExport" + + +class AdminPeopleView(People): + template_name = "idhub/admin_people.html" + subtitle = _('People list') + icon = 'bi bi-person' + + +class AdminPeopleRegisterView(People): + template_name = "idhub/admin_people_register.html" + subtitle = _('People Register') + icon = 'bi bi-person' + + +class AdminRolesView(AccessControl): + template_name = "idhub/admin_roles.html" + subtitle = _('Roles Management') + icon = 'bi bi-person' + + +class AdminServicesView(AccessControl): + template_name = "idhub/admin_services.html" + subtitle = _('Service Management') + icon = 'bi bi-person' + + +class AdminCredentialsView(Credentials): + template_name = "idhub/admin_credentials.html" + subtitle = _('Credentials list') + icon = 'bi bi-person' + + +class AdminIssueCredentialsView(Credentials): + template_name = "idhub/admin_issue_credentials.html" + subtitle = _('Issuance of Credentials') + icon = 'bi bi-person' + + +class AdminRevokeCredentialsView(Credentials): + template_name = "idhub/admin_revoke_credentials.html" + subtitle = _('Revoke Credentials') + icon = 'bi bi-person' + + +class AdminWalletIdentitiesView(Credentials): + template_name = "idhub/admin_wallet_identities.html" + subtitle = _('Identities (DID)') + icon = 'bi bi-person' + + +class AdminWalletCredentialsView(Credentials): + template_name = "idhub/admin_wallet_credentials.html" + subtitle = _('Credentials') + icon = 'bi bi-person' + + +class AdminWalletConfigIssuesView(Credentials): + template_name = "idhub/admin_wallet_issues.html" + subtitle = _('Configure Issues') + icon = 'bi bi-person' + + +class AdminSchemesView(Schemes): + template_name = "idhub/admin_schemes.html" + subtitle = _('Schemes List') + icon = 'bi bi-person' + + +class AdminSchemesImportView(Schemes): + template_name = "idhub/admin_schemes_import.html" + subtitle = _('Import Schemes') + icon = 'bi bi-person' + + +class AdminSchemesExportView(Schemes): + template_name = "idhub/admin_schemes_export.html" + subtitle = _('Export Schemes') + icon = 'bi bi-person' + + +class AdminImportView(ImportExport): + template_name = "idhub/admin_import.html" + subtitle = _('Import') + icon = 'bi bi-person' + + +class AdminExportView(ImportExport): + template_name = "idhub/admin_export.html" + subtitle = _('Export') + icon = 'bi bi-person' diff --git a/idhub/templates/idhub/admin_credentials.html b/idhub/templates/idhub/admin_credentials.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_credentials.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_dashboard.html b/idhub/templates/idhub/admin_dashboard.html index 886430b..cddd2ee 100644 --- a/idhub/templates/idhub/admin_dashboard.html +++ b/idhub/templates/idhub/admin_dashboard.html @@ -2,10 +2,6 @@ {% load i18n %} {% block content %} -

- - Identities (DID) -

diff --git a/idhub/templates/idhub/admin_export.html b/idhub/templates/idhub/admin_export.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_export.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_import.html b/idhub/templates/idhub/admin_import.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_import.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_issue_credentials.html b/idhub/templates/idhub/admin_issue_credentials.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_issue_credentials.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_people.html b/idhub/templates/idhub/admin_people.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_people.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_people_register.html b/idhub/templates/idhub/admin_people_register.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_people_register.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_revoke_credentials.html b/idhub/templates/idhub/admin_revoke_credentials.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_revoke_credentials.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_roles.html b/idhub/templates/idhub/admin_roles.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_roles.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_schemes.html b/idhub/templates/idhub/admin_schemes.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_schemes.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_schemes_export.html b/idhub/templates/idhub/admin_schemes_export.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_schemes_export.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_schemes_import.html b/idhub/templates/idhub/admin_schemes_import.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_schemes_import.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_services.html b/idhub/templates/idhub/admin_services.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_services.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_wallet_credentials.html b/idhub/templates/idhub/admin_wallet_credentials.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_wallet_credentials.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_wallet_identities.html b/idhub/templates/idhub/admin_wallet_identities.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_wallet_identities.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/admin_wallet_issues.html b/idhub/templates/idhub/admin_wallet_issues.html new file mode 100644 index 0000000..db4eecd --- /dev/null +++ b/idhub/templates/idhub/admin_wallet_issues.html @@ -0,0 +1,5 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +{% endblock %} diff --git a/idhub/templates/idhub/base_admin.html b/idhub/templates/idhub/base_admin.html index 6604e9e..2418560 100644 --- a/idhub/templates/idhub/base_admin.html +++ b/idhub/templates/idhub/base_admin.html @@ -50,7 +50,7 @@