From 204a308be0f741726b9a620d88fbc22b22124c81 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 29 Dec 2023 18:55:37 +0000 Subject: Namespace all modules under gn2. We move all modules under a gn2 directory. This is important for "correct" packaging and deployment as a Guix service. --- .../templates/admin/change_resource_owner.html | 114 +++++++++ gn2/wqflask/templates/admin/create_group.html | 84 +++++++ gn2/wqflask/templates/admin/group_manager.html | 147 +++++++++++ gn2/wqflask/templates/admin/ind_user_manager.html | 111 +++++++++ gn2/wqflask/templates/admin/manage_resource.html | 124 ++++++++++ gn2/wqflask/templates/admin/manage_user.html | 79 ++++++ gn2/wqflask/templates/admin/search_for_groups.html | 134 ++++++++++ .../templates/admin/set_group_privileges.html | 102 ++++++++ gn2/wqflask/templates/admin/user_manager.html | 41 ++++ gn2/wqflask/templates/admin/view_group.html | 270 +++++++++++++++++++++ 10 files changed, 1206 insertions(+) create mode 100644 gn2/wqflask/templates/admin/change_resource_owner.html create mode 100644 gn2/wqflask/templates/admin/create_group.html create mode 100644 gn2/wqflask/templates/admin/group_manager.html create mode 100644 gn2/wqflask/templates/admin/ind_user_manager.html create mode 100644 gn2/wqflask/templates/admin/manage_resource.html create mode 100644 gn2/wqflask/templates/admin/manage_user.html create mode 100644 gn2/wqflask/templates/admin/search_for_groups.html create mode 100644 gn2/wqflask/templates/admin/set_group_privileges.html create mode 100644 gn2/wqflask/templates/admin/user_manager.html create mode 100644 gn2/wqflask/templates/admin/view_group.html (limited to 'gn2/wqflask/templates/admin') diff --git a/gn2/wqflask/templates/admin/change_resource_owner.html b/gn2/wqflask/templates/admin/change_resource_owner.html new file mode 100644 index 00000000..7fd84387 --- /dev/null +++ b/gn2/wqflask/templates/admin/change_resource_owner.html @@ -0,0 +1,114 @@ +{% extends "base.html" %} +{% block title %}Resource Manager{% endblock %} +{% block css %} + + +{% endblock %} +{% block content %} + +
+ +
+
+
+
+
+

Search for user by either name or e-mail:

+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+
+
+
+
+
+
+
+ + + +{% endblock %} + +{% block js %} + + + +{% endblock %} diff --git a/gn2/wqflask/templates/admin/create_group.html b/gn2/wqflask/templates/admin/create_group.html new file mode 100644 index 00000000..b1d214ea --- /dev/null +++ b/gn2/wqflask/templates/admin/create_group.html @@ -0,0 +1,84 @@ +{% extends "base.html" %} +{% block title %}Group Manager{% endblock %} +{% block content %} + +
+ +
+ + +
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+ + +{% endblock %} + +{% block js %} + + + +{% endblock %} diff --git a/gn2/wqflask/templates/admin/group_manager.html b/gn2/wqflask/templates/admin/group_manager.html new file mode 100644 index 00000000..eedfe138 --- /dev/null +++ b/gn2/wqflask/templates/admin/group_manager.html @@ -0,0 +1,147 @@ +{% extends "base.html" %} +{% block title %}Group Manager{% endblock %} +{% block css %} + + + +{% endblock %} +{% block content %} + +
+ +
+ +
+ {% if admin_groups|length == 0 and member_groups|length == 0 %} +

You currently aren't a member or admin of any groups.

+
+ + + + {% else %} +

Admin Groups

+
+ {% if admin_groups|length == 0 %} +

You currently aren't the administrator of any groups.

+ {% else %} + + + + + + + + + + + + + + {% for group in admin_groups %} + + + + {% set group_url = url_for('group_management.view_group', group_id=group.uuid) %} + + + + + + + {% endfor %} + +
IndexName# MembersCreatedLast ChangedGroup ID
{{ loop.index }}{{ group.name }}{{ group.admins|length + group.members|length }}{{ group.created_timestamp }}{{ group.changed_timestamp }}{{ group.uuid }}
+ {% endif %} +
+
+
+

User Groups

+
+ {% if member_groups|length == 0 %} +

You currently aren't a member of any groups.

+ {% else %} + + + + + + + + + + + + + {% for group in member_groups %} + + + + {% set group_url = url_for('group_management.view_group', group_id=group.uuid) %} + + + + + + {% endfor %} + +
IndexName# MembersCreatedLast Changed
{{ loop.index }}{{ group.name }}{{ group.admins|length + group.members|length }}{{ group.created_timestamp }}{{ group.changed_timestamp }}
+ {% endif %} + {% endif %} +
+
+
+ + + +{% endblock %} + +{% block js %} + + + +{% endblock %} diff --git a/gn2/wqflask/templates/admin/ind_user_manager.html b/gn2/wqflask/templates/admin/ind_user_manager.html new file mode 100644 index 00000000..b821e5d5 --- /dev/null +++ b/gn2/wqflask/templates/admin/ind_user_manager.html @@ -0,0 +1,111 @@ +{% extends "base.html" %} +{% block title %}User Manager{% endblock %} +{% block content %} + + +
+ + + {{ flash_me() }} + + + + + + + + + + + + + + + + + + + {% if user.confirmed_at %} + + {% else %} + + {% endif %} + + + + + + {% if user.superuser %} + + {% else %} + + {% endif %} + + + + + + {% if user.most_recent_login %} + + {% else %} + + {% endif %} + + + + + + + + +
Name{{ user.full_name }}
Organization{{ user.organization }}
Confirmed{{ timeago(user.confirmed_at + "Z") }}Unconfirmed
SuperuserMade a superuser {{ timeago(user.superuser_info['timestamp'] + "Z") }} by + {{ user.crowner.name_and_org }}. + + + + Make Superuser + + +
Most recent login{{ timeago(user.most_recent_login.timestamp.isoformat() + "Z") }} from {{ user.most_recent_login.ip_address }}Never
+ + Become this user for debugging + +
+ + +
+ + + +{% endblock %} + +{% block js %} + + + + +{% endblock %} diff --git a/gn2/wqflask/templates/admin/manage_resource.html b/gn2/wqflask/templates/admin/manage_resource.html new file mode 100644 index 00000000..63ec17c0 --- /dev/null +++ b/gn2/wqflask/templates/admin/manage_resource.html @@ -0,0 +1,124 @@ +{% extends "base.html" %} +{% block title %}Resource Manager{% endblock %} +{% block content %} + +
+
+ {{ flash_me() }} + {% set DATA_ACCESS = access_role.get('data') %} + {% set METADATA_ACCESS = access_role.get('metadata') %} + {% set ADMIN_STATUS = access_role.get('admin') %} + {% set ADMIN_STATUS = access_role.get('admin') %} +

Resource Manager

+ {% if resource_info.get('owner_id') %} + {% set user_details = resource_info.get('owner_details') %} +

+ Current Owner: {{ user_details.get('full_name') }} +

+ {% if user_details.get('organization') %} +

+ Organization: {{ user_details.get('organization')}} +

+ {% endif %} + {% endif %} + {% if DATA_ACCESS > DataRole.VIEW and ADMIN_STATUS > AdminRole.NOT_ADMIN %} + + Change Owner + + {% endif %} +
+ +
+
+ +
+
+
+
+ +
+ {{ resource_info.get('name') }} +
+
+ {% if DATA_ACCESS > DataRole.VIEW and ADMIN_STATUS > AdminRole.NOT_ADMIN %} + {% set is_open_to_public = DataRole(resource_info.get('default_mask').get('data')) > DataRole.NO_ACCESS %} +
+ +
+ + +
+
+
+ +
+ +
+
+ {% endif %} +
+
+
+ {% if ADMIN_STATUS > AdminRole.NOT_ADMIN %} +
+
+ +
+ {% if resource_info.get('group_masks', [])|length > 0 %} +

Current Group Permissions

+
+ + + + + + + + + + + {% for key, value in resource_info.get('group_masks').items() %} + + + + + + + {% endfor %} + +
IdNameDataMetadata
{{ key }}{{ value.group_name}}{{ value.data }}{{ value.metadata }}
+ {% else %} +

No groups are currently added to this resource.

+ {% endif %} +
+ {% endif %} +
+
+ + + + {% endblock %} + {% block js %} + + + + {% endblock %} diff --git a/gn2/wqflask/templates/admin/manage_user.html b/gn2/wqflask/templates/admin/manage_user.html new file mode 100644 index 00000000..3ef90b90 --- /dev/null +++ b/gn2/wqflask/templates/admin/manage_user.html @@ -0,0 +1,79 @@ +{% extends "base.html" %} +{% block title %}View and Edit Group{% endblock %} +{% block css %} + + + +{% endblock %} +{% block content %} + +
+ {% if 'full_name' in user_details %} + + {% endif %} +
+
+
+
+
+ +
+ {% if 'email_address' in user_details %}{{ user_details.email_address }}{% else %}N/A{% endif %} +
+
+
+ +
+ {% if 'full_name' in user_details %}{{ user_details.full_name }}{% else %}N/A{% endif %} + +
+
+
+ +
+ {% if 'organization' in user_details %}{{ user_details.organization }}{% else %}N/A{% endif %} + +
+
+
+ +
+ + +
+
+
+
+
+
+
+ + + +{% endblock %} + +{% block js %} + + + +{% endblock %} diff --git a/gn2/wqflask/templates/admin/search_for_groups.html b/gn2/wqflask/templates/admin/search_for_groups.html new file mode 100644 index 00000000..0e1ec720 --- /dev/null +++ b/gn2/wqflask/templates/admin/search_for_groups.html @@ -0,0 +1,134 @@ +{% extends "base.html" %} +{% block title %}Resource Manager{% endblock %} +{% block css %} + + +{% endblock %} +{% block content %} + +
+ +
+ +
+
+
+
+

Search by:

+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+
+
+
+
+
+
+
+ + + +{% endblock %} + +{% block js %} + + + + + +{% endblock %} diff --git a/gn2/wqflask/templates/admin/set_group_privileges.html b/gn2/wqflask/templates/admin/set_group_privileges.html new file mode 100644 index 00000000..04842453 --- /dev/null +++ b/gn2/wqflask/templates/admin/set_group_privileges.html @@ -0,0 +1,102 @@ +{% extends "base.html" %} +{% block title %}Set Group Privileges{% endblock %} +{% block css %} + + + +{% endblock %} +{% block content %} + +
+

Group Privileges

+
+
+ + +
+ +
+

Data and Metadata Privileges

+ + + + + + + + + + + + + {% if 'data' in default_privileges %} + + + + {% else %} + + + + {% endif %} + + + + {% if 'metadata' in default_privileges %} + + + + {% else %} + + + + {% endif %} + + +
No-AccessViewEdit
Data:
Metadata:
+
+

Admin Privileges

+ + + + + + + + + + + + + {% if 'admin' in default_privileges %} + + + + {% else %} + + + + {% endif %} + + +
Not AdminEdit AccessEdit Admins
Admin:
+
+
+
+ + + +{% endblock %} + +{% block js %} + + +{% endblock %} diff --git a/gn2/wqflask/templates/admin/user_manager.html b/gn2/wqflask/templates/admin/user_manager.html new file mode 100644 index 00000000..2b6c1b2b --- /dev/null +++ b/gn2/wqflask/templates/admin/user_manager.html @@ -0,0 +1,41 @@ +{% extends "base.html" %} +{% block title %}User Manager{% endblock %} +{% block content %} + + {{ header("List of users", "" )}} + + +
+ + + + + + + + + + + + + {% for user in users %} + + + + + + + + {% endfor %} +
EmailOrganizationActiveConfirmedSuperuser
+ {{ user.email_address }} + {{ user.organization }}{{ 'Yes' if user.active else 'No' }}{{ 'True' if user.confirmed else 'False' }}{{ 'True' if user.superuser else 'False' }}
+ + +
+ + + +{% endblock %} diff --git a/gn2/wqflask/templates/admin/view_group.html b/gn2/wqflask/templates/admin/view_group.html new file mode 100644 index 00000000..c88ce0e7 --- /dev/null +++ b/gn2/wqflask/templates/admin/view_group.html @@ -0,0 +1,270 @@ +{% extends "base.html" %} +{% block title %}View and Edit Group{% endblock %} +{% block css %} + + + +{% endblock %} +{% block content %} + +{% set GROUP_URL = url_for('group_management.view_group', group_id=group_info.guid) %} +{% set UPDATE_GROUP_URL = url_for('group_management.update_group', group_id=group_info.guid) %} +
+ +
+ + + +
+
+
+

Admins

+
+ + + + + + + + + {% if is_admin %} + + {% endif %} + + + + {% for admin in admins %} + + + + + + + {% if is_admin %} + + {% endif %} + + {% endfor %} + +
IndexNameEmail AddressOrganizationUID
{{ loop.index }}{% if 'full_name' in admin %}{{ admin.full_name }}{% elif 'name' in admin %}{{ admin.name }}{% else %}N/A{% endif %}{% if 'email_address' in admin %}{{ admin.email_address }}{% else %}N/A{% endif %}{% if 'organization' in admin %}{{ admin.organization }}{% else %}N/A{% endif %}{{admin.user_id}}
+ {% if is_admin %} +
+ E-mail of user to add to admins (multiple e-mails can be added separated by commas): + +
+
+ +
+ {% endif %} +
+
+
+ {% if members|length > 0 %} +

Members

+
+ + + + + + + + + {% if is_admin %} + + {% endif %} + + + + {% for member in members %} + + + + + + + + {% if is_admin %} + + {% endif %} + + + {% endfor %} + +
IndexNameEmail AddressOrganizationUID
+ {% if is_admin %} + + {% endif %} + {{ loop.index }}{% if 'full_name' in member %}{{ member.full_name }}{% elif 'name' in admin %}{{ admin.name }}{% else %}N/A{% endif %}{% if 'email_address' in member %}{{ member.email_address }}{% else %}N/A{% endif %}{% if 'organization' in member %}{{ member.organization }}{% else %}N/A{% endif %}{{ member }}
+ {% if is_admin %} +
+ E-mail of user to add to members (multiple e-mails can be added separated by commas): + +
+
+ +
+ {% endif %} + {% else %} + There are currently no members in this group. + {% if is_admin %} +
+ E-mail of user to add to members (multiple e-mails can be added separated by commas): + +
+
+ +
+ {% endif %} + {% endif %} +
+
+
+

Resources

+
+ {% if resources|length > 0 %} + + + + + + + + + + + + {% for resource in resources %} + + + + + + + + {% endfor %} + +
IndexNameDataMetadataAdmin
{{ loop.index }}{% if 'name' in resource %}{{ resource.name }}{% else %}N/A{% endif %}{% if 'data' in resource %}{{ resource.data }}{% else %}N/A{% endif %}{% if 'metadata' in resource %}{{ resource.metadata }}{% else %}N/A{% endif %}{% if 'admin' in resource %}{{ resource.admin }}{% else %}N/A{% endif %}
+ {% else %} + There are currently no resources associated with this group. + {% endif %} +
+
+
+
+ + + +{% endblock %} + +{% block js %} + + + +{% endblock %} -- cgit v1.2.3