Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
[unfold.git] / portal / templates / _widget-no_credentials.html
1 <!-- This widget is used to show a popup to users explaining why they don't have credentials delegated to the portal (accountview, homeview) -->
2 <!-- Modal- No credentials -->
3 <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
4      <div class="modal-dialog">
5          <div class="modal-content">
6              <div class="modal-header">
7                  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
8                      <h4 class="modal-title" id="myModalLabel">No credentials are delegated to the portal</h4>
9              </div>
10                         <div class="modal-body" style="text-align:justify;">
11                         <p>You are getting this message for any of the following reasons:</p>
12                         <ul>
13                                 <li>If your account is still pending for validation</li>
14                                 <li>If the server cache hasn't been cleared</li>
15                                 <li>If you press the "Clear Credentials" button</li>
16                                 <li>If you "Generate a new key pair"</li>
17                                 <li>If a new slice is added to your account</li>
18                         </ul>
19                         <h3>Clear server cache</h3>
20             <p>
21             <button class="btn btn-default btn-primary" type="button" title="Clear server cache" name="clear_server_cache" id="clear_server_cache" style="float:left;">Clear server cache</button>
22             <div id="clear_success" style="color:green; margin-left: 160px;">&nbsp;</div>
23             <div id="clear_error" style="color:red; margin-left: 160px;">&nbsp;</div>
24             </p>
25                         <p>Unless your account has not yet been validated, it is sufficient to refresh the page or go back to the home page. 
26                                 The portal will then regenerate your credentials. In some cases it may take more time than usual. If nothing works, 
27                                 then please logout and login back into to the portal.
28                         </p>
29                         <h3>Manual delegation of credentials</h3>
30                                 <p>
31                                         You have selected upon sign-up to upload your public key. As you have uploaded your own public key, 
32                                         the portal can no longer generate your credentials automatically. In order to have your credentials 
33                                         delegated to the portal, please follow these instructions:
34                                 </p>
35                                 <ul>
36                                         <li>Your account must first be validated by the manager of your organization.</li>
37                                         <li>In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to
38                                                 <a href="/portal/manual_delegation" target="_blank" style="text-decoration:underline;font-weight:bold;">delegate your credentials.</a></li>
39                                 </ul>
40                         </p>
41                         <h3>Contact support</h3>
42                         <p>If you don't have the above mentioned cases and still have this message, please  <a href="/contact/" target="_blank" style="text-decoration:underline;font-weight:bold;">contact us</a>.</p>
43              </div>
44              <div class="modal-footer">
45                  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
46              </div>
47          </div>
48      </div>
49 </div>
50 <script>
51 $(document).ready(function() {
52     $('button#clear_server_cache').click(function() {
53         $('#clear_success').html('<img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Services" />');
54         $.post("/cache/clear/", function( data ) {
55             console.log(data);
56             if(data['ret']==1){
57                 $('#clear_success').html('Server cache cleared')
58             }else{
59                 $('#clear_error').html('error:'+data['error'])
60                 $('#clear_success').html('');
61             }
62         });
63     });
64 });
65 </script>
66