--- /dev/null
+from django.http import HttpResponse
+from manifold.core.query import Query
+from manifoldapi.manifoldapi import execute_query,execute_admin_query
+from portal.models import PendingUser, PendingSlice, PendingAuthority
+import json
+
+from django.contrib.auth.models import User
+from django.template.loader import render_to_string
+from django.core.mail import EmailMultiAlternatives
+
+from theme import ThemeView
+
+theme = ThemeView()
+
+# Thierry: moving this right into the code so
+# most people can use myslice without having to install sfa
+# XXX tmp sfa dependency, should be moved to SFA gateway
+#from sfa.util.xrn import Xrn
+
+
+# Get the list of authorities
+
+def authority_get_pis(request, authority_hrn):
+ query = Query.get('authority').filter_by('authority_hrn', '==', authority_hrn).select('pi_users')
+ results = execute_admin_query(request, query)
+ # NOTE: temporarily commented. Because results is giving empty list.
+ # Needs more debugging
+ #if not results:
+ # raise Exception, "Authority not found: %s" % authority_hrn
+ #result, = results
+ #return result['pi_users']
+ return results
+
+def authority_get_pi_emails(request, authority_hrn):
+ pi_users = authority_get_pis(request,authority_hrn)
+ if any(d['pi_users'] == None for d in pi_users):
+ theme.template_name = 'email_default_recipients.txt'
+ default_email = render_to_string(theme.template, request)
+ default_email = default_email.replace('\n', '')
+ return default_email
+ else:
+ pi_user_hrns = [ hrn for x in pi_users for hrn in x['pi_users'] ]
+ query = Query.get('user').filter_by('user_hrn', 'included', pi_user_hrns).select('user_email')
+ results = execute_admin_query(request, query)
+ return [result['user_email'] for result in results]
+
+def is_pi(wsgi_request, user_hrn, authority_hrn):
+ # XXX could be done in a single query !
+
+ # select pi_authorities from user where user_hrn == "ple.upmc.jordan_auge"
+ query = Query.get('user').filter_by('user_hrn', '==', user_hrn).select('pi_authorities')
+ results = execute_admin_query(wsgi_request, query)
+ if not results:
+ # XXX Warning ?
+ return False
+ result = results[0]
+ user_authority_hrns = result.get('pi_authorities', [])
+ return authority_hrn in user_authority_hrns
+
+# SFA get record
+
+def sfa_get_user(request, user_hrn, pub):
+ query_sfa_user = Query.get('user').filter_by('user_hrn', '==', user_hrn)
+ result_sfa_user = execute_query(request, query_sfa_user)
+ return result_sfa_user
+
+def sfa_update_user(request, user_hrn, user_params):
+ # user_params: keys [public_key]
+ if 'email' in user_params:
+ user_params['user_email'] = user_params['email']
+ query = Query.update('user').filter_by('user_hrn', '==', user_hrn).set(user_params).select('user_hrn')
+ results = execute_query(request,query)
+ return results
+
+def sfa_add_authority(request, authority_params):
+ query = Query.create('authority').set(authority_params).select('authority_hrn')
+ results = execute_query(request, query)
+ print "sfa_add_auth results=",results
+ if not results:
+ raise Exception, "Could not create %s. Already exists ?" % authority_params['hrn']
+ return results
+
+def sfa_add_user_to_slice(request, user_hrn, slice_params):
+# UPDATE myslice:slice SET researcher=['ple.upmc.jordan_auge','ple.inria.thierry_parmentelat','ple.upmc.loic_baron','ple.upmc.ciro_scognamiglio','ple.upmc.mohammed-yasin_rahman','ple.upmc.azerty'] where slice_hrn=='ple.upmc.myslicedemo'
+ query_current_users = Query.get('slice').select('user').filter_by('slice_hrn','==',slice_params['hrn'])
+ results_current_users = execute_query(request, query_current_users)
+ slice_params['researcher'] = slice_params['researcher'] | results_current_users
+ query = Query.update('slice').filter_by('user_hrn', '==', user_hrn).set(slice_params).select('slice_hrn')
+ results = execute_query(request, query)
+# Also possible but not supported yet
+# UPDATE myslice:user SET slice=['ple.upmc.agent','ple.upmc.myslicedemo','ple.upmc.tophat'] where user_hrn=='ple.upmc.azerty'
+ if not results:
+ raise Exception, "Could not create %s. Already exists ?" % slice_params['hrn']
+ return results
+
+# Propose hrn
+
+def manifold_add_user(wsgi_request, request):
+ """Add a Manifold user corresponding to a user request.
+
+ Args:
+ wsgi_request: a WSGIRequest instance
+ request (dict): a dictionary containing the user request built from the
+ form.
+
+ Returns:
+ The user_id of the inserted user.
+
+ Raises:
+ ?
+
+ """
+ USER_CONFIG = '{"firstname": "%(first_name)s", "lastname": "%(last_name)s", "authority": "%(authority_hrn)s"}'
+
+ user_params = {
+ 'email' : request['email'],
+ 'password' : request['password'],
+ 'config' : USER_CONFIG % request,
+ 'status' : 1,
+ }
+
+ query = Query.create('local:user').set(user_params).select('email')
+ results = execute_admin_query(request, query)
+ if not results:
+ raise Exception, "Failed creating manifold user: %s" % user_params['email']
+ result = results[0]
+ return result['email']
+
+def manifold_update_user(request, email, user_params):
+ # user_params: password, config e.g.,
+ query = Query.update('local:user').filter_by('email', '==', email).set(user_params).select('email')
+ results = execute_admin_query(request,query)
+ # NOTE: results remains empty and goes to Exception. However, it updates the manifold DB.
+ # That's why I commented the exception part. -- Yasin
+ #if not results:
+ # raise Exception, "Failed updating manifold user: %s" % user_params['email']
+ #result, = results
+ return results
+
+def manifold_add_account(request, account_params):
+ query = Query.create('local:account').set(account_params).select(['user', 'platform'])
+ results = execute_admin_query(request,query)
+ if not results:
+ raise Exception, "Failed creating manifold account on platform %s for user: %s" % (account_params['platform'], account_params['user'])
+ result, = results
+ return result['user_id']
+
+def manifold_update_account(request,user_id,account_params):
+ # account_params: config
+ query = Query.update('local:account').filter_by('platform', '==', 'myslice').filter_by('user_id', '==', user_id).set(account_params).select('user_id')
+ results = execute_admin_query(request,query)
+ return results
+
+#explicitly mention the platform_id
+def manifold_delete_account(request, platform_id, user_id, account_params):
+ query = Query.delete('local:account').filter_by('platform_id', '==', platform_id).filter_by('user_id', '==', user_id).set(account_params).select('user_id')
+ results = execute_admin_query(request,query)
+ return results
+
+
+#not tested
+def manifold_add_platform(request, platform_params):
+ query = Query.create('local:platform').set(platform_params).select(['user', 'platform'])
+ results = execute_admin_query(request,query)
+ if not results:
+ raise Exception, "Failed creating manifold platform %s for user: %s" % (platform_params['platform'], platform_params['user'])
+ result, = results
+ return result['platform_id']
+
+
+def make_request_user(user):
+ request = {}
+ request['type'] = 'user'
+ request['id'] = user.id
+ request['timestamp'] = user.created # XXX in DB ?
+ request['authority_hrn'] = user.authority_hrn
+ request['first_name'] = user.first_name
+ request['last_name'] = user.last_name
+ request['email'] = user.email
+ request['login'] = user.login
+ request['user_hrn'] = user.user_hrn
+ request['public_key'] = user.public_key
+ request['private_key'] = user.private_key
+ return request
+
+def make_request_slice(slice):
+ request = {}
+ request['type'] = 'slice'
+ request['id'] = slice.id
+ request['user_hrn'] = slice.user_hrn
+ request['timestamp'] = slice.created
+ request['authority_hrn'] = slice.authority_hrn
+ request['slice_name'] = slice.slice_name
+ request['number_of_nodes'] = slice.number_of_nodes
+ request['type_of_nodes'] = slice.type_of_nodes
+ request['purpose'] = slice.purpose
+ return request
+
+def make_request_authority(authority):
+ request = {}
+ request['type'] = 'authority'
+ request['id'] = authority.id
+ request['site_name'] = authority.site_name
+ request['site_latitude'] = authority.site_latitude
+ request['site_longitude'] = authority.site_longitude
+ request['site_url'] = authority.site_url
+ request['site_authority'] = authority.site_authority
+ request['site_abbreviated_name'] = authority.site_abbreviated_name
+ request['address_line1'] = authority.address_line1
+ request['address_line2'] = authority.address_line2
+ request['address_line3'] = authority.address_line3
+ request['address_city'] = authority.address_city
+ request['address_postalcode'] = authority.address_postalcode
+ request['address_state'] = authority.address_state
+ request['address_country'] = authority.address_country
+ request['authority_hrn'] = authority.authority_hrn
+ request['timestamp'] = authority.created
+ return request
+
+def make_requests(pending_users, pending_slices, pending_authorities):
+ requests = []
+ for user in pending_users:
+ requests.append(make_request_user(user))
+ for slice in pending_slices:
+ requests.append(make_request_slice(slice))
+ for authority in pending_authorities:
+ requests.append(make_request_authority(authority))
+ return requests
+
+def get_request_by_id(ids):
+ sorted_ids = { 'user': [], 'slice': [], 'authority': [] }
+ for type__id in ids:
+ type, id = type__id.split('__')
+ sorted_ids[type].append(id)
+
+ if not ids:
+ pending_users = PendingUser.objects.all()
+ pending_slices = PendingSlice.objects.all()
+ pending_authorities = PendingAuthority.objects.all()
+ else:
+ pending_users = PendingUser.objects.filter(id__in=sorted_ids['user']).all()
+ pending_slices = PendingSlice.objects.filter(id__in=sorted_ids['slice']).all()
+ pending_authorities = PendingAuthority.objects.filter(id__in=sorted_ids['authority']).all()
+
+ return make_requests(pending_users, pending_slices, pending_authorities)
+
+def get_requests(authority_hrns=None):
+ print "get_request_by_authority auth_hrns = ", authority_hrns
+ if not authority_hrns:
+ pending_users = PendingUser.objects.all()
+ pending_slices = PendingSlice.objects.all()
+ pending_authorities = PendingAuthority.objects.all()
+ else:
+ pending_users = PendingUser.objects.filter(authority_hrn__in=authority_hrns).all()
+ pending_slices = PendingSlice.objects.filter(authority_hrn__in=authority_hrns).all()
+ pending_authorities = PendingAuthority.objects.filter(authority_hrn__in=authority_hrns).all()
+
+ return make_requests(pending_users, pending_slices, pending_authorities)
+
+# XXX Is it in sync with the form fields ?
+
+def portal_validate_request(wsgi_request, request_ids):
+ status = {}
+
+ if not isinstance(request_ids, list):
+ request_ids = [request_ids]
+
+ requests = get_request_by_id(request_ids)
+ for request in requests:
+ # type, id, timestamp, details, allowed -- MISSING: authority_hrn
+ # CAREFUL about details
+ # user : first name, last name, email, password, keypair
+ # slice : number of nodes, type of nodes, purpose
+
+ request_status = {}
+
+ if request['type'] == 'user':
+
+ try:
+ create_user(wsgi_request, request)
+ request_status['SFA user'] = {'status': True }
+
+ except Exception, e:
+ request_status['SFA user'] = {'status': False, 'description': str(e)}
+
+# user_params = {'status':2}
+# manifold_update_user(request, request['email'], user_params)
+
+ # MANIFOLD user should be added beforehand, during registration
+ #try:
+ # manifold_user_params = { key: request[key] for key in MANIFOLD_USER_KEYS }
+ # # XXX # manifold_add_user(manifold_user_params)
+ # request_status['MySlice user'] = {'status': True }
+ #except Exception, e:
+ # request_status['MySlice user'] = {'status': False, 'description': str(e)}
+
+ # XXX
+ #manifold_account_params = { key: request[key] for key in MANIFOLD_ACCOUNT_KEYS }
+ #manifold_add_account(manifold_account_params)
+ #request_status['MySlice testbed accounts'] = {'status': False }
+
+ elif request['type'] == 'slice':
+ try:
+ create_slice(wsgi_request, request)
+ request_status['SFA slice'] = {'status': True }
+
+ except Exception, e:
+ request_status['SFA slice'] = {'status': False, 'description': str(e)}
+
+ elif request['type'] == 'authority':
+ try:
+ #hrn = "%s.%s" % (request['authority_hrn'], request['site_authority'])
+ hrn = request['site_authority']
+ # XXX tmp sfa dependency
+ from sfa.util.xrn import Xrn
+ urn = Xrn(hrn, request['type']).get_urn()
+
+ sfa_authority_params = {
+ 'hrn' : hrn,
+ 'urn' : urn,
+ 'type' : request['type'],
+ #'pi' : None,
+ 'enabled' : True
+ }
+ print "ADD Authority"
+ sfa_add_authority(wsgi_request, sfa_authority_params)
+ request_status['SFA authority'] = {'status': True }
+
+ except Exception, e:
+ request_status['SFA authority'] = {'status': False, 'description': str(e)}
+
+ # XXX Remove from Pendings in database
+
+ status['%s__%s' % (request['type'], request['id'])] = request_status
+
+ return status
+
+
+def validate_action(request, **kwargs):
+ ids = filter(None, kwargs['id'].split('/'))
+ status = portal_validate_request(request, ids)
+ json_answer = json.dumps(status)
+ return HttpResponse (json_answer, mimetype="application/json")
+
+# Django and ajax
+# http://djangosnippets.org/snippets/942/
+
+
+
+#-------------------------------------------------------------------------------
+# REQUESTS - Slices
+#-------------------------------------------------------------------------------
+
+def create_slice(wsgi_request, request):
+ """
+ Arguments:
+ wsgi_request (~ WSGIRequest) :
+ request (dict) : the slice request in our own dict format
+
+ Raises:
+ Exception
+ """
+ hrn = "%s.%s" % (request['authority_hrn'], request['slice_name'])
+ # XXX tmp sfa dependency
+ from sfa.util.xrn import Xrn
+ urn = Xrn(hrn, request['type']).get_urn()
+
+ # Add User to Slice if we have the user_hrn in pendingslice table
+ user_hrn = request.get('user_hrn', None)
+ user_hrns = list([user_hrn]) if user_hrn else list()
+
+ # XXX We should create a slice with Manifold terminology
+ slice_params = {
+ 'slice_hrn' : hrn,
+ 'slice_urn' : urn,
+ 'slice_type' : request['type'],
+ 'users' : user_hrns,
+ 'slice_enabled' : True
+ }
+ # ignored in request: id, timestamp, number_of_nodes, type_of_nodes, purpose
+
+ query = Query.create('slice').set(slice_params).select('slice_hrn')
+ results = execute_query(wsgi_request, query)
+ if not results:
+ raise Exception, "Could not create %s. Already exists ?" % slice_params['hrn']
+ return results
+
+def create_pending_slice(wsgi_request, request, email):
+ """
+ """
+
+ # Insert an entry in the PendingSlice table
+ s = PendingSlice(
+ slice_name = request['slice_name'],
+ user_hrn = request['user_hrn'],
+ authority_hrn = request['authority_hrn'],
+ number_of_nodes = request['number_of_nodes'],
+ purpose = request['purpose'],
+ )
+ s.save()
+
+ try:
+ # Send an email: the recipients are the PI of the authority
+ recipients = authority_get_pi_emails(wsgi_request, request['authority_hrn'])
+
+ theme.template_name = 'slice_request_email.txt'
+ text_content = render_to_string(theme.template, request)
+
+ theme.template_name = 'slice_request_email.html'
+ html_content = render_to_string(theme.template, request)
+
+ theme.template_name = 'slice_request_email_subject.txt'
+ subject = render_to_string(theme.template, request)
+ subject = subject.replace('\n', '')
+
+ sender = email
+ msg = EmailMultiAlternatives(subject, text_content, sender, [recipients])
+ print msg
+ msg.attach_alternative(html_content, "text/html")
+ msg.send()
+ except Exception, e:
+ print "Failed to send email, please check the mail templates and the SMTP configuration of your server"
+
+#-------------------------------------------------------------------------------
+# REQUESTS - Users
+#-------------------------------------------------------------------------------
+
+def manifold_add_reference_user_accounts(wsgi_request, request):
+ """When a new user is created, add reference accounts to the reference platform.
+ """
+ # XXX XXX XXX The rest of this function has to be checked XXX XXX XXX
+
+ # Retrieve user information
+ user_query = Query().get('local:user') \
+ .select('user_id', 'config', 'email', 'status') \
+ .filter_by('email', '==', request['email'])
+ user_details = execute_admin_query(wsgi_request, user_query)
+
+ # USER MAIN ACCOUNT != reference
+ #print 'USER MAIN ACCOUNT != reference'
+ list_accounts_query = Query().get('local:account') \
+ .select('user_id', 'platform_id', 'auth_type', 'config') \
+ .filter_by('user_id', '==', user_details[0]['user_id']) \
+ .filter_by('auth_type', '!=', 'reference')
+ list_accounts = execute_admin_query(wsgi_request, list_accounts_query)
+
+ # XXX main_platform is being erased several times ???
+ for account in list_accounts:
+ main_platform_query = Query().get('local:platform') \
+ .select('platform_id', 'platform') \
+ .filter_by('platform_id', '==', account['platform_id'])
+ main_platform = execute_admin_query(wsgi_request, main_platform_query)
+
+ # Add reference accounts on SFA enabled platforms
+ platforms_query = Query().get('local:platform') \
+ .filter_by('disabled', '==', '0') \
+ .filter_by('gateway_type', '==', 'sfa') \
+ .select('platform_id', 'gateway_type')
+ platforms = execute_admin_query(wsgi_request, platforms_query)
+ for platform in platforms:
+ #print "add reference to platform ",platform
+ manifold_account_params = {
+ 'user_id' : user_details[0]['user_id'],
+ 'platform_id' : platform['platform_id'],
+ 'auth_type' : 'reference',
+ 'config' : '{"reference_platform": "' + main_platform[0]['platform'] + '"}',
+ }
+ manifold_add_account(wsgi_request, manifold_account_params)
+
+def sfa_create_user(wsgi_request, request):
+ """
+ Arguments:
+ wsgi_request (~ WSGIRequest) :
+ request (dict) : the user request in our own dict format
+
+ Raises:
+ Exception
+ """
+ from sfa.util.xrn import Xrn
+
+ auth_pi = request.get('pi', None)
+ auth_pi = list([auth_pi]) if auth_pi else list()
+
+ # We create a user request with Manifold terminology
+ sfa_user_params = {
+ 'user_hrn' : request['user_hrn'],
+ 'user_email' : request['email'],
+ 'user_urn' : Xrn(request['user_hrn'], request['type']).get_urn(),
+ 'user_type' : request['type'],
+ 'keys' : request['public_key'],
+ 'user_first_name' : request['first_name'],
+ 'user_last_name' : request['last_name'],
+ 'pi_authorities' : auth_pi,
+ 'user_enabled' : True
+ }
+
+ query = Query.create('user').set(sfa_user_params).select('user_hrn')
+ results = execute_query(wsgi_request, query)
+ if not results:
+ raise Exception, "Could not create %s. Already exists ?" % sfa_user_params['user_hrn']
+ return results
+
+#def ldap_create_user
+
+def create_user(wsgi_request, request):
+
+ # XXX This has to be stored centrally
+ USER_STATUS_ENABLED = 2
+
+ # NOTE : if we were to create a user directly (just like we create slices,
+ # we would have to perform the steps in create_pending_user too
+
+ # Add the user to the SFA registry
+ sfa_create_user(wsgi_request, request)
+
+ # Update Manifold user status
+ manifold_update_user(wsgi_request, request['email'], {'status': USER_STATUS_ENABLED})
+
+ # Add reference accounts for platforms
+ manifold_add_reference_user_accounts(wsgi_request, request)
+
+def create_pending_user(wsgi_request, request, user_detail):
+ """
+ """
+
+ # Insert an entry in the PendingUser table
+ b = PendingUser(
+ first_name = request['first_name'],
+ last_name = request['last_name'],
+ authority_hrn = request['authority_hrn'],
+ email = request['email'],
+ password = request['password'],
+ public_key = request['public_key'],
+ private_key = request['private_key'],
+ user_hrn = request['user_hrn'],
+ pi = '', # XXX Why not None ?
+ )
+ b.save()
+
+ # saves the user to django auth_user table [needed for password reset]
+ user = User.objects.create_user(request['email'], request['email'], request['password'])
+
+ # Creating a manifold user
+ user_id = manifold_add_user(wsgi_request, request)
+
+ # Creating a Manifold account on the MySlice platform
+ # Note the JSON representation of public and private keys already includes quotes
+ account_config = {
+ 'user_hrn' : request['user_hrn'],
+ 'user_public_key' : request['public_key'],
+ }
+ if request['private_key']:
+ account_config['user_private_key'] = request['private_key']
+
+ user_id = user_detail['user_id'] + 1 # the user_id for the newly created user in local:user
+
+ # XXX TODO: Require a myslice platform
+ # ALERT: this will disapear with ROUTERV2 of Manifold
+ # We have to consider the case where several registries can be used
+ # Removed hardcoded platform = 5
+ # This platform == 'myslice' is a TMP FIX !!
+ try:
+ reg_platform_query = Query().get('local:platform') \
+ .filter_by('platform', '==', 'myslice') \
+ .select('platform_id')
+ reg_platform = execute_admin_query(wsgi_request, reg_platform_query)
+
+ registry_platform_id = reg_platform[0]['platform_id']
+ account_params = {
+ 'platform_id' : reg_platform_id, # XXX ALERT !!
+ 'user_id' : user_id,
+ 'auth_type' : request['auth_type'],
+ 'config' : json.dumps(account_config),
+ }
+ manifold_add_account(wsgi_request, account_params)
+ except Exception, e:
+ print "Failed creating manifold account on platform %s for user: %s" % ('myslice', request['email'])
+
+ try:
+ # Send an email: the recipients are the PI of the authority
+ # If No PI is defined for this Authority, send to a default email (different for each theme)
+ recipients = authority_get_pi_emails(wsgi_request, request['authority_hrn'])
+
+ theme.template_name = 'user_request_email.html'
+ html_content = render_to_string(theme.template, request)
+
+ theme.template_name = 'user_request_email.txt'
+ text_content = render_to_string(theme.template, request)
+
+ theme.template_name = 'user_request_email_subject.txt'
+ subject = render_to_string(theme.template, request)
+ subject = subject.replace('\n', '')
+
+ theme.template_name = 'email_default_sender.txt'
+ sender = render_to_string(theme.template, request)
+ sender = sender.replace('\n', '')
+
+ msg = EmailMultiAlternatives(subject, text_content, sender, [recipients])
+ msg.attach_alternative(html_content, "text/html")
+ msg.send()
+ except Exception, e:
+ print "Failed to send email, please check the mail templates and the SMTP configuration of your server"
--- /dev/null
+body {
+ background-color:white;
+ color:black;
+ margin:0;
+ padding:0;
+}
+a, a:active, a:focus {
+ outline: 0;
+}
+
+h1 {
+ border-bottom:1px solid #DDDDDD;
+ padding:0 0 5px 0;
+ margin:0 0 15px 0;
+ font-size:18pt;
+}
+h1 img {
+ vertical-align:middle;
+ margin-bottom:4px;
+}
+h2 {
+ font-size:14pt;
+ color:#333333;
+}
+h3 {
+ font-size:13pt;
+ color:#201E62;
+}
+div.wrapper {
+ width:980px;
+ margin:0 auto;
+ position:relative;
+}
+div.container {
+ width:80%;
+ margin:25px auto;
+}
+div.wide {
+ margin:25px auto;
+ padding:0 25px;
+}
+
+span.label {
+ font-size:11pt;
+ color:gray;
+ font-weight:normal;
+ padding:0;
+}
+/***** Notifications *****/
+.warning {
+ border: 1px solid red;
+ margin: 20px 60px;
+ padding: 10px 20px;
+ color: red;
+ background-color: #f2dbdb;
+ text-align: center;
+}
+/* HEADER */
+div#header {
+ height:100px;
+ background-color:white;
+}
+
+div#secondary {
+
+}
+
+div#secondary ul {
+ position:absolute;
+ top:20px;
+ right:0;
+}
+
+div#secondary li {
+ font-size:10pt;
+ float:left;
+ list-style:none;
+ margin-right:30px;
+}
+div#secondary li a {
+ color:black;
+}
+div#secondary li a:hover {
+ color:#270A5A;
+ text-decoration:none;
+}
+div#secondary li:last-child {
+ margin-right:0;
+}
+
+div#navigation {
+ background-color:rgb(30, 88, 111);
+ width:100%;
+ height:40px;
+}
+div#navigation div.wrapper {
+ text-align:center;
+}
+div#navigation ul {
+ margin:0;
+ padding:0;
+ display: inline-block;
+ list-style-type: none;
+ white-space: nowrap;
+}
+
+div#navigation li {
+ color:white;
+ font-family:helvetica, sans-serif;
+ font-size:10pt ;
+ font-weight:normal;
+ line-height:0.8em;
+ letter-spacing:0.6pt;
+ list-style:none;
+ float:left;
+ padding:0;
+ margin:15px 50px 0 0;
+}
+div#navigation li a {
+ color:white;
+}
+div#navigation li a:hover {
+ text-decoration:none;
+ color:#B8B2FF;
+}
+div#navigation li:last-child {
+ margin-right:0;
+}
+
+/* HOME DASHBOARD */
+div#home-dashboard {
+ color:black;
+ margin:0 auto 25px auto;
+}
+div#home-dashboard table {
+/* margin:25px; */
+ width:100% !important;
+}
+div#home-dashboard table td {
+ text-align:center;
+ padding:15px 0;
+ width:33%;
+}
+div#home-dashboard table tr:first-child td {
+ font-size:12pt;
+ font-weight:bold;
+ color:#270A5A;
+}
+div#home-dashboard table tr:last-child td {
+ vertical-align:top;
+ padding:25px 0;
+}
+div#home-dashboard table tr:last-child td.logged-in {
+ /* border-right:1px solid #DDDDDD; */
+ padding:25px;
+}
+div#home-dashboard table tr:last-child td.support {
+ /* border-left:1px solid #DDDDDD; */
+ padding:25px;
+}
+div#home-dashboard table tr:last-child td:first-child {
+}
+div#home-dashboard table tr:last-child td:last-child {
+ border-right:0;
+}
+div#home-dashboard table tr:last-child td.logged-in div {
+ text-align:left;
+ padding:25px 0;
+}
+div#home-dashboard table tr:last-child td.support div {
+ text-align:left;
+ padding:25px 0;
+}
+
+/* Edelberto */
+.bar1 {
+ width: 100%;
+ background: #FCFCFC;
+ border: 1px;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+}
+
+.well {
+ width: 350px !important;
+}
+
+#footer {
+ width: 100%;
+ float: left;
+ background-color: rgb(65, 119, 139);
+ height: 30px;
+ padding: 5px;
+ text-align: center;
+ color: white;
+}
+
+.logo {
+ padding-bottom: 5px;
+}
+
+/* Edelberto end */
+
+div#home-dashboard div.login-widget {
+ padding:20px;
+}
+div#home-dashboard table td.support {
+}
+div#home-dashboard table td.support a {
+}
+div#home-dashboard table td.support a:hover {
+ text-decoration:none;
+}
+
+div#home-dashboard div#manager {
+ display:none;
+}
+
+div#home-dashboard div#home-slice-list {
+ margin:25px 0;
+ padding:0 25px;
+ text-align:left;
+}
+div#home-dashboard div#home-slice-list ul {
+ list-style: none;
+ padding:0;
+ margin:0;
+}
+div#home-dashboard div#home-slice-list li {
+
+}
+
+.login-submit {
+ vertical-align:middle;
+ padding:0;
+}
+.lost-password {
+ font-size:10pt;
+ color:#CCCCCC;
+ text-align:right;
+ padding:0px;
+}
+.lost-password a {
+}
+.login-signup {
+ border-top:1px solid #CCCCCC;
+ text-align:center;
+ margin-top:15px;
+ padding:5px 0 0 0;
+}
+/**/
+
+/* NAV TABS */
+
+.nav.nav-tabs {
+ margin-bottom:25px;
+}
+
+.nav.nav-tabs li.active a {
+
+}
+
+.nav.nav-tabs li a {
+}
+
+.nav.nav-tabs li a:hover {
+}
+
+/**/
+/* WELL */
+div.well {
+}
+/**/
+/* BUTTON */
+.btn.btn-default {
+ font-weight: bold;
+}
+
+.btn.btn-default:hover {
+ font-weight: bold;
+}
+/**/
+/* TABLE */
+table.table {
+ margin:0;
+}
+table.table thead {
+ padding:0;
+}
+table.table tbody {
+ padding:0;
+}
+table.table tr {
+ padding:0;
+}
+table.table td {
+ padding:0;
+}
+/* INSTITUTION */
+div#institution {
+ color:black;
+}
+.form-hint {
+ font-size:11pt;
+ font-style:italic;
+ color:gray;
+}
+
+
+.form-hint {
+ font-size:11pt;
+ font-style:italic;
+ color:gray;
+}
+
+
+
+/* TICKET REQUEST */
+div#ticket-request {
+ color:black;
+}
+.form-hint {
+ font-size:11pt;
+ font-style:italic;
+ color:gray;
+}
+div#ticket-request p {
+ margin:20px 0;
+}
+
+/* SLICE VIEW */
+div#slice-view {
+ margin:0;
+}
+div.list-group-item {
+ border:0;
+ background-color:white;
+ font-weight:bold;
+ padding-left:0;
+}
+a.list-group-item {
+ border:0;
+ background-color:white;
+ padding:3px 0 3px 10px;
+ border-left:2pt white solid;
+}
+a.list-group-item.active, a.list-group-item:hover {
+ border-left:2pt blue solid;
+}
+a.list-group-item p.list-group-item-text {
+ font-size:9pt;
+ font-style:italic;
+}
+
+/* SLICE VIEW sections */
+.slice-sections, .slice-pending {
+ margin:0;
+ padding:0;
+}
+.slice-sections ul, .slice-pending ul {
+ margin:0;
+ padding:0;
+}
+.slice-pending ul {
+ width:400px;
+ margin:0 auto 15px auto;
+}
+.slice-sections li {
+ text-align:left;
+ margin:0;
+ padding:0;
+}
+.slice-pending li {
+ padding-right:15px;
+}
+.slice-sections li a, .slice-pending li a {
+ font-size:14px;
+ color:black;
+ padding:0;
+}
+.slice-sections li.active a, .slice-pending li.active a {
+ color:#201E62;
+ background-color:#EFEFEF;
+ text-decoration:underline;
+ padding:0;
+}
+.slice-sections ul.nav-pills li a:hover, .slice-pending ul.nav-pills li a:hover {
+ text-decoration:underline;
+ background-color:#EFEFEF;
+ color:black;
+}
+.slice-sections ul.nav-pills li.active, .slice-pending ul.nav-pills li.active {
+
+}
+.slice-sections li:first-child, .slice-sections li:first-child a {
+ color:#201E62;
+ font-weight:bold;
+}
+.slice-experiment {
+ text-align:right;
+ padding:0;
+}
+.slice-experiment button {
+ margin:3px 0 0 0;
+ background-color:#CC4125;
+ color:white;
+}
+
+.slice-pending {
+}
+.slice-pending button {
+ font-size:9pt;
+ margin:-2px 0 0 0;
+ padding:3px 5px;
+}
+.slice-pending button.apply {
+}
+.slice-pending button.clear {
+}
--- /dev/null
+/* @override unfold/static/css/plugin.css */
+
+/*-------------------------------- MARKO'S STYLES -----*/
+
+/* GENERAL */
+
+a, a:visited {
+ color: rgb(13, 187, 255) !important;
+ text-decoration: none !important;
+}
+
+a:hover {
+ color: blue !important;
+ text-decoration: none !important;
+}
+
+.container {
+ /*padding: 0 !important;*/
+ padding-top: 60px !important;
+ color: #fff;
+/* background: url(http://new.fit-equipex.fr/images/background.jpg) no-repeat; */
+ background-color: rgb(237, 241, 243);
+ margin: 0;
+ width: 100%;
+ max-width: 100%;
+ min-height: 100%;
+ height: 100%;
+}
+
+.container h1, .container h2 {
+ color: #fff !important;
+}
+
+.navbar-brand {
+ padding: 5px !important;
+}
+
+.nav {
+ padding-top: 30px !important;
+ padding-left: 20px !important;
+}
+
+.navbar-default {
+ background-color: #fff !important;
+}
+
+p.login-status {
+ color: blue !important;
+}
+
+div.plugin-outline-complete,
+div.plugin-outline-body {
+ border: 0px solid;
+ border-radius: 0;
+ border-color: #ccc;
+ -webkit-transition: padding 200ms ease-out;
+ -moz-transition: padding 200ms ease-out;
+ -o-transition: padding 200ms ease-out;
+ transition: padding 0.2s ease-out;
+ padding: 20px;
+ margin: 0;
+}
+/*
+div.plugin-outline-complete:hover,
+div.plugin-outline-body:hover {
+ padding: 80px 80px 120px 80px;
+}
+*/
+a.plugin-tooltip {
+ font-size: 130%;
+ font-style: normal;
+ font-weight: bold;
+ padding: 5px;
+ color: #333;
+ font-family: Ubuntu, Arial, sans-serif;
+ text-transform: uppercase;
+}
+
+a.plugin-tooltip:hover {
+ color: #fff;
+ text-decoration: none;
+}
+
+
+
+/* LIST VIEW */
+div.well-lg {
+ background-color: rgba(168, 32, 202, 0.5) !important;
+}
+div.onelab-title {
+ background-color: #3A5FCD !important;
+ /*background-color: rgba(168, 32, 202, 0.5) !important;*/
+}
+div.well {
+ /*background-color: rgba(0, 0, 0, 0.5) !important;*/
+ background-color: #fff !important;
+ color: rgb(37, 37, 37) !important;
+}
+h2.well.well-lg {
+ border-radius:0;
+ border: 0;
+ font-family: Ubuntu, arial, sans-serif;
+ /* text-transform: ; */
+ font-weight: normal;
+ font-size: 40px;
+ /* color: #30196d; */
+ color: white;
+ margin-bottom: 0px;
+ margin-top: 0;
+ padding: 40px;
+ opacity: 1;
+ text-align: center;
+ background-color: #30196d;
+}
+
+#complete-resources {
+/* background-color: #92f79e !important; */
+ background-color: #B8B2FF !important;
+}
+
+#complete-filters {
+/* background-color: #4af25d; */
+ background-color: #add7ff;
+}
+
+#complete-users {
+/* background-color: #ff7394 !important; */
+ background-color: #add7ff !important;
+}
+/*
+#complete-measurements {
+ background-color: !important;
+}
+*/
+#complete-pending {
+/* background-color: #add7ff !important; */
+ background-color: #B8B2FF !important;
+
+}
+
+#complete-customize-resources {
+ background-color: #efdfdf;
+}
+
+#complete-msgs-pre {
+ background-color: #ccc;
+}
+
+#complete-resources,
+#complete-filters,
+#complete-users,
+#complete-measurements,
+#complete-pending,
+#complete-customize-resources,
+#complete-msgs-pre {
+ opacity: 1;
+ text-align: center;
+ color: #333;
+}
+
+#complete-resources:hover,
+#complete-filters:hover,
+#complete-users:hover,
+#complete-measurements:hover,
+#complete-pending:hover,
+#complete-customize-resources:hover,
+#complete-msgs-pre:hover {
+ opacity: 1;
+}
+
+.nav.nav-tabs {
+ font-family: Ubuntu, Arial, sans-serif;
+ border: 0 !important;
+ border-bottom: 3px solid #fff !important;
+ margin-bottom: 40px;
+}
+
+.nav.nav-tabs li.active a {
+ color: #572bc9;
+ border-left: 0px solid #572bc9;
+ border-top: 0px solid #572bc9;
+ border-right: 0px solid #572bc9;
+}
+
+.nav.nav-tabs li a {
+ color: #333;
+ border: 0 !important;
+ margin-right: 5px;
+}
+
+.nav.nav-tabs li a:hover {
+ color: #333;
+ background: #572bc9;
+ color: #fff;
+ border: 0 !important;
+}
+
+
+
+/* if window enlarged wider than background picture */
+body {
+ background: rgb(237, 241, 243) !important;
+ /*background: black !important;*/
+}
+
+/* TOPMENU.CSS */
+
+/* Thierry : turning this off
+body {
+ *//* background: #30196d !important; *//*
+ background: black !important;
+ padding-top: 60px;
+ padding-bottom: 0px;
+}
+Thierry */
+
+/* Thierry : turning this off
+div.topmenu {
+ padding-top: 0px;
+ font-family: Ubuntu, Arial, sans-serif;
+ font-weight: bold;
+ background: #fff;
+ -webkit-box-shadow: 0px 10px 10px rgba(50, 50, 50, 0.44);
+ -moz-box-shadow: 0px 10px 10px rgba(50, 50, 50, 0.44);
+ box-shadow: 0px 10px 10px rgba(50, 50, 50, 0.44);
+}
+Thierry */
+
+/* Thierry : turning this off
+.navbar-nav li a,
+.navbar-nav li.other a {
+ padding-top: 25px;
+ padding-bottom: 20px;
+}
+Thierry */
+
+.navbar-nav li a:hover {
+ color: #572bc9 !important;
+}
+
+.navbar-nav li.active a {
+ background: #eee !important;
+}
+
+/* Thierry : turning this off
+ul.logged-in {
+ padding-top: 25px;
+}
+Thierry */
+button.logged-in {
+ font-size: 1em;
+ font-weight: bold;
+ margin-left: 5px;
+ margin-top: -5px;
+ background: #572bc9;
+ border: 2px solid #572bc9;
+ color: #eee;
+ padding: 5px 15px;
+ border-radius:5px;
+}
+
+button.logged-in:hover {
+ /* background: #4af25d; */
+ background: #ff7394;
+ border: 2px solid #ff7394;
+ color: #333;
+}
+li.username {
+ margin-bottom: 10px;
+ font-size: 0.8em;
+ text-transform: none;
+ font-weight: normal;
+ color: #999;
+}
+
+
+/* BOOTSTRAP */
+
+
+ul.pagination li a {
+ /* background: ; */
+ color: #572bc9;
+ font-family: Ubuntu, Arial, sans-serif;
+}
+
+ul.pagination li.active a {
+ background: #572bc9;
+ border: 1px solid #572bc9;
+}
+
+.btn.btn-default {
+ background: #572bc9;
+ color: #ccc;
+ font-family: Ubuntu, Arial, sans-serif;
+ font-weight: bold;
+ border: 0px;
+}
+
+.btn.btn-default:hover {
+ /* background: #4af25d; */
+ background: #ff7394;
+ color: #333;
+ font-family: Ubuntu, Arial, sans-serif;
+ font-weight: bold;
+ border: 0px;
+}
+
+input {
+ border-radius: 3px;
+ border: none;
+ border: 1px solid #ccc;
+}
+
+
+div.dataTables_length label,
+div.dataTables_filter label,
+div.dataTables_info {
+ font-family: Ubuntu, Arial, sans-serif !important;
+}
+
+
+
+
+/* QUERYTABLE */
+
+div.QueryTable table.dataTable th {
+ font: bold 12px/22px Ubuntu, Arial, sans-serif;
+ color: #333 !important;
+ border-right: 0px solid #333 !important;
+ border-bottom: 0px solid #C1DAD7 !important;
+ border-top: 0px solid #C1DAD7 !important;
+ letter-spacing: 1px;
+ text-transform: uppercase;
+ text-align: left;
+ padding: 8px 12px 4px 20px;
+ vertical-align:middle;
+ background: url('../img/tablesort-header.png') no-repeat !important;
+}
+
+div.QueryTable table.dataTable td, div.QueryTable table.dataTable textarea, div.QueryTable table.dataTable input [type="text"] {
+ font: normal 12px Ubuntu, Arial, Helvetica, sans-serif;
+ border-right: 0px solid #fff !important;
+ border-bottom: 1px solid #fff !important;
+}
+
+div.QueryTable table.dataTable thead {
+ background: url('../img/tablesort-header.png') repeat-x !important;
+ background-color: #caebea;
+}
+
+div.QueryTable table.dataTable tfoot {
+ background: url('../img/tablesort-header.png') repeat-x !important;
+ /* background-color: # !important; */
+}
+
+
+/* QUERY EDITOR */
+
+table.query-editor {
+ margin: 40px auto !important;
+ clear: both;
+ /* width: 80%;*/
+ width: 100% !important;
+ font-family: Ubuntu;
+}
+
+.query-editor-spacer,
+.plugin.QueryUpdater,
+/* Thierry : turning this off
+.plugin.Tabs
+Thierry */
+{
+ margin-top: 60px !important;
+}
+
+table.query-editor td {
+ padding: 5px 5px !important;
+ font: normal 12px Ubuntu, Arial, sans-serif !important;
+}
+
+
+
+/* DASHBOARD */
+
+#ms-dashboard-profile,
+#ms-dashboard-testbeds,
+#ms-dashboard-slices {
+ -webkit-transition: all 50ms ease-out;
+ -moz-transition: all 50ms ease-out;
+ -o-transition: all 50ms ease-out;
+ transition: all 0.05s ease-out;
+ padding-top: 140px;
+ padding-bottom: 60px;
+ margin-top: 60px;
+ color: #fff;
+ font-family: Ubuntu, Arial, sans-serif;
+ text-align: center;
+
+}
+
+#ms-dashboard-profile:hover,
+#ms-dashboard-testbeds:hover,
+#ms-dashboard-slices:hover {
+ margin-top: 65px;
+}
+
+#ms-dashboard-profile {
+ background: url("../img/icon_users_color.png") top center no-repeat;
+}
+
+#ms-dashboard-testbeds {
+ background: url("../img/icon_testbed_color.png") top center no-repeat;
+}
+
+#ms-dashboard-slices {
+ background: url("../img/icon_slices_color.png") top center no-repeat;
+}
+
+.ms-dashboard-content ul {
+ list-style-type: none !important;
+ padding-left: 0;
+ text-align: center !important;
+}
+
+.ms-dashboard-content {
+ padding: 0 !important;
+}
+
+.ms-dashboard-content a {
+ color: #ff7394 !important;
+/* color: #ff0099 !important; */
+}
+
+.ms-dashboard-content a:hover {
+ color: white !important;
+}
+.ms-dashboard-caption h2 {
+ font-family: Ubuntu, Arial, sans-serif;
+ border-bottom: 0 !important;
+ text-transform: uppercase;
+}
+
+#ms-dashboard-profile>div.ms-dashboard-caption {
+ background: no-repeat url(#) !important;
+ padding-left: 0 !important;
+}
+
+#ms-dashboard-testbeds>div.ms-dashboard-caption {
+ background: no-repeat url(#) !important;
+ padding-left: 0 !important;
+}
+
+#ms-dashboard-slices>div.ms-dashboard-caption {
+ background: no-repeat url(#) !important;
+ padding-left: 0 !important;
+}
+
--- /dev/null
+<div class="well">
+ {% if state %}
+ <span class="help-block">{{ state }}</span>
+ {% endif %}
+ <form action="/login/" method="post" role="form">
+ {% csrf_token %}
+ {% if next %}
+ <input type="hidden" name="next" value="{{ next }}" />
+ {% endif %}
+ <div class="form-group">
+ <label for="username">Email address / Username</label>
+ <input type="email" class="form-control" name="username" placeholder="Enter Email / username">
+ </div>
+ <div class="form-group">
+ <label for="password">Password</label>
+ <input type="password" class="form-control" name="password" placeholder="Password">
+ </div>
+ <div class="login-submit">
+ <input class="btn btn-default" type="submit" value="Sign In" />
+ <span class="lost-password"> | <a href="/portal/pass_reset/">Can't access your account?</a></span>
+ </div>
+ <div class="login-signup">
+ <a href="/portal/register">Try</a>, <a href="/portal/register">Sign Up</a> or <a href="/portal/join">Join</a>
+ </div>
+ </form>
+</div>
--- /dev/null
+<div class="well login-widget">
+ {% if state %}
+ <span class="help-block">{{ state }}</span>
+ {% endif %}
+ <form action="/login/" method="post" role="form">
+ {% csrf_token %}
+ {% if next %}
+ <input type="hidden" name="next" value="{{ next }}" />
+ {% endif %}
+ <div class="form-group">
+ <label for="usernameldap">LDAP User</label>
+ <input type="email" class="form-control" name="usernameldap" placeholder="LDAP user">
+ </div>
+ <div class="form-group">
+ <label for="password">Password</label>
+ <input type="password" class="form-control" name="password" placeholder="Password">
+ </div>
+ <div class="login-submit">
+ <input class="btn btn-default" type="submit" value="Sign In" />
+ <span class="lost-password"> | <a href="/portal/pass_reset/">Can't access your account?</a></span>
+ </div>
+ <div class="login-signup">
+ <a href="/portal/register">Try</a> or <a href="/portal/register">Sign Up</a>
+ </div>
+ </form>
+</div>
--- /dev/null
+<div class="well">
+ {% if state %}
+ <span class="help-block">{{ state }}</span>
+ {% endif %}
+ <form action="/login/" method="post" role="form">
+ {% csrf_token %}
+ {% if next %}
+ <input type="hidden" name="next" value="{{ next }}" />
+ {% endif %}
+ <div class="form-group">
+ <label for="username">Email address / Username</label>
+ <input type="email" class="form-control" name="username" placeholder="Enter Email / username">
+ </div>
+ <div class="form-group">
+ <label for="password">Password</label>
+ <input type="password" class="form-control" name="password" placeholder="Password">
+ </div>
+ <div class="login-submit">
+ <input class="btn btn-default" type="submit" value="Sign In" />
+ <span class="lost-password"> | <a href="/portal/pass_reset/">Can't access your account?</a></span>
+ </div>
+ <div class="login-signup">
+ <a href="/portal/register">Try</a>, <a href="/portal/register">Sign Up</a> or <a href="/portal/join">Join</a>
+ </div>
+ </form>
+</div>
--- /dev/null
+<div class="well login-widget">
+ {% if state %}
+ <span class="help-block">{{ state }}</span>
+ {% endif %}
+ <form action="/login/" method="post" role="form">
+ {% csrf_token %}
+ {% if next %}
+ <input type="hidden" name="next" value="{{ next }}" />
+ {% endif %}
+ <div class="form-group">
+ <label for="username">Email address / Username</label>
+ <input type="email" class="form-control" name="username" placeholder="Enter Email / username">
+ </div>
+ <div class="form-group">
+ <label for="password">Password</label>
+ <input type="password" class="form-control" name="password" placeholder="Password">
+ </div>
+ <div class="login-submit">
+ <input class="btn btn-default" type="submit" value="Sign In" />
+ <span class="lost-password"> | <a href="/portal/pass_reset/">Can't access your account?</a></span>
+ </div>
+ <div class="login-signup">
+ <a href="/portal/register">Try</a> or <a href="/portal/register">Sign Up</a>
+ </div>
+ </form>
+</div>
--- /dev/null
+{% insert_str prelude "js/bootstrap.js" %}
+{% insert_str prelude "css/bootstrap.css" %}
+{% insert_str prelude "css/topmenu.css" %}
+{% insert_str prelude "js/logout.js" %}
+<div id="header">
+ <div class="wrapper">
+ <div class="logo">
+ <a href="/"><img width="145px" height="75px" src="{{ STATIC_URL }}img/fibre-logo.gif" alt=FIBRE" /></a>
+ </div>
+
+ <div id="secondary">
+ <ul>
+ <li>News</li>
+ <li><a href="/portal/about">About</a></li>
+ <li><a target="_blank" href="http://www.fibre-ict.eu">Public Website</a></li>
+ <li><a target="_blank" href="http://intranet.fibre-ict.eu">Intranet</a></li>
+ </ul>
+ </div>
+ </div>
+
+ {% if username %}
+ <div id="navigation">
+ <div class="wrapper">
+ <ul>
+ <li>SLICES</li>
+ <li><a href="/portal/validate">REQUESTS</a></li>
+ <li><a href="/portal/institution">INSTITUTION</a></li>
+ <li><a href="/portal/support/">SUPPORT</a></li>
+ <li>|</li>
+ <li><a href="/portal/account/">{{ username }}</a></li>
+ <li><a id="logout" style="cursor:pointer;" data-username="{{ username }}">LOGOUT</a></li>
+ </ul>
+ </div>
+ </div>
+ {% else %}
+ <div id="navigation">
+ <div class="wrapper"></div>
+ </div>
+ {% endif %}
+</div>
+<script>
+ $(document).ready(function() {
+ // var slices = localStorage.getItem('slices');
+ // if (slices.length == 0) {
+ // $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
+ // var items = [];
+ // localStorage.setItem('slices', data[0].slice);
+ // });
+ // }
+ // $.each(slices, function( key, val ) {
+ // items.push( "<li><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
+ // });
+ // $("div#home-slice-list").html($( "<ul/>", { html: items.join( "" ) }));
+ });
+</script>
--- /dev/null
+{# This is required by insert_above #}{% insert_handler %}<!DOCTYPE html>
+<html lang="en"><head>
+<title>FIBRE - {{ section }}</title>
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<link rel="shortcut icon" href="/static/img/myslice-icon.png">
+{# This is where insert_str will end up #}{% media_container prelude %}
+{% include 'messages-transient-header.html' %}
+<script type="text/javascript"> {# raw js code - use {% insert prelude_js %} ... {% endinsert %} #} {% container prelude_js %}</script>
+<script src="{{ STATIC_URL }}js/jquery.dataTables.min.js"></script>
+<script src="{{ STATIC_URL }}js/bootstrap.datatables.js"></script>
+<script src="{{ STATIC_URL }}js/myslice-ui.js"></script>
+<style type="text/css">{# In case we need to add raw css code #}{% container prelude_css %}</style>
+{{ header_prelude }}
+{% block head %} {% endblock head %}
+{# let's add these ones no matter what #}
+{% insert_str prelude "js/jquery.min.js" %}
+{% insert_str prelude "js/jquery.html5storage.min.js" %}
+{% insert_str prelude "js/messages-runtime.js" %}
+{% insert_str prelude "js/class.js" %}
+{% insert_str prelude "js/plugin-helper.js" %}
+{% insert_str prelude "js/mustache.js" %}
+{% insert_str prelude "js/plugin.js" %}
+{% insert_str prelude "js/manifold.js" %}
+{% insert_str prelude "css/manifold.css" %}
+{% insert_str prelude "css/plugin.css" %}
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/{{ theme }}.css">
+</head>
+<body>
+{% block container %}
+ {% block topmenu %}
+ {% include theme|add:"__widget-topmenu.html" %}
+ {% endblock topmenu %}
+ {% include 'messages-transient.html' %}
+ {% block base_content %}
+ {% endblock %}
+{% endblock container %}
+</body>
+</html>
--- /dev/null
+{% extends "layout.html" %}
+
+{% block content %}
+<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>
+ <li><a class="home-tab" data-panel="manager" href="#">MANAGER</a></li>
+ </ul>
+ <div class="home-panel" id="user">
+ <table>
+ <tr>
+ <td>ACCOUNT</td>
+ <td>SLICES</td>
+ <td>SUPPORT</td>
+ </tr>
+ <tr>
+ <td><a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a></td>
+ <td><a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a></td>
+ <td><a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a></td>
+ </tr>
+ <tr>
+ {% if person %}
+ <td class="logged-in">
+ <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
+ <div>
+ {% if person.last_name %}
+ {{person.first_name}} {{person.last_name}}<br />
+ {% endif %}
+ <span class="label">Email:</span> <a href='/portal/account/'>{{person.email}}</a>
+ </div>
+ {% else %}
+ <td>
+ {% include 'fibre__widget-login-user.html' %}
+ {% include 'fibre__widget-login-ldap-user.html' %}
+ {% endif %}
+ </td>
+ <td>
+ {% if person %}
+ <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request a Slice</button>
+ <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
+ {% else %}
+ {% endif %}
+ </td>
+ <td class="support">
+ <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
+ <div>
+ <a href="/portal/contact">Contact</a> <br />
+ <a href="/portal/support/documentation">Documentation</a>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="home-panel" id="manager">
+ <table>
+ <tr>
+ <td>INSTITUTION</td>
+ <td>SLICES</td>
+ <td>REQUESTS</td>
+ </tr>
+ <tr>
+ <td><a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a></td>
+ <td><a href="/portal/institution#slices"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a></td>
+ <td><a href="/portal/validate"><img src="{{ STATIC_URL }}img/icon_testbed_color.png" alt="" /></a></td>
+ </tr>
+ </table>
+ <table>
+ <tr class="bar1">
+ {% if person %}
+ <td class="logged-in">
+ <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
+ {% else %}
+ <td>
+ {% include 'fibre__widget-login-manager.html' %}
+ {% include 'fibre__widget-login-ldap-manager.html' %}
+ {% endif %}
+ </td>
+ <td>
+ {% if person %}
+ <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create a Slice</button>
+ {% endif %}
+ </td>
+ <td class="support">
+ {% if person %}
+ <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
+ {% endif %}
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
+<div id="footer">
+ FIBRE - Future Internet testbeds / experimentation between BRazil and Europe
+</div>
+<script>
+ $(document).ready(function() {
+ $('a.home-tab').click(function() {
+ $('ul.nav-tabs li').removeClass('active');
+ $(this).parent().addClass('active');
+ $('div.home-panel').hide();
+ $('div#'+$(this).data('panel')).show();
+ });
+ $('button#validaterequestbtn').click(function() {
+ window.location="/portal/validate/";
+ });
+ $('button#ticketbtn').click(function() {
+ window.location="/portal/contact/";
+ });
+ $('button#slicerequestbtn').click(function() {
+ window.location="/portal/slice_request/";
+ });
+
+ {% if person %}
+ $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
+ var items = [];
+ $.each( data[0].slices, function(i, val) {
+ items.push( "<li><a href=\"/slice/"+val+"\">" + val + "</a></li>" );
+ });
+
+ $("div#home-slice-list").html($( "<ul/>", { html: items.join( "" ) }));
+
+ });
+ {% endif %}
+ });
+</script>
+{% endblock %}
--- /dev/null
+{% extends "layout_wide.html" %}
+
+{% block head %}
+<script src="{{ STATIC_URL }}js/onelab_slice-resource-view.js"></script>
+{% endblock %}
+
+{% block content %}
+ <div class="col-md-2">
+ <div id="select-platform" class="list-group">
+ </div>
+
+ <ul class="list-group">
+ <li class="list-group-item">Filter: CPU</li>
+ <li class="list-group-item">Filter: Interface</li>
+ <li class="list-group-item">...</li>
+ <li class="list-group-item">...</li>
+ <li class="list-group-item">...</li>
+ </ul>
+
+ </div>
+ <div class="col-md-10">
+ <div class="row">
+ {% include theme|add:"_widget-slice-sections.html" %}
+ </div>
+ <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">42</span></a></li>
+ <li>
+ <button type="button" class="btn btn-primary apply">Apply</button>
+ <button type="button" class="btn btn-default clear">Clear</button>
+ </li>
+ </ul>
+ </div>
+ <div class="row">
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#">Resources</a></li>
+ <li><a href="#"></a></li>
+ <li><a href="#"></a></li>
+ </ul>
+ </div>
+ <table cellpadding="0" cellspacing="0" border="0" class="table" id="objectList"></table>
+ </div>
+{% endblock %}
\ No newline at end of file
--- /dev/null
+{% extends "layout_wide.html" %}
+
+
+{% block content %}
+ <div class="col-md-2">
+ <div id="select-platform" class="list-group">
+ </div>
+
+ <ul class="list-group">
+ <li class="list-group-item">Filter: authority</li>
+ <li class="list-group-item">Filter: slice</li>
+ <li class="list-group-item">...</li>
+ <li class="list-group-item">...</li>
+ <li class="list-group-item">...</li>
+ </ul>
+
+ </div>
+ <div class="col-md-10">
+ <div class="row">
+ {% include theme|add:"_widget-slice-sections.html" %}
+ </div>
+ <div class="row slice-pending">
+ <ul class="nav nav-pills">
+ <li><a href="">All users</a></li>
+ <li><a href="">Users in Slice</a></li>
+ <li><a href="">Pending<span class="badge">42</span></a></li>
+ <li>
+ <button type="button" class="btn btn-primary apply">Apply</button>
+ <button type="button" class="btn btn-default clear">Clear</button>
+ </li>
+ </ul>
+ </div>
+ <div class="row">
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#">Users</a></li>
+ <li><a href="#"></a></li>
+ <li><a href="#"></a></li>
+ </ul>
+ </div>
+ <div id="user-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Useres" /></div>
+ <div id="user-tab-loaded" style="display:none;">
+ <table id="user-tab">
+ <tr>
+ <th>+/-</th>
+ <th>Email</th>
+ <th>user_hrn</th>
+ <th>Enabled</th>
+ </tr>
+ </table>
+ </div>
+<script>
+ $(document).ready(function() {
+ $.post("/rest/user/",{'filters':{'parent_authority':'ple.upmc'}}, function( data ) {
+ var list_users = [];
+ var table_users = [];
+ /*
+ "enabled", "keys", "parent_authority", "user_first_name", "user_last_name", "user_phone", "user_hrn", "slice", "user_email"
+ */
+ $.each( data, function( key, val ) {
+ list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
+ user_row = "<tr>";
+ // checking the box for the users that belong to the selected slice
+ var flag_checkbox = 0;
+ for(var data in val.slice) {
+ var element = val.slice[data];
+ console.log("element");
+ console.log(element);
+ for(var key in element) {
+ var value = element[key];
+ if (value == 'ple.upmc.myslicedemo'){
+ console.log("found!!");
+ flag_checkbox = 1;
+ user_row += "<td><input type='checkbox' checked='True'></td>";
+ }
+
+ }
+ }
+ if(flag_checkbox != 1){
+ user_row += "<td><input type='checkbox'></td>";
+ }
+ user_row += "<td>"+val.user_email+"</td>";
+ user_row += "<td>"+val.user_hrn+"</td>";
+ user_row += "<td>"+val.enabled+"</td>";
+ user_row += "</tr>";
+ table_users.push(user_row);
+
+ });
+ $("table#user-tab tr:last").after(table_users.join( "" ));
+ $("div#user-tab-loaded").css("display","block");
+ $("div#user-tab-loading").css("display","none");
+ });
+ });
+</script>
+
+{% endblock %}
--- /dev/null
+{% extends "layout_wide.html" %}
+
+{% block content %}
+ <div class="col-md-2"></div>
+ <div class="col-md-10">
+ <div class="row">
+ {% include theme|add:"_widget-slice-sections.html" %}
+ </div>
+ </div>
+
+ <div class="col-md-2"></div>
+ <div class="col-md-10">
+ <br>
+ <br>
+ <div id="slice-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
+ <div id="slice-tab-loaded" style="display:none;">
+ <table id="slice-tab">
+ </table>
+ </div>
+ </div>
+
+<script>
+ $(document).ready(function() {
+ $.post("/rest/slice/",{'filters':{'slice_hrn':'{{slice}}'}}, function( data ) {
+ var table_slices = [];
+ /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "user", "slice_urn", "slice_expires" */
+ $.each( data, function( key, val ) {
+ if(val.nodes=="undefined" || val.nodes==null){
+ nodes_length=0;
+ }else{
+ nodes_length=val.nodes.length;
+ }
+
+ if(val.user=="undefined" || val.user==null){
+ user_length=0;
+ }else{
+ user_length=val.user.length;
+ }
+
+ if(val.slice_url=="undefined" || val.slice_url==null){
+ slice_url="";
+ }else{
+ slice_url="<a href='"+val.slice_url+"' target='_blank'>"+val.slice_url+"</a>";
+ }
+
+ slice_row = "<tr><td><b>Description:</b></td><td>"+val.slice_description+"</td></tr>";
+ slice_row += "<tr><td><b>url:</b></td><td><a href='"+val.slice_url+" target='_blank'>"+val.slice_url+"</a></td></tr>";
+ slice_row += "<tr><td><b>users:</b></td><td>"+user_length+"</td></tr>";
+ slice_row += "<tr><td><b>resources:</b></td><td>"+nodes_length+"</td></tr>";
+ slice_row += "<tr><td><b>created:</b></td><td>"+val.created+"</td></tr>";
+ slice_row += "<tr><td><b>last update:</b></td><td>"+val.last_updated+"</td></tr>";
+ slice_row += "<tr><td><b>expires:</b></td><td>"+val.slice_expires+"</td></tr>";
+ table_slices.push(slice_row);
+ });
+ $("table#slice-tab").html(table_slices.join( "" ));
+ $("div#slice-tab-loaded").css("display","block");
+ $("div#slice-tab-loading").css("display","none");
+ });
+ });
+</script>
+{% endblock %}
--- /dev/null
+{% extends "layout_wide.html" %}
+
+{% block content %}
+ <div class="col-md-2"></div>
+ <div class="col-md-10">
+ <div class="row">
+ {% include theme|add:"_widget-slice-sections.html" %}
+ </div>
+ <div class="row">
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#">Testbeds</a></li>
+ <li><a href="#"></a></li>
+ <li><a href="#"></a></li>
+ </ul>
+ </div>
+ <table cellpadding="0" cellspacing="0" border="0" class="table" id="testbedList"></table>
+ </div>
+{% endblock %}
\ No newline at end of file
--- /dev/null
+<div class="col-md-8 slice-sections">
+ <ul class="nav nav-pills nav-justified">
+ <li {% if section == 'slice' %}class="active"{% endif %}><a href="/slice/{{ slice }}/">{{ slice }}</a></li>
+ <li {% if section == 'testbeds' %}class="active"{% endif %}><a href="/testbeds/{{ slice }}/">Testbeds</a></li>
+ <li {% if section == 'resources' %}class="active"{% endif %}><a href="/resources/{{ slice }}/">Resources</a></li>
+ <li {% if section == 'users' %}class="active"{% endif %}><a href="/users/{{ slice }}/">Users</a></li>
+ <li><a href="">Statistics</a></li>
+ <li><a href="">Measurements</a></li>
+ </ul>
+</div>
+<div class="col-md-4 slice-experiment">
+ <a href="/portal/experiment"><button type="button" class="btn btn-default">Experiment</button></a>
+</div>