news
authorCiro Scognamiglio <ciro.scognamiglio@cslash.net>
Tue, 8 Apr 2014 17:23:52 +0000 (19:23 +0200)
committerCiro Scognamiglio <ciro.scognamiglio@cslash.net>
Tue, 8 Apr 2014 17:23:52 +0000 (19:23 +0200)
15 files changed:
myslice/urls.py
plugins/querytable/__init__.py
plugins/querytable/static/css/querytable.css
plugins/querytable/static/js/querytable.js
plugins/querytable/templates/querytable.html
portal/newsview.py [new file with mode: 0644]
portal/sliceresourceview.py
portal/templates/_widget-news.html [new file with mode: 0644]
portal/templates/_widget-topmenu.html
portal/templates/news.html [new file with mode: 0644]
portal/templates/onelab/onelab_home-view.html
portal/templates/onelab/onelab_news.html [new file with mode: 0644]
portal/templates/onelab/onelab_widget-news.html [new file with mode: 0644]
portal/templates/onelab/onelab_widget-topmenu.html
portal/templates/slice-resource-view.html

index 15121bf..2638e4d 100644 (file)
@@ -15,6 +15,7 @@ from settings import auxiliaries, INSTALLED_APPS
 import portal.platformsview
 import portal.dashboardview
 import portal.homeview
+import portal.newsview
 
 home_view=portal.homeview.HomeView.as_view()
 dashboard_view=portal.dashboardview.DashboardView.as_view()
@@ -79,7 +80,7 @@ urls = [
     #
     #
     # Portal
-    
+    (r'^news/?$', portal.newsview.NewsView.as_view()),
     (r'^resources/(?P<slicename>[^/]+)/?$', portal.sliceresourceview.SliceResourceView.as_view()),
     (r'^users/(?P<slicename>[^/]+)/?$', portal.slicetabusers.SliceUserView.as_view()),
     
index 6a2bb29..5a80bb9 100644 (file)
@@ -71,7 +71,7 @@ Current implementation makes the following assumptions
             aoColumnDefs = self.datatables_options.setdefault ('aoColumnDefs',[])
             # here 'checkbox' is the class that we give to the <th> dom elem
             # dom-checkbox is a sorting type that we define in querytable.js
-            aoColumnDefs.append ( {'aTargets': ['checkbox'], 'sSortDataType': 'dom-checkbox' } )
+            #aoColumnDefs.insert (0, {'aTargets': ['checkbox'], 'sSortDataType': 'dom-checkbox' } )
 
     def template_file (self):
         return "querytable.html"
@@ -95,7 +95,7 @@ Current implementation makes the following assumptions
             'css_files': [ #"css/dataTables.bootstrap.css",
                            # hopefully temporary, when/if datatables supports sPaginationType=bootstrap3
                            # for now we use full_numbers, with our own ad hoc css 
-                           "css/dataTables.full_numbers.css",
+                           #"css/dataTables.full_numbers.css",
                            #"css/querytable.css" , 
                            ],
             }
index edbc683..a42ab1f 100644 (file)
@@ -16,7 +16,6 @@ div.QueryTable table.dataTable th {
 }
 
 div.QueryTable table.dataTable th.checkbox {
-    padding-left: 14px;
 }
 
 div.QueryTable table.dataTable td, div.QueryTable table.dataTable textarea, div.QueryTable table.dataTable input [type="text"] {
index 375aa8f..461acf6 100644 (file)
             var colnames = cols.map(function(x) {return x.sTitle})
             var nb_col = cols.length;
             /* if we've requested checkboxes, then forget about the checkbox column for now */
-            if (this.options.checkboxes) nb_col -= 1;
-
+            //if (this.options.checkboxes) nb_col -= 1;
+                       // catch up with the last column if checkboxes were requested 
+            if (this.options.checkboxes) {
+                // Use a key instead of hostname (hard coded...)
+                line.push(this.checkbox_html(record));
+               }
+               
             /* fill in stuff depending on the column name */
-            for (var j = 0; j < nb_col; j++) {
+            for (var j = 1; j < nb_col; j++) {
                 if (typeof colnames[j] == 'undefined') {
                     line.push('...');
                 } else if (colnames[j] == 'hostname') {
                     }
                     /* XXX TODO: Remove this and have something consistant */
                     if(obj=='resource'){
-                        line.push('<a href="../'+obj+'/'+record['urn']+'"><span class="glyphicon glyphicon-search"></span></a> '+record[this.init_key]);
+                        //line.push('<a href="../'+obj+'/'+record['urn']+'"><span class="glyphicon glyphicon-search"></span></a> '+record[this.init_key]);
                     }else{
-                        line.push('<a href="../'+obj+'/'+record[this.init_key]+'"><span class="glyphicon glyphicon-search"></span></a> '+record[this.init_key]);
+                        //line.push('<a href="../'+obj+'/'+record[this.init_key]+'"><span class="glyphicon glyphicon-search"></span></a> '+record[this.init_key]);
                     }
+                    line.push(record[this.init_key]);
                 } else {
                     if (record[colnames[j]])
                         line.push(record[colnames[j]]);
                 }
             }
     
-            // catch up with the last column if checkboxes were requested 
-            if (this.options.checkboxes) {
-                // Use a key instead of hostname (hard coded...)
-                line.push(this.checkbox_html(record));
-               }
+            
     
            // adding an array in one call is *much* more efficient
                // this.table.fnAddData(line);
      was in fact given as a third argument, and not second 
      as the various online resources had it - go figure */
     $.fn.dataTableExt.afnSortData['dom-checkbox'] = function  ( oSettings, _, iColumn ) {
-       return $.map( oSettings.oApi._fnGetTrNodes(oSettings), function (tr, i) {
-           return result=$('td:eq('+iColumn+') input', tr).prop('checked') ? '1' : '0';
-       );
-    }
+               return $.map( oSettings.oApi._fnGetTrNodes(oSettings), function (tr, i) {
+                   return result=$('td:eq('+iColumn+') input', tr).prop('checked') ? '1' : '0';
+               });
+    };
 
 })(jQuery);
 
index bc9cc03..d0f18c0 100644 (file)
@@ -1,19 +1,19 @@
-<div id='main-{{ domid }}' class='querytable-spacer'>
-  <table class='table table-striped table-bordered dataTable' id='{{domid}}__table' width='100%'>
+<div id="main-{{ domid }}" class="">
+  <table class="table dataTable" id="{{domid}}__table" width="100%">
     <thead>
       <tr>
+       {% if checkboxes %}<th class="checkbox">+/-</th>{% endif %}
         {% for column in columns %} <th>{{ column }}</th> {% endfor %} 
-        {% for column in hidden_columns %} <th>{{ column }}</th> {% endfor %} 
-        {% if checkboxes %} <th class="checkbox">+/-</th> {% endif %}
+        {% for column in hidden_columns %} <th>{{ column }}</th> {% endfor %}
       </tr>
     </thead> 
     <tbody>
     </tbody>
     <tfoot>
       <tr>
+       {% if checkboxes %} <th>+/-</th> {% endif %}
         {% for column in columns %} <th>{{ column }}</th> {% endfor %} 
         {% for column in hidden_columns %} <th>{{ column }}</th> {% endfor %} 
-        {% if checkboxes %} <th>+/-</th> {% endif %}
       </tr>
     </tfoot> 
   </table>
diff --git a/portal/newsview.py b/portal/newsview.py
new file mode 100644 (file)
index 0000000..ace1f53
--- /dev/null
@@ -0,0 +1,32 @@
+from django.core.context_processors import csrf
+from django.http import HttpResponseRedirect
+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
+
+from unfold.loginrequired import FreeAccessView
+
+from manifoldapi.manifoldresult import ManifoldResult
+from myslice.configengine import ConfigEngine
+
+from myslice.theme import ThemeView
+
+class NewsView (FreeAccessView, ThemeView):
+    template_name = 'news.html'
+
+    def get (self, request, state=None):
+        env = {}
+        
+        if request.user.is_authenticated(): 
+            env['person'] = self.request.user
+            env['username'] = self.request.user
+        else: 
+            env['person'] = None
+            env['username'] = None
+    
+        env['theme'] = self.theme
+        env['section'] = "News"
+
+        return render_to_response(self.template, env, context_instance=RequestContext(request))
+
index 254e2fd..762b568 100644 (file)
@@ -202,7 +202,7 @@ class SliceResourceView (LoginRequiredView, ThemeView):
 
         template_env = {}
         template_env['list_resources'] = list_resources.render(self.request)
-        template_env['list_reserved_resources'] = list_reserved_resources.render(self.request)
+        template_env['list_reserved_resources'] = list_reserved_resources.render(self.request)
 
         template_env['columns_editor'] = filter_column_editor.render(self.request)
 
diff --git a/portal/templates/_widget-news.html b/portal/templates/_widget-news.html
new file mode 100644 (file)
index 0000000..e69de29
index 4ed429a..75ff78f 100644 (file)
@@ -7,7 +7,7 @@
                
                <div id="secondary">
                        <ul>
-                               <li>News</li>
+                               <li><a href="/news">News</a></li>
                                <li><a href="/portal/about">About</a></li>
                                <li><a target="_blank" href="http://www.onelab.eu">Public Website</a></li>
                                <li><a target="_blank" href="http://intranet.onelab.eu">Intranet</a></li>
diff --git a/portal/templates/news.html b/portal/templates/news.html
new file mode 100644 (file)
index 0000000..e69de29
index 090f66b..b69ff12 100644 (file)
@@ -1,6 +1,10 @@
 {% extends "layout.html" %}
+{% load portal_filters %}
 
 {% block content %}
+<div class="row">
+{% widget '_widget-news.html' %}
+</div>
 <div class="row" id="home-dashboard">
        <ul class="nav nav-tabs">
          <li class="active"><a class="home-tab" data-panel="user" href="#">USER</a></li>
diff --git a/portal/templates/onelab/onelab_news.html b/portal/templates/onelab/onelab_news.html
new file mode 100644 (file)
index 0000000..a06b125
--- /dev/null
@@ -0,0 +1,19 @@
+{% extends "layout_wide.html" %}
+
+{% block content %}
+<div class="container">
+    <div class="row">
+        <div class="col-md-12">
+               <h1><a href="#about"><img src="{{ STATIC_URL }}icons/slices-xs.png" alt="News" />News</a></h1>
+               <br />
+        </div>
+    </div>
+       <div class="row">
+        <div class="col-md-12">
+
+               The <b>OneLab</b> Portal opens with the <b>PlanetLab Europe</b>, <b>IOTLab</b> and <b>NITOS</b> testbeds!
+               </div>
+       </div>
+</div>
+{% endblock %}
diff --git a/portal/templates/onelab/onelab_widget-news.html b/portal/templates/onelab/onelab_widget-news.html
new file mode 100644 (file)
index 0000000..83cec76
--- /dev/null
@@ -0,0 +1,5 @@
+<div class="alert alert-info alert-dismissable">
+<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+<span class="glyphicon glyphicon-globe"></span>
+The <b>OneLab</b> Portal opens with the <b>PlanetLab Europe</b>, <b>IOTLab</b> and <b>NITOS</b> testbeds!
+</div>
\ No newline at end of file
index 4ed429a..75ff78f 100644 (file)
@@ -7,7 +7,7 @@
                
                <div id="secondary">
                        <ul>
-                               <li>News</li>
+                               <li><a href="/news">News</a></li>
                                <li><a href="/portal/about">About</a></li>
                                <li><a target="_blank" href="http://www.onelab.eu">Public Website</a></li>
                                <li><a target="_blank" href="http://intranet.onelab.eu">Intranet</a></li>
index f84d1ce..33d0c08 100644 (file)
@@ -14,7 +14,7 @@
                
                <div class="list-group-item list-resources">
                        <span class="list-group-item-heading">View</span>
-                       <a class="list-group-item" data-panel="resources" href="#">All</a>
+                       <a class="list-group-item active" data-panel="resources" href="#">All</a>
                        <a class="list-group-item" data-panel="reserved" href="#">Reserved</a>
                        <a class="list-group-item" data-panel="pending" href="#">Pending <span class="badge" id="badge-pending" data-number="0"></span></a>
                </div>