layout and style changes
[myslice.git] / portal / templates / institution.html
index 812b2e5..575a1f0 100644 (file)
@@ -1,15 +1,16 @@
-{% extends "layout-unfold1.html" %}
+{% extends "layout.html" %}
 
-{% block unfold_main %}
-<div class="wrapper" id="institution">
+{% block content %}
+<div class="row">
+       <h1><img src="{{ STATIC_URL }}img/icon_authority_color_small.png" alt="" /> Affiliation to an Institution</h1>
+</div>
+<div class="row" id="institution">
     <ul class="nav nav-tabs">
-      <li class="active"><a class="home-tab" data-panel="institution" href="#">INSTITUTION</a></li>
-      <li><a class="home-tab" data-panel="users" href="#">USERS</a></li>
-      <li><a class="home-tab" data-panel="slices" href="#">SLICES</a></li>
+      <li class="active" id="authority-tab"><a class="home-tab" data-panel="institution" href="#">INSTITUTION</a></li>
+      <li id="users-tab"><a class="home-tab" data-panel="users" href="#">USERS</a></li>
+      <li id="slices-tab"><a class="home-tab" data-panel="slices" href="#">SLICES</a></li>
     </ul>
     <div class="home-panel" id="institution">
-        <h1><img src="{{ STATIC_URL }}img/icon_authority_color_small.png" alt="" /> Affiliation to an Institution</h1>
-        <br>
         <div id="authority-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Authority" /></div>
         <div id="authority-tab-loaded" style="display:none;">
             <div id="onelab_membership" style="float:left; width:30%;">
@@ -35,8 +36,7 @@
                     <th>Enabled</th>
                 </tr>
             </table>
-        </div>
-        <div>
+            <br>
             <button id="deleteusers" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Users</button>
         </div>
        </div>
@@ -55,6 +55,7 @@
                     <th>expiration</th>
                 </tr>
             </table>
+            <br>
             <div>
                 <button id="renewslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> Renew Slices</button>
                 <button id="deleteslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Slices</button>
             $('div.home-panel').hide();
             $('div#'+$(this).data('panel')).show();
         });
+        var url = window.location;
+        if(url.hash) {
+            // Fragment exists 
+            tab = url.href.split("#")[1];
+            tab_exists = $('div#'+tab).length;
+            if (tab_exists) {
+               $('ul.nav-tabs li').removeClass('active');
+               $('li#'+tab+'-tab').addClass('active');
+               $('div.home-panel').hide();            
+               $('div#'+tab).show();
+            }
+        }
         $('button#createslice').click(function() {
             window.location="/portal/slice_request/";
         })
@@ -86,7 +99,7 @@
                        /* 'city','enabled','legal','longitude','onelab_membership','address','parent_authority','slice','user','country',
             'tech','abbreviated_name','url','postcode','description','scientific','authority_hrn','latitude','name'    */
             $.each( data, function( key, val ) {
-                authority_row = "<img src='http://www.upmc.fr/skins/UPMC/templates/index/resources/img/upmc-logotype.gif' alt='' /><br>";
+                authority_row = "<img src='{{ STATIC_URL }}img/institutions/{{user_details.parent_authority}}.gif' alt='' /><br>";
                 authority_row += "<br>";
                 authority_row += "<b>authority:</b> "+val.authority_hrn+"<br>";
                 authority_row += "<br>";
                 
                 slice_row = "<tr>";
                 slice_row += "<td><input type='checkbox'></td>";
-                slice_row += "<td><a href=\"/portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
+                slice_row += "<td><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
                 slice_row += "<td>"+user_length+"</td>";
                 slice_row += "<td>"+slice_url+"</td>";
                 slice_row += "<td>"+nodes_length+"</td>";
          {% endif %}
     });
 </script>
-{% endblock unfold_main %}
+{% endblock %}