many cosmetic changes
authorCiro Scognamiglio <ciro.scognamiglio@cslash.net>
Tue, 5 Aug 2014 15:38:17 +0000 (17:38 +0200)
committerCiro Scognamiglio <ciro.scognamiglio@cslash.net>
Tue, 5 Aug 2014 15:38:17 +0000 (17:38 +0200)
14 files changed:
auth/views.py
myslice/theme.py
plugins/apply/templates/apply.html
plugins/querytable/templates/querytable.html
plugins/scheduler2/static/js/scheduler2.js
plugins/scheduler2/templates/scheduler.html
portal/homeview.py
portal/managementtababout.py
portal/registrationview.py
portal/static/css/onelab.css
portal/templates/onelab/onelab_slice-view.html
portal/templates/onelab/onelab_supportview.html
portal/templates/onelab/onelab_widget-slice-sections.html
portal/templates/slice-resource-view.html

index 104d11c..b959e73 100644 (file)
@@ -1,12 +1,18 @@
 from django.contrib.auth import logout
 from django.http import HttpResponseRedirect
 
+import activity.user
+
 # hard question : where should we redirect requests to logout if user is not logged in ?
 def logout_user (request):
     # check that we're indeed logged in
     if not request.user.is_authenticated():
         return HttpResponseRedirect ('/')
     print "LOGGING OUT"
+    
+    # log user activity
+    activity.user.logout(request)
+    
     logout(request)
     return HttpResponseRedirect ('/')
         
index d44b854..e16326b 100644 (file)
@@ -14,12 +14,12 @@ class ThemeView (object):
     def template(self):
         # Load a template from the theme directory if it exists
         # else load it from the common templates dir
-        print "THEME = ",self.theme
-        print "TEMPLATE = ",self.template_name
-        print "TEMPLATE_DIRS = ",TEMPLATE_DIRS
+        #print "THEME = ",self.theme
+        #print "TEMPLATE = ",self.template_name
+        #print "TEMPLATE_DIRS = ",TEMPLATE_DIRS
         filename = self.theme + '_' + self.template_name
-        print any(os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS)
-        print (os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS)
+        #print any(os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS)
+        #print (os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS)
         if any(os.path.exists(os.path.join(d,filename)) for d in TEMPLATE_DIRS):
             return filename
         else:
index ab52efc..f05af49 100644 (file)
@@ -42,6 +42,6 @@
 
   
   <!-- Button toolbar -->
-  <button class="btn btn-onelab btn-sm"  id="{{domid}}__apply" data-toggle="modal" data-target="#{{domid}}__apply__window">Apply</button>
+  <button class="btn btn-onelab btn-apply"  id="{{domid}}__apply" data-toggle="modal" data-target="#{{domid}}__apply__window">Apply</button>
   <!-- <button class="btn btn-default btn-sm" id="{{domid}}__cancel">Cancel</button> -->
 </div> 
index c843926..8da79d4 100644 (file)
@@ -2,7 +2,7 @@
   <table class="table dataTable" id="{{domid}}__table" width="100%">
     <thead>
       <tr>
-       {% if checkboxes %}<th class="checkbox"><input type="checkbox" disabled/></th>{% endif %}
+       {% if checkboxes %}<th><input type="checkbox" disabled/></th>{% endif %}
         <th>&#9888;</th>
         {% for column, field in columns.items %} <th>{{ column }}</th> {% endfor %} 
         {% for column, field in hidden_columns.items %} <th>{{ column }}</th> {% endfor %}
index 04665c6..6b55b92 100755 (executable)
@@ -815,6 +815,7 @@ var SCHEDULER_COLWIDTH = 50;
                 var num_hidden_cells;\r
 \r
                 $("#DateToRes").datepicker({\r
+                       dateFormat: "D, d M yy",\r
                     onRender: function(date) {\r
                         return date.valueOf() < now.valueOf() ? 'disabled' : '';\r
                     }\r
index 7c29877..928b2da 100755 (executable)
@@ -8,22 +8,28 @@
 </div>\r
 <div id="plugin-{{ domid }}" class="">\r
     <div class="row m-b">\r
-        <div class="col-md-2">\r
-            <label for="inputEmail3" class="col-sm-2 control-label">Day:</label>\r
-        </div>\r
-        <div class="col-md-10">\r
-            <label for="inputEmail3" class="col-sm-2 control-label">Time of day:</label>\r
-        </div>\r
-    </div>\r
-    <div class="row m-b">\r
-               <div class="col-md-2">\r
-               <input id="DateToRes" type="text" placeholder="Reservation Date">\r
-               <!-- <input id="DateToRes" type="text" class="form-control" placeholder="Reservation Date"> -->\r
-               <span class="glyphicon glyphicon-calendar"></span>\r
+        <div class="col-md-4">\r
+               <div class="row">\r
+                       <div class="col-md-1">\r
+                       <label for="inputEmail3" class="control-label">Day:</label>\r
+                       </div>\r
+                               <div class="col-md-11">\r
+                                       <input id="DateToRes" type="text" placeholder="Reservation Date">\r
+                                       <span class="glyphicon glyphicon-calendar" style="position:absolute;margin-left:-20px;margin-top:4px;"></span>\r
+                                       <!-- <input id="DateToRes" type="text" class="form-control" placeholder="Reservation Date"> -->\r
+                               </div>\r
+                       </div>\r
                </div>\r
-               <div class="col-md-10">\r
-                       <div class="sliderContainer">\r
-                               <div id="tblSlider"></div>\r
+        <div class="col-md-8">\r
+               <div class="row">\r
+                       <div class="col-md-2">\r
+                       <label for="inputEmail3" class="control-label">Time of day:</label>\r
+                       </div>\r
+                       <div class="col-md-10">\r
+                                       <div class="sliderContainer">\r
+                                               <div id="tblSlider"></div>\r
+                                       </div>\r
+                               </div>\r
                        </div>\r
                </div>\r
     </div>\r
index b4faa8e..f830cc1 100644 (file)
@@ -5,6 +5,7 @@ from django.contrib.auth import authenticate, login, logout
 from django.template import RequestContext
 from django.shortcuts import render_to_response
 from django.shortcuts import render
+
 import json
 
 from unfold.loginrequired import FreeAccessView
@@ -18,6 +19,8 @@ from myslice.configengine import ConfigEngine
 
 from myslice.theme import ThemeView
 
+import activity.user
+
 class HomeView (FreeAccessView, ThemeView):
     template_name = 'home-view.html'
         
@@ -62,6 +65,9 @@ class HomeView (FreeAccessView, ThemeView):
                     env['person'] = self.request.user
                     env['username'] = self.request.user
                     
+                    # log user activity
+                    activity.user.login(self.request)
+                    
                     ## check user is pi or not
                     platform_query  = Query().get('local:platform').select('platform_id','platform','gateway_type','disabled')
                     account_query  = Query().get('local:account').select('user_id','platform_id','auth_type','config')
index 899fbfd..cee9311 100644 (file)
@@ -16,15 +16,11 @@ from myslice.configengine import ConfigEngine
 from myslice.theme import ThemeView
 import json
 
-import activity
-
 class ManagementAboutView (FreeAccessView, ThemeView):
     template_name = 'management-tab-about.html'
 
     def get (self, request):
         
-        activity.userLogin(request)
-        
         if request.user.is_authenticated(): 
             user_query  = Query().get('user').select('user_hrn','parent_authority').filter_by('user_hrn','==','$user_hrn')
             user_details = execute_query(self.request, user_query)
index e0a1ddf..c24fda6 100644 (file)
@@ -5,6 +5,7 @@ from hashlib    import md5
 
 from django.views.generic       import View
 from django.template.loader     import render_to_string
+
 from django.shortcuts           import render
 from django.contrib.auth        import get_user_model
 from django.contrib.sites.models import Site
@@ -21,6 +22,8 @@ from portal.actions             import create_pending_user
 
 from myslice.theme import ThemeView
 
+import activity.user
+
 # since we inherit from FreeAccessView we cannot redefine 'dispatch'
 # so let's override 'get' and 'post' instead
 #
@@ -43,12 +46,13 @@ class RegistrationView (FreeAccessView, ThemeView):
         if authorities is not None:
             authorities = sorted(authorities)
         
+        print "############ BREAKPOINT 1 #################"
         # Page rendering
         page = Page(wsgi_request)
         page.add_js_files  ( [ "js/jquery.validate.js", "js/my_account.register.js", "js/jquery.qtip.min.js","js/jquery-ui.js" ] )
         page.add_css_files ( [ "css/onelab.css", "css/registration.css", "css/jquery.qtip.min.css" ] )
         page.add_css_files ( [ "https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" ] )
-
+        print "############ BREAKPOINT 2 #################"
         if method == 'POST':
             reg_form = {}
             # The form has been submitted
@@ -56,7 +60,9 @@ class RegistrationView (FreeAccessView, ThemeView):
             # get the domain url
             current_site = Site.objects.get_current()
             current_site = current_site.domain
-
+            
+            print "############ BREAKPOINT 3 #################"
+            
             for authority in authorities:
                 if authority['name'] == wsgi_request.POST.get('org_name', ''):
                     authority_hrn = authority['authority_hrn']     
@@ -64,7 +70,9 @@ class RegistrationView (FreeAccessView, ThemeView):
             # Handle the case when the template uses only hrn and not name
             if authority_hrn is None:
                 authority_hrn = wsgi_request.POST.get('org_name', '')
-
+            
+            print "############ BREAKPOINT 4 #################"
+            
             post_email = wsgi_request.POST.get('email','').lower()
             salt = randint(1,100000)
             email_hash = md5(str(salt)+post_email).hexdigest()
@@ -81,7 +89,9 @@ class RegistrationView (FreeAccessView, ThemeView):
                 'pi'            : '',
                 'validation_link': 'http://' + current_site + '/portal/email_activation/'+ email_hash
             }
-
+            
+            print "############ BREAKPOINT 5 #################"
+            
             # Construct user_hrn from email (XXX Should use common code)
             split_email = user_request['email'].split("@")[0] 
             split_email = split_email.replace(".", "_")
@@ -155,9 +165,12 @@ class RegistrationView (FreeAccessView, ThemeView):
             if not errors:
                 create_pending_user(wsgi_request, user_request, user_detail)
                 self.template_name = 'user_register_complete.html'
+                # log user activity
+                activity.user.register(self.request)
                 return render(wsgi_request, self.template, {'theme': self.theme}) 
 
         else:
+            print "############ BREAKPOINT A #################"
             user_request = {}
             ## this is coming from onelab website onelab.eu
             reg_form = {
@@ -165,6 +178,9 @@ class RegistrationView (FreeAccessView, ThemeView):
                 'last_name': wsgi_request.GET.get('last_name', ''),
                 'email': wsgi_request.GET.get('email', ''),
                 }
+            # log user activity
+            activity.user.signup(self.request)
+            print "############ BREAKPOINT B #################"
 
         template_env = {
           'topmenu_items': topmenu_items_live('Register', page),
@@ -175,4 +191,5 @@ class RegistrationView (FreeAccessView, ThemeView):
         template_env.update(user_request)
         template_env.update(reg_form)
         template_env.update(page.prelude_env ())
+        print "############ BREAKPOINT C #################"
         return render(wsgi_request, self.template,template_env)
index 5be52dd..7d11324 100644 (file)
@@ -389,7 +389,9 @@ a.sl-resources, a.sl-resources:hover {
     padding:2px 4px;
     -moz-border-radius: 4px;
     border-radius: 4px;
-    width:125px;
+    width:105px;
+    margin-left:4px;
+    margin-bottom:8px;
     text-align: center;
 }
 a.sl-resources.active, a.sl-resources.active:hover, a.sl-resources.active:focus {
@@ -397,7 +399,13 @@ a.sl-resources.active, a.sl-resources.active:hover, a.sl-resources.active:focus
     -moz-border-radius: 4px;
     border-radius: 4px;
 }
-
+a.sl-resources:first-child {
+    margin-left:12px;
+}
+button.btn-apply {
+    font-size:13px;
+    padding:2px 8px;
+}
 div#slice-info {
     margin-top:25px;
 }
@@ -476,6 +484,8 @@ div#slice-info td {
     padding:3px 5px;
 }
 .slice-pending button.apply {
+    font-size:14px;
+    padding:2px 5px;
 }
 .slice-pending button.clear {
 }
@@ -715,3 +725,10 @@ div.slogan {
     padding-top:60px;
     text-shadow: 1px 1px #013540;
 }
+
+th {
+    border:0 !important;
+}
+th.checkbox {
+    
+}
index 8057609..c2d52c3 100644 (file)
@@ -1,11 +1,9 @@
 {% extends "layout_wide.html" %}
 
 {% block head %}
-
 {% endblock %}
 
 {% block content %}
-
 {% include theme|add:"_widget-slice-sections.html" %}
          
 <div class="container-fluid tab-content container-slice">
index eb2a8de..9f311a4 100644 (file)
@@ -14,8 +14,7 @@
        <div class="row">
                <div class="col-md-12">
                        <ul class="nav nav-tabs nav-section">
-                               <li class="active"><a href="#support">Tickets</a></li>
-                               <li><a href="#faq">FAQ</a></li>
+                               <li class="active"><a href="#faq">FAQ</a></li>
                                <li><a href="#contact">Contact</a></li>
                        </ul>
            </div>
 </div>
 
 <div class="container tab-content">
-       <div class="tab-pane active row" id="support">
-               <div class="col-md-12">
-                       <h2>Report a Bug</h2>
-                       <p>If you have found a bug or having difficulties accesing some features or found some anomalies, please report it using our ticketing system.</p>
-                       <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
-<!--                   <h3>Unresolved Tickets</h3>
-                       <table class="mytable table table-bordered table-hover">
-                       <tr>
-                           <th>Ticket No</th>
-                                       <th>Reported By</th>
-                                       <th>Description</th>
-                           <th>Status</th>
-                       </tr>
-                       <tr>
-                           <td>1</td>
-                                       <td>yasin.upmc@gmail.com</td>
-                                       <td> Slice_request page is not working </td>
-                                       <td> Unresolved</td>
-                       </tr>
-                               <tr>
-                                       <td>2</td>
-                                       <td>azerty@lip6.fr</td>
-                                       <td>Unable to Register</td>
-                                       <td>Unresolved</td>
-                               </tr> 
-               
-                   </table> -->
-               </div>
-         </div>
-       <div class="tab-pane row" id="faq">
+       <div class="tab-pane active row" id="faq">
                <div class="col-md-12">
                        <h2>Frequently Asked Questions (FAQs)<h2>
 
                </div>
          </div>
 
-       <div class="tab-pane row" id="contact">
-               <div class="col-md-12">
-                       <h2>Contact Us</h2>
-               
-                       <h3>Mailing List</h3>
-                       <p>You can subscribe to our mailing list by sending a request to: <b>support</b> (AT) <b>onelab</b> (DOT) <b>eu</b></p>
-                       <p>Also you can adress any issues in the same email address.</p>
-                       
-                       <h3>Mailing Address</h3>
-                       <address>
-                       UPMC - LIP6<br> 
-                       BoĆ®te courrier 16 <br>
-                       Couloir 26-00, Etage 01, Bureau 102<br>
-                       4 place Jussieu<br>
-                       75252 PARIS CEDEX 05<br>
-                       France<br> 
-                       </address>
-               </div>
-         </div>
+       <div class="tab-pane" id="contact">
+               <div class="row">
+                       <div class="col-md-12">
+                               <h2>Contact Us</h2>
+                               <div class="row">
+                                       <div class="col-md-6">
+                                               <h3>Mailing List</h3>
+                                               <p>&nbsp;</p>
+                                               <p>You can subscribe to our mailing list by sending a request at the following E-Mail address:</p>
+                                               <p class="address">
+                                                       <a href="mailto:contact@onelab.eu">contact@onelab.eu</a>
+                                               </p>
+                                               <p>Also you can adress any issues in the same email address.</p>
+                                       </div>
+                                       <div class="col-md-6">
+                                               <h3>Mailing Address</h3>
+                                               <p>&nbsp;</p>
+                                               <p class="address">
+                                                       <b>OneLab Team</b><br />
+                                                       UPMC - Laboratoire d'Informatique de Paris 6<br />
+                                                       Boite courrier 169<br />
+                                                       4 place Jussieu<br />
+                                                       75252 PARIS cedex 05<br />
+                                                       FRANCE
+                                               </p>
+                                               
+                                               
+                                       </div>
+                               </div>
+                               <div class="row">
+                                       <div class="col-md-6">
+                                               <h3>Report a Bug</h3>
+                                               <p>If you have found a bug or having difficulties accesing some features or found some anomalies, 
+                                                       please report it using our ticketing system.
+                                               </p>
+                                               <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
+                                       </div>
+                               </div>
+                       </div>
+               </div>
+       </div>
 </div>
 
 <script>
 $(document).ready(function() {
     $('button#ticketbtn').click(function() {
-        window.location="/portal/contact/";
+        window.location="/contact/";
     });
        $('.nav-tabs a').click(function (e) {
                e.preventDefault();
index 01c8d82..40761b5 100644 (file)
@@ -2,7 +2,7 @@
        <div class="row">
                <div class="col-md-12">
                         <div class="breadcrumbs">
-                                Experiment &nbsp;>&nbsp; {{ slice }}
+                                Experiment &nbsp;>&nbsp; Slice: {{ slice }}
                         </div>
                </div>
        </div>
                <div class="col-md-12">
 {% if section == "resources" %}
 <ul class="nav nav-tabs nav-section">
-       <li><a href="/slice/{{ slice }}#info">Information</a></li>
+       
        <!-- <li><a href="/slice/{{ slice }}#testbeds">Testbeds</a></li> -->
        <li class="active"><a class="link" href="/resources/{{ slice }}">Resources</a></li>
        <li><a href="/slice/{{ slice }}#users">Users</a></li>
+       <li><a href="/slice/{{ slice }}#info">Information</a></li>
        <!-- <li><a href="/slice/{{ slice }}#experiment">Statistics</a></li> -->
        <!-- <li><a href="/slice/{{ slice }}#experiment">Measurements</a></li> -->
        <li><a href="/slice/{{ slice }}#experiment">Tools</a></li>
 </ul>
 {% else %}
 <ul class="nav nav-tabs nav-section">
-       <li class="active"><a href="#info">Information</a></li>
        <!-- <li class="testbeds"><a href="#testbeds">Testbeds</a></li> -->
        <li><a class="link" href="/resources/{{ slice }}">Resources</a></li>
        <li class="users"><a href="#users">Users</a></li>
+       <li class="active"><a href="#info">Information</a></li>
        <!-- <li class="statistics"><a href="#experiment">Statistics</a></li> -->
        <!-- <li class="measurements"><a href="#experiment">Measurements</a></li> -->
        <li class="experiment"><a href="#experiment">Tools</a></li>
index 3355e0c..3fefedf 100644 (file)
@@ -26,20 +26,6 @@ $(document).ready(function() {
                {{filter_testbeds}}
        </div>
        <div class="col-md-10" style="height:100%;">
-               <!-- <div class="row slice-pending">
-                       <ul class="nav nav-pills">
-                               <li><a href="">Unreserved</a></li>
-                               <li><a href="">Reserved</a></li>
-                               <li><a href="">Pending<span class="badge" id="badge-pending" style="display:none;"></span></a></li>
-                               <li>
-                                       <button type="button" class="btn btn-primary apply" id="ApplyPendind">Apply</button>
-                                       <button type="button" class="btn btn-default clear">Clear</button>
-                               </li>
-                               <li>
-                                       <div id="loading" style="display:none;"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading" /></div>
-                               </li>
-                       </ul>
-               </div> -->
                <div class="row">
                        {% if msg %}
                        <div class="col-md-12"><p class="alert-success">{{ msg }}</p></div>
@@ -50,7 +36,7 @@ $(document).ready(function() {
                        <div class="col-md-6">
                                {{ filter_status }}
                        </div>
-                       <div class="col-md-2">
+                       <div class="col-md-1">
                                {{ apply }}
                        </div>
                </div>
@@ -97,7 +83,7 @@ $(document).ready(function() {
                        <div class="tab-content" style="height:100%;">
                                <div class="tab-pane active" id="resourcelist">
                                         <!-- Button trigger modal - columns selector -->
-                                       <button class="btn btn-primary btn-sm" style="float:right;" data-toggle="modal" data-target="#myModal">...</button>
+                                       <button class="btn btn-default btn-sm" style="float:right;" data-toggle="modal" data-target="#myModal">...</button>
                        {{list_resources}}
                                        <!-- <table cellpadding="0" cellspacing="0" border="0" class="table" id="objectList"></table> -->
                                </div>