From b5da5e3ed085e07dc7367f222cc7a1beade000a6 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 10 Jun 2024 12:34:12 -0500 Subject: Implement "Resource Role Page" Show the page, providing all UI elements necessary, even if the elements themselves are not active. --- .../templates/oauth2/view-resource-role.html | 98 ++++++++++++++++++++++ gn2/wqflask/templates/oauth2/view-resource.html | 6 +- 2 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 gn2/wqflask/templates/oauth2/view-resource-role.html (limited to 'gn2/wqflask/templates/oauth2') diff --git a/gn2/wqflask/templates/oauth2/view-resource-role.html b/gn2/wqflask/templates/oauth2/view-resource-role.html new file mode 100644 index 00000000..05df41d6 --- /dev/null +++ b/gn2/wqflask/templates/oauth2/view-resource-role.html @@ -0,0 +1,98 @@ +{%extends "base.html"%} +{%from "oauth2/profile_nav.html" import profile_nav%} +{%from "oauth2/display_error.html" import display_error%} +{%block title%}View User{%endblock%} +{%block content%} + +{%macro unassign_button(resource_id, role_id, privilege_id)%} + +{%endmacro%} + +
+ {{profile_nav(uipages, user_privileges)}} + {%if resource_error is defined%} + {{display_error("Resource", resource_error)}} + {%else%} +

Role for Resource '{{resource.resource_name}}'

+ {%if role_error is defined%} + {{display_error("Role", role_error)}} + {%else%} + + + + + + + + + + + + {%for priv in role.privileges%} + {%if loop.index0 == 0%} + + + + + + {%else%} + + + + + {%endif%} + {%else%} + + + + {%endfor%} + +
Role '{{role.role_name}}' for resource '{{resource.resource_name}}'
Role NamePrivilegeAction
+ {{role.role_name}}{{priv.privilege_description}}{{unassign_button(resource.resource_id, role.role_id, priv.privilege_id)}}
{{priv.privilege_description}}{{unassign_button(resource.resource_id, role.role_id, priv.privilege_id)}}
+

+ {{title}}: + +   + This role has no privileges. +

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

+ {{title}}: + +   + There are no more privileges left to assign. +

+ {%else%} +
+ Select privileges to assign to this role + {%for priv in unassigned_privileges%} +
+ +
+ {%endfor%} +
+ + + {%endif%} +
+ {%endif%} + {%endif%} +
+ +{%endblock%} diff --git a/gn2/wqflask/templates/oauth2/view-resource.html b/gn2/wqflask/templates/oauth2/view-resource.html index 451bfbd7..25cac6ff 100644 --- a/gn2/wqflask/templates/oauth2/view-resource.html +++ b/gn2/wqflask/templates/oauth2/view-resource.html @@ -237,7 +237,11 @@

Available Resource Roles

{%for role in resource_roles%} - + {{role.role_name}} {%endfor%} -- cgit v1.2.3