about summary refs log tree commit diff
path: root/gn2/wqflask/templates/oauth2/list_roles.html
diff options
context:
space:
mode:
Diffstat (limited to 'gn2/wqflask/templates/oauth2/list_roles.html')
-rw-r--r--gn2/wqflask/templates/oauth2/list_roles.html80
1 files changed, 80 insertions, 0 deletions
diff --git a/gn2/wqflask/templates/oauth2/list_roles.html b/gn2/wqflask/templates/oauth2/list_roles.html
new file mode 100644
index 00000000..a4061fca
--- /dev/null
+++ b/gn2/wqflask/templates/oauth2/list_roles.html
@@ -0,0 +1,80 @@
+{%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%}
+<div class="container" style="min-width: 1250px;">
+  {{profile_nav("roles", user_privileges)}}
+  <h3>Roles</h3>
+
+  {{flash_me()}}
+
+  <div class="container-fluid">
+    <div class="row">
+      <h3>Your System-Level Roles</h3>
+      <ul>
+	{%for role in roles %}
+	<li>
+	  <a href="{{url_for('oauth2.role.role', role_id=role.role_id)}}"
+	     title="Link to role {{role.role_name}}">{{role.role_name}}</a>
+	</li>
+	{%else%}
+	<li>
+	  <span class="glyphicon glyphicon-warning-sign"></span>&nbsp;
+	  <span class="text-warning">No roles attached to this user</span>
+	</li>
+	{%endfor%}
+      </ul>
+    </div>
+
+    <div class="row">
+      <h3>Group-Wide Roles</h3>
+
+      {%if "group:role:create-role" in user_privileges%}
+      <a href="{{url_for('oauth2.role.create_role')}}"
+	 title="Link to create a new group role"
+	 class="btn btn-info">New Group Role</a>
+      {%endif%}
+
+      {%if group_roles_error is defined%}
+      {{display_error("Group Roles", group_role_error)}}
+      {%else%}
+      <table class="table">
+	<caption>Group Roles</caption>
+	<thead>
+	  <tr>
+	    <th>Role Name</th>
+	    <th colspan="100%">Actions</th>
+	  </tr>
+	</thead>
+	<tbody>
+	  {%for grole in group_roles%}
+	  <tr>
+	    <td>{{grole.role.role_name}}</td>
+	    <td>
+	      <a href="{{url_for('oauth2.group.group_role', group_role_id=grole.group_role_id)}}"
+		 title="Link to role {{grole.role.role_name}}"
+		 class="btn btn-info">
+		View
+	      </a>
+	    </td>
+	  </tr>
+	  {%else%}
+	  <tr>
+	    <td colspan="3">
+	      <span class="glyphicon glyphicon-exclamation-sign text-info">
+	      </span>
+	      &nbsp;
+	      <span class="text-info">No group roles found</span>
+	    </td>
+	  </tr>
+	  {%endfor%}
+	</tbody>
+      </table>
+      {%endif%}
+    </div>
+
+  </div>
+
+</div>
+{%endblock%}