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 ('/')
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:
<!-- 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>
<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>⚠</th>
{% for column, field in columns.items %} <th>{{ column }}</th> {% endfor %}
{% for column, field in hidden_columns.items %} <th>{{ column }}</th> {% endfor %}
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
</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
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.shortcuts import render
+
import json
from unfold.loginrequired import FreeAccessView
from myslice.theme import ThemeView
+import activity.user
+
class HomeView (FreeAccessView, ThemeView):
template_name = 'home-view.html'
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')
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)
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
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
#
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
# 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']
# 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()
'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(".", "_")
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 = {
'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),
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)
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 {
-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;
}
padding:3px 5px;
}
.slice-pending button.apply {
+ font-size:14px;
+ padding:2px 5px;
}
.slice-pending button.clear {
}
padding-top:60px;
text-shadow: 1px 1px #013540;
}
+
+th {
+ border:0 !important;
+}
+th.checkbox {
+
+}
{% extends "layout_wide.html" %}
{% block head %}
-
{% endblock %}
{% block content %}
-
{% include theme|add:"_widget-slice-sections.html" %}
<div class="container-fluid tab-content container-slice">
<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> </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> </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();
<div class="row">
<div class="col-md-12">
<div class="breadcrumbs">
- Experiment > {{ slice }}
+ Experiment > 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>
{{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>
<div class="col-md-6">
{{ filter_status }}
</div>
- <div class="col-md-2">
+ <div class="col-md-1">
{{ apply }}
</div>
</div>
<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>