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()
#
#
# 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()),
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"
'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" ,
],
}
}
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"] {
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);
-<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>
--- /dev/null
+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))
+
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)
<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>
{% 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>
--- /dev/null
+{% 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 %}
--- /dev/null
+<div class="alert alert-info alert-dismissable">
+<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</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
<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>
<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>