resolved rest conflicts
[unfold.git] / portal / templates / institution.html
1 {% extends "layout-unfold1.html" %}
2
3 {% block unfold_main %}
4 <div class="wrapper" id="institution">
5     <ul class="nav nav-tabs">
6       <li class="active"><a class="home-tab" data-panel="institution" href="#">INSTITUTION</a></li>
7       <li><a class="home-tab" data-panel="users" href="#">USERS</a></li>
8       <li><a class="home-tab" data-panel="slices" href="#">SLICES</a></li>
9     </ul>
10     <div class="home-panel" id="institution">
11         <h1><img src="{{ STATIC_URL }}img/icon_authority_color_small.png" alt="" /> Affiliation to an Institution</h1>
12         <br>
13         <div style="float:left; width:30%;">
14             
15             <img src="{{ STATIC_URL }}img/onelab-logo.png" alt="" /><br>
16             <b>Membership:</b> Governor
17         </div>
18         <div style="float:right; width:70%;">
19             <img src="http://www.upmc.fr/skins/UPMC/templates/index/resources/img/upmc-logotype.gif" alt="" /><br>
20             <br>
21             <b>authority:</b> onelab.upmc<br>
22             <br>
23             <b>Université Pierre et Marie Curie</b><br>
24             <br>
25             <b>Address:</b> 4 Place Jussieu, 75005 Paris<br>
26             <br>
27             <b>Country:</b> France<br>
28             <br>
29             <br>
30             <h2>Contacts</h2>
31             <b>Legal:</b> Président Jean Chambaz<br>
32             <br>
33             <b>Scientific:</b> Dr Timur Friedman, Prof Serge Fdida
34         </div>
35     </div>
36     <div class="home-panel" id="users" style="display:none;">
37         <br>
38         <h1>Users: onelab.upmc</h1>
39         <table>
40             <tr>
41                 <th>+/-</th>
42                 <th>email</th>
43                 <th>user_hrn</th>
44                 <th>number of slices</th>
45                 <th>role</th>
46                 <th>status</th>
47             </tr>
48             <tr>
49                 <td><input type="checkbox"></td>
50                 <td><a href="/portal/user/loic.baron@lip6.fr">loic.baron@lip6.fr</a></td>
51                 <td>onelab.upmc.loic_baron</td>
52                 <td>3</td>
53                 <td>user</td>
54                 <td>enabled</td>
55             </tr>
56             <tr>
57                 <td><input type="checkbox"></td>
58                 <td><a href="/portal/user/loic.baron@lip6.fr">loic.baron@lip6.fr</a></td>
59                 <td>onelab.upmc.loic_baron</td>
60                 <td>3</td>
61                 <td>pi</td>
62                 <td>enabled</td>
63             </tr>
64         </table>
65         <div>
66             <button id="deleteusers" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Users</button>
67         </div>
68     </div>
69     <div class="home-panel" id="slices" style="display:none;">
70         <br>
71         <h1>Slices: onelab.upmc <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create a Slice</button></h1>
72         <div id="slice-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
73         <div id="slice-tab-loaded" style="display:none;">
74             <table id="slice-tab">
75                 <tr>
76                     <th>+/-</th>
77                     <th>slice_hrn</th>
78                     <th>users</th>
79                     <th>url</th>
80                     <th>nodes</th>
81                     <th>expiration</th>
82                 </tr>
83             </table>
84             <div>
85                 <button id="renewslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> Renew Slices</button>
86                 <button id="deleteslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Slices</button>
87             </div>
88         </div>
89     </div>
90 </div>
91 <script>
92     $(document).ready(function() {
93         $('a.home-tab').click(function() {
94             $('ul.nav-tabs li').removeClass('active');
95             $(this).parent().addClass('active');
96             $('div.home-panel').hide();
97             $('div#'+$(this).data('panel')).show();
98         });
99         $('button#createslice').click(function() {
100             window.location="/portal/slice_request/";
101         })
102         ;$('button#slicerequestbtn').click(function() {
103             /*
104             window.location="/portal/slice_request/";
105             */
106         });
107         {% if person %}
108         $.getJSON("/rest/slice/", function( data ) {
109             var list_slices = [];
110             var table_slices = [];
111             /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "user", "slice_urn", "slice_expires" */
112             $.each( data, function( key, val ) {
113                 list_slices.push( "<li><a href=\"portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
114                 if(val.nodes=="undefined" || val.nodes==null){
115                     nodes_length=0;
116                 }else{
117                     nodes_length=val.nodes.length;
118                 }
119
120                 if(val.user=="undefined" || val.user==null){
121                     user_length=0;
122                 }else{
123                     user_length=val.user.length;
124                 }
125
126                 if(val.slice_url=="undefined" || val.slice_url==null){
127                     slice_url="";
128                 }else{
129                     slice_url="<a href='"+val.slice_url+"' target='_blank'>"+val.slice_url+"</a>";
130                 }
131                 
132                 slice_row = "<tr>";
133                 slice_row += "<td><input type='checkbox'></td>";
134                 slice_row += "<td><a href=\"/portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
135                 slice_row += "<td>"+user_length+"</td>";
136                 slice_row += "<td>"+slice_url+"</td>";
137                 slice_row += "<td>"+nodes_length+"</td>";
138                 slice_row += "<td>"+val.slice_expires+"</td>";
139                 table_slices.push(slice_row);
140                 
141             });
142            
143             /* $("div#slice-list").html($( "<ul/>", { html: list_slices.join( "" ) })); */
144             $("table#slice-tab tr:last").after(table_slices.join( "" ));
145             $("div#slice-tab-loaded").css("display","block");
146             $("div#slice-tab-loading").css("display","none");
147          });
148          {% endif %}
149     });
150 </script>
151 {% endblock unfold_main %}