From: Ciro Scognamiglio Date: Tue, 8 Apr 2014 17:26:40 +0000 (+0200) Subject: Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab X-Git-Tag: myslice-1.1~151^2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ed078cce90a313ddd6e5b41ecff6c14344a99220;hp=2bf87806cbb956f7bf18e463c55753058635ad00;p=unfold.git Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab Conflicts: portal/templates/onelab/onelab_home-view.html --- diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index 2bdc1575..f73c991a 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,5 +1,8 @@ eclipse.preferences.version=1 encoding//portal/django_passresetview.py=utf-8 +encoding//portal/forms.py=utf-8 +encoding//portal/migrations/0002_extend_slice.py=utf-8 +encoding//portal/models.py=utf-8 encoding//portal/urls.py=utf-8 encoding//portal/validationview.py=utf-8 encoding//portal/views.py=utf-8 diff --git a/myslice/urls.py b/myslice/urls.py index 15121bfc..2638e4df 100644 --- a/myslice/urls.py +++ b/myslice/urls.py @@ -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[^/]+)/?$', portal.sliceresourceview.SliceResourceView.as_view()), (r'^users/(?P[^/]+)/?$', portal.slicetabusers.SliceUserView.as_view()), diff --git a/plugins/querytable/__init__.py b/plugins/querytable/__init__.py index 6a2bb29a..5a80bb9f 100644 --- a/plugins/querytable/__init__.py +++ b/plugins/querytable/__init__.py @@ -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 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" , ], } diff --git a/plugins/querytable/static/css/querytable.css b/plugins/querytable/static/css/querytable.css index edbc683e..a42ab1fe 100644 --- a/plugins/querytable/static/css/querytable.css +++ b/plugins/querytable/static/css/querytable.css @@ -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"] { diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js index c2f0d55e..5e734a1e 100644 --- a/plugins/querytable/static/js/querytable.js +++ b/plugins/querytable/static/js/querytable.js @@ -197,10 +197,15 @@ 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') { @@ -220,10 +225,11 @@ } /* XXX TODO: Remove this and have something consistant */ if(obj=='resource'){ - line.push(' '+record[this.init_key]); + //line.push(' '+record[this.init_key]); }else{ - line.push(' '+record[this.init_key]); + //line.push(' '+record[this.init_key]); } + line.push(record[this.init_key]); } else { if (record[colnames[j]]) line.push(record[colnames[j]]); @@ -232,11 +238,7 @@ } } - // 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); @@ -606,10 +608,10 @@ 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); diff --git a/plugins/querytable/templates/querytable.html b/plugins/querytable/templates/querytable.html index bc9cc034..d0f18c05 100644 --- a/plugins/querytable/templates/querytable.html +++ b/plugins/querytable/templates/querytable.html @@ -1,19 +1,19 @@ -
- +
+
+ {% if checkboxes %}{% endif %} {% for column in columns %} {% endfor %} - {% for column in hidden_columns %} {% endfor %} - {% if checkboxes %} {% endif %} + {% for column in hidden_columns %} {% endfor %} + {% if checkboxes %} {% endif %} {% for column in columns %} {% endfor %} {% for column in hidden_columns %} {% endfor %} - {% if checkboxes %} {% endif %}
+/-{{ column }}{{ column }}+/-{{ column }}
+/-{{ column }}{{ column }}+/-
diff --git a/portal/newsview.py b/portal/newsview.py new file mode 100644 index 00000000..ace1f539 --- /dev/null +++ b/portal/newsview.py @@ -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)) + diff --git a/portal/sliceresourceview.py b/portal/sliceresourceview.py index 68837659..fd9b3f88 100644 --- a/portal/sliceresourceview.py +++ b/portal/sliceresourceview.py @@ -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 index 00000000..e69de29b diff --git a/portal/templates/_widget-topmenu.html b/portal/templates/_widget-topmenu.html index cf810295..6236344a 100644 --- a/portal/templates/_widget-topmenu.html +++ b/portal/templates/_widget-topmenu.html @@ -7,7 +7,7 @@
    -
  • News
  • +
  • News
  • About
  • Public Website
  • Intranet
  • diff --git a/portal/templates/home-view.html b/portal/templates/home-view.html index cb51b530..8cf7ca47 100644 --- a/portal/templates/home-view.html +++ b/portal/templates/home-view.html @@ -2,6 +2,9 @@ {% load portal_filters %} {% block content %} +
    +{% widget '_widget_news.html' %} +