f4f: template migration from onelab to f4f
authorYasin <mohammed-yasin.rahman@lip6.fr>
Fri, 28 Nov 2014 10:41:42 +0000 (11:41 +0100)
committerYasin <mohammed-yasin.rahman@lip6.fr>
Fri, 28 Nov 2014 10:41:42 +0000 (11:41 +0100)
portal/templates/fed4fire/fed4fire_account-view.html
portal/templates/fed4fire/fed4fire_management-tab-about.html [new file with mode: 0644]
portal/templates/fed4fire/fed4fire_management-tab-requests.html

index ac85870..13da125 100644 (file)
@@ -1,7 +1,20 @@
-{% extends "layout_wide.html" %}
+{% extends "layout.html" %}
 {% block content %}
 
+<div class="row">
+       <div class="col-md-12">
+                <div class="breadcrumbs">
+                        Account &nbsp;>&nbsp; <a href="/account">{{ person.email }}</a>
+                </div>
+       </div>
+        {%if 'no_creds'  in user_cred %}
+    <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p>
+    {%endif%}
+        {%if 'creds_expired'  in user_cred %}
+    <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">EXPIRED CREDENTIALS</a> Please delegate again your credentials to the portal!</p>
+    {%endif%}
 
+</div>
 {% if messages %}
 <ul class="messages">
     {% for message in messages %}
     {% endfor %}
 </ul>
 {% endif %}
-<div class="container">
-       <div class="row">
-               <div class="col-md-12">
-                       <ul class="nav nav-tabs nav-section">
-                               <li class="active"><a href="#profile"><img src="{{ STATIC_URL }}icons/user-xs.png" alt="User Account" /> User Profile</a></li>
-                               <li><a href="#account">Account</a></li>
-                               <li><a href="#access">Testbed Access</a></li>
-                       </ul>
-           </div>
-       </div>
+<div class="row">
+       <div class="col-md-12">
+               <ul class="nav nav-tabs nav-section">
+                       <li class="active"><a href="#profile">User Profile</a></li>
+                       <li><a href="#account">Account</a></li>
+                       <li><a href="#access">Testbed Access</a></li>
+               </ul>
+    </div>
 </div>
-<div class="container tab-content">
+<div class="tab-content">
        <div class="tab-pane active row" id="profile">
                
                <div class="col-md-12">
                                        <table class="profile">          
                                        <tr>
                                                <td colspan="2">
-                                                               <div>Platform: Myslice</div>
+                                                               <div><h3>Platform: Myslice</h3></div>
                                                </td>
                                        </tr>
                                        <tr>
                                                <td class="key">Email</td>
                                                <td class="value">
                                                                <span id="emailval" class="value" >{{ person.email }}</span>
-                                                               <button class="btn btn-default btn-xs" type="button" id="edit_email" onclick="editAlert();"  title="To change your affiliation please contact the administrator">
+                                                               <button class="btn btn-default" type="button" id="edit_email" onclick="editAlert();"  title="To change your affiliation please contact the administrator">
                                                                <span class="glyphicon glyphicon-question-sign"></span> Edit
                                                                </button>
                                                        </td>
                                                <tr class="even">
                                                        <td class="key">Generate Keys</td>
                                                        <td>
-                                                               <input type="submit" name="generate" class="btn btn-danger btn-xs" value="Generate a new Key Pair" id="generate_keypair" 
+                                                               <input type="submit" name="generate" class="btn btn-primary" value="Generate a new Key Pair" id="generate_keypair" 
                                                                           onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');" 
                                                                           title="It will generate a new key Pair and your current credentials will be overwritten."/>
                                                </td> 
                                                <td class="value">
                                                                <span id="keyval" class="value">******** </span>
                                                                <span class="hide_this" id="span_upload">
-                                                                       <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_upload"> Cancel </button>
+                                                                       <button type="button" class="btn btn-default" title="Cancel" id="cancel_upload"> Cancel </button>
                                                                        <div style='display:none;'>
                                                                                <input type='hidden'  name='upload'  /></div>
                                                                                <input type="file" name="pubkey" class="required" id="pubkey"/>  
                                                 {%if 'N/A' not in user_private_key%}
                                                <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
                                                <td class="value">********<a href="#"></a>
-                                                       <button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
+                                                       <button type="submit" name="dl_pkey" class="btn btn-default" title="Download your privaye key" id="dl_pkey">
                                                                        <span class="glyphicon glyphicon-download"></span> Download     
                                                                </button>
                                                        <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit"  value="Delete" title="Delete your private key"
                                                  {%else%}
                                                        <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
                                                        <td class="value">********<a href="#"></a>
-                                                       <button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
+                                                       <button type="submit" name="dl_pkey" class="btn btn-default disabled" title="Download your privaye key" id="dl_pkey">
                                                                <span class="glyphicon glyphicon-download"></span> Download 
                                                        </button>
                                                        <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key" value="Delete" />
                                                        </td>
                                                 {%endif%}              
                                                </tr>
-                                               <tr class="odd">
-                                                       {%if 'N/A' not in user_private_key%}
-                                                       <td class="key">Identity</td> 
-                                               <td>
-                                                               <button type="submit" name="dl_identity" class="btn btn-default btn-xs" title="You will require it to use jfed" id="dl_identity">
-                                                               <span class="glyphicon glyphicon-download"></span> Download 
+                                       <tr class="even" id="sfi_config_row">
+                                               <td class="key">sfi_config </td>
+                                               <td class="value">use sfi_config file with sfi.py package (pip install sfa)<a href="#"></a>
+                                                       <button type="submit" name="dl_sfi_config" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_sfi_config">
+                                                                       <span class="glyphicon glyphicon-download"></span> Download
                                                                </button>
-                                                       </td>
-                                                       {%else%}
-                                                       <td class="key">Identity</td> 
-                                                       <td>
-                                                       <button type="submit" name="dl_identity" class="btn btn-default btn-xs disabled" title="You will require it to use jfed" id="dl_identity">
-                                                               <span class="glyphicon glyphicon-download"></span> Download 
-                                                       </button>
-                                                       </td>
-                                                       {%endif%} 
-                                               </tr>
+                                               </td>
+                        </tr>
+
                                                <tr class="even">
                                                <td colspan="2">
-                                                       <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
-                                                                       <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
-                                                                       <b>Security:</b> Manual account delegation. Download & Delete private key.
+                                                               <p class="command">
+                                                                       <a href="#" style="color:green" data-toggle="modal" data-target="#tradeoffmodal">Automatic vs. Manual delegation of credentials:</a>
+                                                                       Trade-off between ease-of-use & security</p>
                                                                </p>
                                                </td>
                                                </tr>
                                                        <button class="btn btn-default btn-xs" name= "dl_user_cert" type="submit" title="Download User Certificate">
                                                                <span class="glyphicon glyphicon-download"></span> Certificate
                                                        </button>
-                                                       <button class="btn btn-default btn-xs" name= "dl_user_p12" type="submit" title="Download User PKCS12">
-                                                               <span class="glyphicon glyphicon-download"></span> PKCS p12
-                                                       </button>
+                             <button class="btn btn-default btn-xs" name= "dl_user_p12" type="submit" title="Download User PKCS12">
+                                 <span class="glyphicon glyphicon-download"></span> PKCS p12
+                             </button>
                                                </td>
                                        </tr>
                                        {%endfor%}
                                {%endif%}
                </div>
        </div>
+<!-- Modal- No credentials -->
+<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+            <div class="modal-dialog">
+                <div class="modal-content">
+                    <div class="modal-header">
+                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+                            <h4 class="modal-title" id="myModalLabel">No credentials are delegated to the portal</h4>
+                    </div>
+                                       <div class="modal-body" style="text-align:justify;">
+                                       <p>You are getting this message for any of the following reasons:</p>
+                                       <ul>
+                                               <li>If your account is still pending for validation</li>
+                                               <li>If you press the "Clear Credentials" button</li>
+                                               <li>If you "Generate a new key pair"</li>
+                                               <li>If a new slice is added to your account</li>
+                                       </ul>
+                                       <p>Unless your account has not yet been validated, it is sufficient to refresh the page or go back to the home page. 
+                                               The portal will then regenerate your credentials. In some cases it may take more time than usual. If nothing works, 
+                                               then please logout and login back into to the portal.
+                                       </p>
+                                       <h3>Manual delegation of credentials</h3>
+                                               <p>
+                                                       You have selected upon sign-up to upload your public key. As you have uploaded your own public key, 
+                                                       the portal can no longer generate your credentials automatically. In order to have your credentials 
+                                                       delegated to the portal, please follow these instructions:
+                                               </p>
+                                               <ul>
+                                                       <li>Your account must first be validated by the manager of your organization.</li>
+                                                       <li>In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to
+                                                               <a href="/portal/manual_delegation" target="_blank">delegate your credentials to the portal.</a></li>
+                                               </ul>
+                                       </p>
+                                       <h3>Contact support</h3>
+                                       <p>If you don't have the above mentioned cases and still have this message, please  <a href="/contact/" target="_blank">contact us</a>.</p>
+                    </div>
+                    <div class="modal-footer">
+                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+                    </div>
+                </div>
+            </div>
+</div>
+
+
+<!-- Modal- Trade-off Message  -->
+<div class="modal fade" id="tradeoffmodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+            <div class="modal-dialog">
+                <div class="modal-content">
+                    <div class="modal-header">
+                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+                            <h4 class="modal-title" id="myModalLabel">
+                                                               Automatic vs. Manual delegation of credentials
+                                                       </h4>
+                    </div>
+                                       <div class="modal-body" style="text-align:justify;">
+                                       <h3>Automatic delegation of credentials</h3>
+                                               <p>Don't delete private key, ease-of-use option:</p>
+                                               <ul>
+                                                       <li>
+                                                               This means that you will keep your private key in the portal and it will automatically delegate your credentials on your behalf.
+                                                       </li>
+                                                       <li>
+                                                               This option does not provide as high of a level of security; however, your private key will still only be used in the portal and 
+                                                               will be available to you and the OneLab admins only.
+                                                       </li>
+                                               </ul>
+                                       <h3>Manual delegation of credentials</h3>
+                                               <p>Download & Delete private key, higher security option:</p>
+                                               <ul>
+                                                       <li>If you delete your private key, you will have more security but the portal will no longer be able to delegate credentials 
+                                                               on your behalf, and you will have to manually
+                                                               <a href="/portal/manual_delegation" target="_blank">delegate your credentials to the portal.</a>
+                                                       </li>
+                                               </ul>
+                                       <h3>Contact support</h3>
+                                       <p>For more information, please  <a href="/contact/" target="_blank">contact us</a>.</p>
+                    </div>
+                    <div class="modal-footer">
+                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+                    </div>
+                </div>
+            </div>
+</div>
+
+
 
        <div class="tab-pane row" id="access">
                <div class="col-md-12">
                 <td class="odd"> {{ row.account_type }} </td>
                                <td class="odd"> {{ row.account_reference }} </td>
                                <td class="odd">
-                               <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
+                               <button class="btn btn-danger" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
                                                <span class="glyphicon glyphicon-minus"></span>
                                        </button>
                                </td>
diff --git a/portal/templates/fed4fire/fed4fire_management-tab-about.html b/portal/templates/fed4fire/fed4fire_management-tab-about.html
new file mode 100644 (file)
index 0000000..bc768a6
--- /dev/null
@@ -0,0 +1,71 @@
+{% load portal_filters %}
+<div class="col-md-6">
+       <div>
+               <img src="{{ STATIC_URL|add:'img/institutions/'|add:authority.authority_hrn|add:'.gif'|file_exists }}" alt="{{authority.name}}">
+       </div>
+       <br />
+    {% if authority.name and authority.url %}
+       <h3><a href="{{authority.url}}">{{authority.name}}</a></h3>
+    {% elif authority.name %}
+       <h3>{{authority.name}}</h3>
+    {% endif %}
+       <p>
+    {% if authority.address %}
+               {{authority.address}} <br />
+    {% endif %}
+    {% if authority.postcode %}
+               {{authority.postcode}} 
+    {% endif %}
+    {% if authority.address %}
+        {{authority.city}} <br />
+    {% endif %}
+    {% if authority.address %}
+               {{authority.country}}
+    {% endif %}
+       </p>
+       <br />
+
+    {% if authority.address %}
+       <h4>Onelab membership</h4> 
+       <p>
+               {{ authority.onelab_membership }}
+       </p>
+    {% endif %}
+</div>
+<div class="col-md-6">
+    {% if authority.legal %}
+       <h4>Legal Contact:</h4>
+       <p>
+       {% for c in authority_contacts.legal %}
+                {{ c }} <br />
+       {% endfor %}
+       </p>
+       <br />
+    {% endif %}
+    {% if authority.scientific %}
+       <h4>Scientific Contact:</h4>
+       <p>
+       {% for c in authority_contacts.scientific %}
+               {{ c }} <br />
+       {% endfor %}
+       </p>
+       <br />
+    {% endif %}
+    {% if authority.technical %}
+       <h4>Technical Contact:</h4>
+       <p>
+       {% for c in authority_contacts.technical %}
+               {{ c }} <br />
+       {% endfor %}
+       </p>
+    {% endif %}
+</div>
+<script>$(document).ready(function() {
+{% if authority.name %}
+    auth_name = "{{authority.name}}";
+{% else %}
+    auth_name = "{{authority.authority_hrn}}";
+{% endif %}
+    $('#authority_name').text(auth_name);
+});
+</script>
index ddac594..e255779 100644 (file)
@@ -1,18 +1,6 @@
 <script type="text/javascript">
        $(document).ready(function() {
                $("li#nav-request").addClass("active");
-               $('table.requests').dataTable({
-                   "sDom": "frtiS",
-            "bScrollCollapse": true,
-            "bStateSave": true,
-            "bPaginate": false,
-            "bLengthChange": false,
-            "bFilter": false,
-            "bSort": true,
-            "bInfo": false,
-            "bAutoWidth": true,
-            "bAutoHeight": false,
-               });
        });
        function on_click_event() {
                var ids = []; 
@@ -26,9 +14,7 @@
                });
                if (ids.length > 0) {
                        var id_str = ids.join('/');
-
                        // XXX spinner
-
                        $.getJSON('/portal/validate_action/' + id_str,
                                function(status) {
                                        $.each(status, function(request_type__id, request_status) {
                                                $('#portal__status__' + request_type__id).html(status_str);
 
 
-                                       });
-                               }
-                       );
-               }
-       }
-       function on_click_reject() {
-               var ids = []; 
-               $('.portal__validate__checkbox').each(function(i, el) {
-                       if ($(el).prop('checked')) {
-                               // portal__validate__checkbox__slice__2
-                               var id_array = $(el).attr('id').split('__');
-                               // push(slice__2)
-                               ids.push(id_array[3] + '__' + id_array[4]);
-                       }
-               });
-               if (ids.length > 0) {
-                       var id_str = ids.join('/');
-
-                       // XXX spinner
-
-                       $.getJSON('/portal/reject_action/' + id_str,
-                               function(status) {
-                                       $.each(status, function(request_type__id, request_status) {
-                                               // request_status: NAME -> dict (status, description)
-                                               var status_str = '';
-                                               $.each(request_status, function(name, result) {
-                                                       if (status_str != '')
-                                                               status_str += ' -- ';
-
-                                                       if (result.status) {
-                                                               status_str += '<font color="green">Rejected</font>';
-                                                               $('#portal__validate__checkbox__' + request_type__id).hide();
-                                                       } else {
-                                                               status_str += '<font color="red">ERROR: ' + result.description + '</font>';
-                                                       }
-                                               });
-                                               $('#portal__status__' + request_type__id).html(status_str);
-
-
                                        });
                                }
                        );
        }
 </script>
 
-<div class="container-fluid">
 <div class="col-md-12">
        <h2>From your authorities</h2>
 </div>
 {% if my_authorities %}
-<div class="col-md-12">
-       <table class="table requests">
-           <thead>
-        <tr>
-            <th>ID</th>
-            <th></th>
-            <th>Type</th>
-            <th>Authority</th>
-            <th>Info</th>
-            <th>Date</th>
-            <th>Status</th>
-        </tr>
-        </thead>
-        <tbody>
+       
        {% for authority, requests in my_authorities.items %}
        
-        {% for request in requests %}
-        
+       <div class="col-md-12">
+               <h2>{{authority}}</h2>
+       </div>
+       
+    <table class="table">
+      <th>
+        <td>Type</td>
+        <td>Id</td>
+        <td>Details</td>
+        <td>Timestamp</td>
+        <td>Status</td>
+      </th>
+    {% for request in requests %}
+
+         <tr>
+               <td>
+               {% if request.allowed == 'allowed' %}
+               <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
+               {% else %}
+                       {% if request.allowed == 'expired' %}
+                               expired
+                       {% else %} {# denied #}
+                               denied
+                       {% endif %}
+               {% endif %}
+               </td>
+               <td>{{ request.type }}</td>
+               <td>{{ request.id }}</td>
+               <td>
         {% if request.type == 'user' %}
-       <tr>
-       {% elif request.type == 'slice' %}
-       <tr class="info">
-       {% else %}
-       <tr class="active">
-       {% endif %}
-           <td><span class="gray small">{{ request.id }}</span></td>
-           <td>
-            {% if request.allowed == 'allowed' %}
-            <input class='portal__validate__checkbox' id='portal__validate__checkbox__{{request.type}}__{{request.id}}' type='checkbox'/>
-            {% else %}
-                {% if request.allowed == 'expired' %}expired{% else %}denied{% endif %}
-            {% endif %}
-            </td>
-            <td><span class="type">{{ request.type }}</span></td>
-           <td><i>{{authority}}{{request.site_authority}}</i></td>
-               <td>
-            {% if request.type == 'user' %}
-                <b>{{request.first_name}} {{request.last_name}}</b> &lt;<a href="mailto:{{request.email}}">{{request.email}}</a>&gt;
-            {% elif request.type == 'slice' %}
+            <b>{{request.first_name}} {{request.last_name}}</b> <a href="mailto:{{request.email}}">{{request.email}}</a>
+        {% else %}
+            {% if request.type == 'slice' %}
             <b>{{request.slice_name}}</b> -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}}
-            {% else %}
+            {% else %} {# authority #}
             <b>{{request.site_name}}</b> ({{request.site_authority}}) -- {{request.address_city}}, {{request.address_country}}
             {% endif %}
-               </td>
-               <td>{{ request.timestamp }}</td>
-               
-               <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
-    
-        <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
-         </tr>
-    
-        {% endfor %}
-       
+        {% endif %}
+               </td>
+               <td>{{ request.timestamp }}</td>
+               
+               <td><span id='portal__status__{{request.type}}__{{request.id}}'></span></td>
+
+    <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
+         </tr>
+
+    {% endfor %}
+       </table>
        {% endfor %}
-          </tbody>
-    </table>
-   </div>
+
 {% else %}
        <div class="col-md-12">
                <i>There is no pending request waiting for validation.</i>
        </div>
 {% endif %}
-</div>
-
-
-<br />
+<div>nnllknjkn<br /><br /></div>
 <div class="col-md-12">
        <h2>From your sub-authorities</h2>
 </div>
        
        {% for authority, requests in sub_authorities.items %}
        <div class="col-md-12">
-       <h3>{{authority}}</h3>
-           <table class="table">
+               <h2>{{authority}}</h2>
+       </div>
+       
+       <table class="table">
              <th>
                <td>Type</td>
                <td>Id</td>
            <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
                  </tr>
            {% endfor %}
-           </table>
-       </div>
+       </table>
        {% endfor %}
 {% else %}
 <div class="col-md-12">
        <i>There is no pending request waiting for validation.</i>
 </div>
 {% endif %}
-<br />
+
 <div class="col-md-12">
        <h2>From your authorities with delegation</h2>
 </div>
        {% for authority, requests in delegation_authorities.items %}
        <div class="col-md-12">
                <h3>{{authority}}</h3>
-                   <table class="table">
+       </div>
+       <table class="table">
                      <th>
                        <td>Type</td>
                        <td>Id</td>
                    <!--<div class='portal_validate_request {{request.type}} {% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}'> -->
                          </tr>
                    {% endfor %}
-                   </table>
-               </div>
+       </table>
                {% endfor %}
 {% else %}
 <div class="col-md-12">
        <i>There is no pending request waiting for validation.</i>
 </div>
 {% endif %}
-<br />
 <div class="col-md-12">
        <button class="btn btn-onelab" type="button" id="portal__validate" onclick="on_click_event();"><span class="glyphicon glyphicon-ok"></span> Validate</button>
-       <button class="btn btn-danger" type="button" id="portal__reject" onclick="on_click_reject();"><span class="glyphicon glyphicon-remove"></span> Reject</button>
 </div>