Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
[myslice.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</button></h1>
39         <div id="user-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
40         <div id="user-tab-loaded" style="display:none;">
41             <table id="user-tab">
42                 <tr>
43                     <th>+/-</th>
44                     <th>Email</th>
45                     <th>user_hrn</th>
46                     <th>First name</th>
47                     <th>Last name</th>
48                     <th>Enabled</th>
49                 </tr>
50             </table>
51         </div>
52         <div>
53             <button id="deleteusers" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Users</button>
54         </div>
55         </div>
56     <div class="home-panel" id="slices" style="display:none;">
57         <br>
58         <h1>Slices: onelab.upmc <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create a Slice</button></h1>
59         <div id="slice-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
60         <div id="slice-tab-loaded" style="display:none;">
61             <table id="slice-tab">
62                 <tr>
63                     <th>+/-</th>
64                     <th>slice_hrn</th>
65                     <th>users</th>
66                     <th>url</th>
67                     <th>nodes</th>
68                     <th>expiration</th>
69                 </tr>
70             </table>
71             <div>
72                 <button id="renewslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> Renew Slices</button>
73                 <button id="deleteslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Slices</button>
74             </div>
75         </div>
76     </div>
77 </div>
78 <script>
79     $(document).ready(function() {
80         $('a.home-tab').click(function() {
81             $('ul.nav-tabs li').removeClass('active');
82             $(this).parent().addClass('active');
83             $('div.home-panel').hide();
84             $('div#'+$(this).data('panel')).show();
85         });
86         $('button#createslice').click(function() {
87             window.location="/portal/slice_request/";
88         })
89         ;$('button#slicerequestbtn').click(function() {
90             /*
91             window.location="/portal/slice_request/";
92             */
93         });
94         {% if person %}
95         $.getJSON("/rest/slice/", function( data ) {
96             var list_slices = [];
97             var table_slices = [];
98             /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "user", "slice_urn", "slice_expires" */
99             $.each( data, function( key, val ) {
100                 list_slices.push( "<li><a href=\"portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
101                 if(val.nodes=="undefined" || val.nodes==null){
102                     nodes_length=0;
103                 }else{
104                     nodes_length=val.nodes.length;
105                 }
106
107                 if(val.user=="undefined" || val.user==null){
108                     user_length=0;
109                 }else{
110                     user_length=val.user.length;
111                 }
112
113                 if(val.slice_url=="undefined" || val.slice_url==null){
114                     slice_url="";
115                 }else{
116                     slice_url="<a href='"+val.slice_url+"' target='_blank'>"+val.slice_url+"</a>";
117                 }
118                 
119                 slice_row = "<tr>";
120                 slice_row += "<td><input type='checkbox'></td>";
121                 slice_row += "<td><a href=\"/portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
122                 slice_row += "<td>"+user_length+"</td>";
123                 slice_row += "<td>"+slice_url+"</td>";
124                 slice_row += "<td>"+nodes_length+"</td>";
125                 slice_row += "<td>"+val.slice_expires+"</td>";
126                 table_slices.push(slice_row);
127                 
128             });
129            
130             /* $("div#slice-list").html($( "<ul/>", { html: list_slices.join( "" ) })); */
131             $("table#slice-tab tr:last").after(table_slices.join( "" ));
132             $("div#slice-tab-loaded").css("display","block");
133             $("div#slice-tab-loading").css("display","none");
134          });
135          {% endif %}
136                 {% if person %}
137         $.getJSON("/rest/user/", function( data ) {
138             var list_users = [];
139             var table_users = [];
140                         /*
141                         "enabled", "keys", "parent_authority", "user_first_name", "user_last_name", "user_phone", "user_hrn", "slice", "user_email"
142                         */
143             $.each( data, function( key, val ) {
144                 list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
145                 /*if(val.nodes=="undefined" || val.nodes==null){
146                     nodes_length=0;
147                 }else{
148                     nodes_length=val.nodes.length;
149                 }
150
151                 if(val.user=="undefined" || val.user==null){
152                     user_length=0;
153                 }else{
154                     user_length=val.user.length;
155                 }
156
157                 if(val.slice_url=="undefined" || val.slice_url==null){
158                     slice_url="";
159                 }else{
160                     slice_url="<a href='"+val.slice_url+"' target='_blank'>"+val.slice_url+"</a>";
161                 }*/
162                 
163                 user_row = "<tr>";
164                 user_row += "<td><input type='checkbox'></td>";
165                 user_row += "<td>"+val.user_email+"</td>";
166                 user_row += "<td>"+val.user_hrn+"</td>";
167                 user_row += "<td>"+val.user_first_name+"</td>";
168                 user_row += "<td>"+val.user_last_name+"</td>";
169                                 user_row += "<td>"+val.enabled+"</td>";
170                 table_users.push(user_row);
171                 
172             });
173            
174             /* $("div#slice-list").html($( "<ul/>", { html: list_slices.join( "" ) })); */
175             $("table#user-tab tr:last").after(table_users.join( "" ));
176             $("div#user-tab-loaded").css("display","block");
177             $("div#user-tab-loading").css("display","none");
178          });
179          {% endif %}
180     });
181 </script>
182 {% endblock unfold_main %}