1 {% extends "layout-unfold1.html" %}
4 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/validate_pending.css" />
5 <script type="text/javascript">
6 function on_click_event() {
8 $('.portal__validate__checkbox').each(function(i, el) {
9 if ($(el).prop('checked')) {
10 // portal__validate__checkbox__slice__2
11 var id_array = $(el).attr('id').split('__');
13 ids.push(id_array[3] + '__' + id_array[4]);
17 var id_str = ids.join('/');
21 $.getJSON('/portal/validate_action/' + id_str,
23 $.each(status, function(request_type__id, request_status) {
24 // request_status: NAME -> dict (status, description)
26 $.each(request_status, function(name, result) {
31 status_str += '<font color="green">OK</font>';
32 $('#portal__validate__checkbox__' + request_type__id).hide();
34 status_str += '<font color="red">ERROR: ' + result.description + '</font>';
37 $('#portal__status__' + request_type__id).html(status_str)
48 {% block unfold_main %}
49 <div class="onelab-title well-lg">
50 <h1>Pending requests</h1>
53 <h2>My authorities</h2>
55 {% if my_authorities %}
57 {% for authority, requests in my_authorities.items %}
58 <h3>{{authority}}</h3>
59 <div class="container">
60 <table width=100% border=1 style="color:white;">
68 {% for request in requests %}
72 {% if request.allowed == 'allowed' %}
73 <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
75 {% if request.allowed == 'expired' %}
77 {% else %} {# denied #}
82 <td>{{ request.type }}</td>
83 <td>{{ request.id }}</td>
85 {% if request.type == 'user' %}
86 Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
88 {% if request.type == 'slice' %}
89 Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
90 {% else %} {# authority #}
95 <td>{{ request.timestamp }}</td>
97 <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
99 <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
107 <i>There is no pending request waiting for validation.</i>
111 {% if delegation_authorities %}
113 <h2>Authorities with delegation</h2>
115 {% for authority, requests in delegation_authorities.items %}
116 <h3>{{authority}}</h3>
117 <table width=100% border=1>
125 {% for request in requests %}
128 {% if request.allowed == 'allowed' %}
129 <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
131 {% if request.allowed == 'expired' %}
133 {% else %} {# denied #}
138 <td>{{ request.type }}</td>
139 <td>{{ request.id }}</td>
141 {% if request.type == 'user' %}
142 Login: {{request.login}} -- First name: {{request.first_name}} -- Last name: {{request.last_name}} -- Email: {{request.email}}
144 {% if request.type == 'slice' %}
145 Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
146 {% else %} {# authority #}
151 <td>{{ request.timestamp }}</td>
153 <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
155 <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
164 <input type='button' id='portal__validate' value='Validate' onclick='on_click_event();'/>
166 <!-- End of the container div -->