From: Ciro Scognamiglio Date: Tue, 27 Jan 2015 17:43:26 +0000 (+0100) Subject: Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab X-Git-Tag: myslice-1.3~98 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=5c6d3dfae3a4aed1a18a9f1a946655631328351d;hp=-c;p=myslice.git Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab Conflicts: portal/actions.py portal/static/js/myslice.js --- 5c6d3dfae3a4aed1a18a9f1a946655631328351d diff --combined .settings/org.eclipse.core.resources.prefs index f73c991a,f73c991a..dad90097 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@@ -2,7 -2,7 +2,10 @@@ eclipse.preferences.version= encoding//portal/django_passresetview.py=utf-8 encoding//portal/forms.py=utf-8 encoding//portal/migrations/0002_extend_slice.py=utf-8 ++encoding//portal/migrations/0005_extend_user.py=utf-8 ++encoding//portal/migrations/0008_extend_user.py=utf-8 ++encoding//portal/migrations/0009_initial.py=utf-8 ++encoding//portal/migrations/0010_project.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 --combined myslice/settings.py index bd1474bd,bd1474bd..3b1f1f3d --- a/myslice/settings.py +++ b/myslice/settings.py @@@ -47,7 -47,7 +47,7 @@@ except # assume we have ./static present already HTTPROOT="/var/myslice-f4f" # the place to store local data, like e.g. the sqlite db --DATAROOT="/var/unfold" ++DATAROOT="/Users/moray/Sites/upmc/myslice" # if not there, then we assume it's from a devel tree if not os.path.isdir (os.path.join(HTTPROOT,"static")): HTTPROOT=ROOT diff --combined portal/actions.py index 5b72d646,90f7db9b..9018fbf3 --- a/portal/actions.py +++ b/portal/actions.py @@@ -1,17 -1,19 +1,19 @@@ - 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, PendingProject + 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 ++from portal.models import PendingUser, PendingSlice, PendingAuthority, PendingProject + from unfold.page import Page + import json - from django.contrib.auth.models import User - from django.contrib.sites.models import Site - from django.contrib.auth import get_user_model - from django.template.loader import render_to_string - from django.core.mail import EmailMultiAlternatives, send_mail + from django.contrib.auth.models import User + from django.contrib.sites.models import Site + from django.contrib.auth import get_user_model + from django.template.loader import render_to_string + from django.core.mail import EmailMultiAlternatives, send_mail - from myslice.theme import ThemeView - from myslice.configengine import ConfigEngine + from myslice.theme import ThemeView + from myslice.configengine import ConfigEngine theme = ThemeView() @@@ -28,7 -30,7 +30,7 @@@ import activity.slic def authority_get_pis(request, authority_hrn): # REGISTRY ONLY TO BE REMOVED WITH MANIFOLD-V2 - query = Query.get('authority').filter_by('authority_hrn', '==', authority_hrn).select('pi_users') + query = Query.get('myslice:authority').filter_by('authority_hrn', '==', authority_hrn).select('pi_users') results = execute_admin_query(request, query) print "authority_get_pis = %s" % results # NOTE: temporarily commented. Because results is giving empty list. @@@ -172,19 -174,26 +174,26 @@@ def clear_user_creds(request, user_emai return None def is_pi(wsgi_request, user_hrn, authority_hrn): - # XXX could be done in a single query ! - - # seauthorities from user where user_hrn == "ple.upmc.jordan_auge" - - # REGISTRY ONLY TO BE REMOVED WITH MANIFOLD-V2 - query = Query.get('myslice: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 + # authorities from user where user_hrn == "ple.upmc.jordan_auge" + print "#### actions.py is_pi authority_hrn = ", authority_hrn + try: + # CACHE PB with fields + page = Page(wsgi_request) + metadata = page.get_metadata() + user_md = metadata.details_by_object('user') + user_fields = [column['name'] for column in user_md['column']] + + # REGISTRY ONLY TO BE REMOVED WITH MANIFOLD-V2 + query = Query().get('myslice:user').select(user_fields).filter_by('user_hrn','==',user_hrn) + #query = Query.get('myslice:user').filter_by('user_hrn', '==', user_hrn).select('pi_authorities') + results = execute_query(wsgi_request, query) + print "is_pi results = ", results + for user_detail in results: + if authority_hrn in user_detail['pi_authorities']: + return True + except Exception,e: + print "Exception in actions.py in is_pi %s" % e + return False # SFA get record @@@ -340,16 -349,6 +349,16 @@@ def make_request_slice(slice) request['purpose'] = slice.purpose return request +def make_request_project(project): + request = {} + request['type'] = 'project' + request['user_hrn'] = project.user_hrn + request['timestamp'] = project.created + request['authority_hrn'] = project.authority_hrn + request['project_name'] = project.project_name + request['purpose'] = project.purpose + return request + def make_request_authority(authority): request = {} request['type'] = 'authority' @@@ -371,7 -370,7 +380,7 @@@ request['timestamp'] = authority.created return request -def make_requests(pending_users, pending_slices, pending_authorities): +def make_requests(pending_users, pending_slices, pending_authorities, pending_projects): requests = [] for user in pending_users: requests.append(make_request_user(user)) @@@ -379,8 -378,6 +388,8 @@@ requests.append(make_request_slice(slice)) for authority in pending_authorities: requests.append(make_request_authority(authority)) + for project in pending_projects: + requests.append(make_request_project(project)) return requests def get_request_by_id(ids): @@@ -407,33 -404,26 +416,33 @@@ def get_requests(authority_hrns=None) pending_users = PendingUser.objects.filter(status__iexact = 'True') pending_slices = PendingSlice.objects.all() pending_authorities = PendingAuthority.objects.all() + pending_projects = PendingProject.objects.all() + print "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" , pending_projects else: pending_users = PendingUser.objects pending_slices = PendingSlice.objects pending_authorities = PendingAuthority.objects + pending_projects = PendingProject.objects from django.db.models import Q list_user_Q = list() list_slice_Q = list() list_auth_Q = list() + list_proj_Q = list() for hrn in authority_hrns: list_user_Q.append(Q(authority_hrn__startswith=hrn, status__iexact = 'True')) list_slice_Q.append(Q(authority_hrn__startswith=hrn)) list_auth_Q.append(Q(site_authority__startswith=hrn)) + list_proj_Q.append(Q(authority_hrn__startswith=hrn)) + print "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" , list_proj_Q print "startswith hrn = ",hrn from operator import __or__ as OR pending_users = pending_users.filter(reduce(OR, list_user_Q)) pending_slices = pending_slices.filter(reduce(OR, list_slice_Q)) pending_authorities = pending_authorities.filter(reduce(OR, list_auth_Q)) + pending_projects = pending_projects.filter(reduce(OR, list_auth_Q)) #pending_authorities = pending_authorities.all() #filter(reduce(OR, list_Q)) - return make_requests(pending_users, pending_slices, pending_authorities) + return make_requests(pending_users, pending_slices, pending_authorities, pending_projects) # XXX Is it in sync with the form fields ? @@@ -713,9 -703,16 +722,16 @@@ def create_slice(wsgi_request, request) # 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() - + + # CACHE PB with fields + page = Page(wsgi_request) + metadata = page.get_metadata() + user_md = metadata.details_by_object('user') + user_fields = [column['name'] for column in user_md['column']] + # REGISTRY ONLY TO BE REMOVED WITH MANIFOLD-V2 - user_query = Query().get('myslice:user').select('user_hrn','user_email').filter_by('user_hrn','==',user_hrn) + #user_query = Query().get('myslice:user').select('user_hrn','user_email').filter_by('user_hrn','==',user_hrn) + user_query = Query().get('myslice:user').select(user_fields).filter_by('user_hrn','==',user_hrn) user_details_sfa = execute_admin_query(wsgi_request, user_query) if not user_details_sfa: raise Exception, "User %s doesn't exist, validate user before validating slice" % user_hrn @@@ -802,42 -799,6 +818,42 @@@ def create_pending_slice(wsgi_request, except Exception, e: print "Failed to send email, please check the mail templates and the SMTP configuration of your server" + +def create_pending_project(wsgi_request, request): + """ + """ + + # Insert an entry in the PendingProject table + s = PendingProject( + project_name = request['project_name'], + user_hrn = request['user_hrn'], + authority_hrn = request['authority_hrn'], + 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) +# 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 #------------------------------------------------------------------------------- diff --combined portal/models.py index cc484b5b,cc484b5b..6670c4c0 --- a/portal/models.py +++ b/portal/models.py @@@ -96,3 -96,3 +96,10 @@@ class PendingSlice(models.Model) type_of_nodes = models.TextField(default='NA') purpose = models.TextField(default='NA') created = models.DateTimeField(auto_now_add = True) ++ ++class PendingProject(models.Model): ++ project_name = models.TextField() ++ user_hrn = models.TextField() ++ authority_hrn = models.TextField(null=True) ++ purpose = models.TextField(default='NA') ++ created = models.DateTimeField(auto_now_add = True) diff --combined portal/projectrequestview.py index d2f11a6a,d2f11a6a..70f49949 --- a/portal/projectrequestview.py +++ b/portal/projectrequestview.py @@@ -1,35 -1,35 +1,132 @@@ from django.shortcuts import render from django.contrib.sites.models import Site -- --from unfold.page import Page -- from manifold.core.query import Query from manifoldapi.manifoldapi import execute_admin_query, execute_query --from portal.actions import is_pi, create_slice, create_pending_slice, clear_user_creds --#from portal.forms import SliceRequestForm from unfold.loginrequired import LoginRequiredAutoLogoutView --from ui.topmenu import topmenu_items_live, the_user ++ ++from portal.actions import create_pending_project ++ ++from portal.models import PendingProject from myslice.theme import ThemeView import json, time, re --import activity.user -- --class ProjectRequestView (LoginRequiredAutoLogoutView, ThemeView): ++class ProjectRequestView(LoginRequiredAutoLogoutView, ThemeView): template_name = 'projectrequest_view.html' -- # because we inherit LoginRequiredAutoLogoutView that is implemented by redefining 'dispatch' -- # we cannot redefine dispatch here, or we'd lose LoginRequired and AutoLogout behaviours -- def post (self, request): -- return self.get_or_post (request, 'POST') ++ def getAuthorities(self, request): ++ authorities_query = Query.get('authority').select('name', 'authority_hrn') ++ authorities = execute_admin_query(request, authorities_query) ++ if authorities is not None: ++ authorities = sorted(authorities, key=lambda k: k['authority_hrn']) ++ authorities = sorted(authorities, key=lambda k: k['name']) ++ return authorities ++ ++ def getUserAuthority(self, request): ++ # Get user_email (XXX Would deserve to be simplified) ++ user_query = Query().get('local:user').select('email','config') ++ user_details = execute_query(request, user_query) ++ for user_detail in user_details: ++ user_config = json.loads(user_detail['config']) ++ user_authority = user_config.get('authority','N/A') ++ return user_authority ++ ++ def getUserHrn(self, request): ++ user_hrn = None ++ ++ account_query = Query().get('local:account').select('user_id','platform_id','auth_type','config') ++ account_details = execute_query(request, account_query) ++ ++ platform_query = Query().get('local:platform').select('platform_id','platform','gateway_type','disabled') ++ platform_details = execute_query(request, platform_query) ++ ++ # getting user_hrn from local:account ++ for account_detail in account_details: ++ for platform_detail in platform_details: ++ if platform_detail['platform_id'] == account_detail['platform_id']: ++ # taking user_hrn only from myslice account ++ # NOTE: we should later handle accounts filter_by auth_type= managed OR user ++ if 'myslice' in platform_detail['platform']: ++ account_config = json.loads(account_detail['config']) ++ user_hrn = account_config.get('user_hrn','N/A') ++ return user_hrn ++ ++ def post(self, request): ++ return self.handle_request(request, 'POST') -- def get (self, request): -- return self.get_or_post (request, 'GET') ++ def get(self, request): ++ return self.handle_request(request, 'GET') -- def get_or_post (self, wsgi_request, method): ++ def handle_request(self, wsgi_request, method): ++ errors = [] ++ authority_hrn = None ++ authority_name = None ++ ++ user_hrn = self.getUserHrn(wsgi_request) ++ ++ authorities = self.getAuthorities(wsgi_request) ++ ++ user_authority = self.getUserAuthority(wsgi_request) ++ ++ # getting the org from authority ++ for authority in authorities: ++ if authority['authority_hrn'] == user_authority: ++ authority_name = authority['name'] ++ ++ if method == 'POST' : ++ ++ post = { ++ 'user_hrn' : user_hrn, ++ 'authority_hrn' : wsgi_request.POST.get('authority_name', ''), ++ 'project_name' : wsgi_request.POST.get('project_name', ''), ++ 'purpose' : wsgi_request.POST.get('purpose', ''), ++ } ++ ++# # create slice_hrn based on authority_hrn and slice_name ++# # slice_name = slice_request['slice_name'] ++# req_slice_hrn = authority_hrn + '.' + slice_name ++# # comparing requested slice_hrn with the existing slice_hrn ++# slice_query = Query().get('myslice:slice').select('slice_hrn','parent_authority').filter_by('parent_authority','==',authority_hrn) ++# slice_details_sfa = execute_admin_query(wsgi_request, slice_query) ++# for _slice in slice_details_sfa: ++# if _slice['slice_hrn'] == req_slice_hrn: ++# errors.append('Slice already exists. Please use a different slice name.') ++ ++ ++ # What kind of slice name is valid? ++ if (post['project_name'] is None or post['project_name'] == ''): ++ errors.append('Project name is mandatory') ++ ++ if (re.search(r'^[A-Za-z0-9_]*$', post['project_name']) == None): ++ errors.append('Project name may contain only letters, numbers, and underscore.') ++ ++ if (post['authority_hrn'] is None or post['authority_hrn'] == ''): ++ errors.append('Organization is mandatory') ++ ++ if (post['purpose'] is None or post['purpose'] == ''): ++ errors.append('Experiment purpose is mandatory') ++ ++ if not errors: ++ create_pending_project(wsgi_request, post) ++ ++ # retrieves the pending projects list ++ pending_projects = PendingProject.objects.all().filter(user_hrn=user_hrn) ++ ++ env = { ++ 'errors': errors, ++ 'username': wsgi_request.user, ++ 'theme': self.theme, ++ 'authorities': authorities, ++ 'authority_hrn': user_authority, ++ 'pending_projects': pending_projects, ++ } ++ return render(wsgi_request, self.template, env) ++ ++ ++ """ """ errors = [] @@@ -67,6 -67,6 +164,7 @@@ # platform_query = Query().get('local:platform').select('platform_id','platform','gateway_type','disabled') platform_details = execute_query(wsgi_request, platform_query) ++ user_hrn = None # getting user_hrn from local:account for account_detail in account_details: @@@ -88,17 -88,17 +186,17 @@@ # Page rendering -- page = Page(wsgi_request) -- page.add_js_files ( [ "js/jquery.validate.js", "js/jquery-ui.js" ] ) -- page.add_css_files ( [ "https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" ] ) -- page.expose_js_metadata() ++# page = Page(wsgi_request) ++# page.add_js_files ( [ "js/jquery.validate.js", "js/jquery-ui.js" ] ) ++# page.add_css_files ( [ "https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" ] ) ++# page.expose_js_metadata() if method == 'POST': # The form has been submitted # get the domain url -- current_site = Site.objects.get_current() -- current_site = current_site.domain ++# current_site = Site.objects.get_current() ++# current_site = current_site.domain # getting the authority_hrn from the selected organization for authority in authorities: @@@ -124,7 -124,7 +222,7 @@@ } # create slice_hrn based on authority_hrn and slice_name -- slice_name = slice_request['slice_name'] ++# slice_name = slice_request['slice_name'] req_slice_hrn = authority_hrn + '.' + slice_name # comparing requested slice_hrn with the existing slice_hrn slice_query = Query().get('myslice:slice').select('slice_hrn','parent_authority').filter_by('parent_authority','==',authority_hrn) @@@ -173,7 -173,7 +271,6 @@@ template_env = { 'username': wsgi_request.user.email, -- 'topmenu_items': topmenu_items_live('Request a slice', page), 'errors': errors, 'slice_name': slice_name, 'purpose': purpose, diff --combined portal/static/css/fed4fire.css index 987d54e5,987d54e5..ca827bf4 --- a/portal/static/css/fed4fire.css +++ b/portal/static/css/fed4fire.css @@@ -31,6 -31,6 +31,20 @@@ h3 color:#201E62; } ++input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number] { ++ min-width:260px; ++ padding:6px; ++ border:1pt solid #CCCCCC; ++ vertical-align:bottom; ++ border-radius:0; ++} ++ ++textarea { ++ padding:6px; ++ border:1pt solid #CCCCCC !important; ++ border-radius:0 !important; ++} ++ div.wrapper { width:980px; margin:0 auto; diff --combined portal/static/js/myslice.js index fcde9672,4fe42dae..548d5dab --- a/portal/static/js/myslice.js +++ b/portal/static/js/myslice.js @@@ -174,6 -174,29 +174,29 @@@ var myslice = $.post("/rest/myslice:user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) { if (data.length > 0) { localStorage.setItem('user', JSON.stringify(data[0])); + projects = []; + $.each(data[0].pi_authorities, function(idx, auth) { + // PI on projects + if(auth.split('.').length>2){ + if($.inArray(auth,projects) == -1){ + projects.push(auth); + } + }else if (auth.split('.').length>1){ + // PI on authorities + // What are the projects under this authority? + $.post("/rest/myslice:authority/",{'fields':['authority_hrn'],'filters':{'authority_hrn':'CONTAINS'+auth}}, function( data ) { + $.each(data, function(idx, project) { + console.log(project.authority_hrn); + if($.inArray(project.authority_hrn,projects) == -1){ + projects.push(project.authority_hrn); + } + }); + }); + }else{ + console.log("admin account - we don't list all from root"); + } + }); + localStorage.setItem('projects', JSON.stringify(projects)); myslice.loadSlices(data[0].slices); if(isFunction(fn)){ fn(); @@@ -187,36 -210,7 +210,8 @@@ } }, - loadProjects: function(fn) { - var u = localStorage.getItem('user'); - if (u !== 'undefined') { - var user = JSON.parse(u); - var projects = localStorage.getItem('projects'); - if($.isEmptyObject(projects)){ - if($.isEmptyObject(user) || $.isEmptyObject(user.parent_authority)){ - $.post("/rest/myslice:user/",{'filters':{'user_hrn':'$user_hrn'},'fields':['parent_authority']}, function( data ) { - parent_authority = data[0].parent_authority; - - }); - }else{ - parent_authority = user.parent_authority; - } - // REGISTRY ONLY TO BE REMOVED WITH MANIFOLD-V2 - $.post("/rest/myslice:authority/",{'fields':['authority_hrn'],'filters':{'authority_hrn':'CONTAINS'+parent_authority}}, function( data ) { - localStorage.setItem('projects', JSON.stringify(data)); - if(isFunction(fn)){ - fn(); - } - }); - }else{ - if(isFunction(fn)){ - fn(); - } - } - } - }, + getSlices: function(name) { }, diff --combined portal/templates/_widget-slice-sections.html index 175b09c0,175b09c0..0856bd89 --- a/portal/templates/_widget-slice-sections.html +++ b/portal/templates/_widget-slice-sections.html @@@ -4,7 -4,7 +4,7 @@@
  • Testbeds
  • Resources
  • Users
  • -- ++
  • Statistics
  • Measurements
  • Experiment
  • SLA
  • @@@ -15,7 -15,7 +15,7 @@@
  • Testbeds
  • Resources
  • Users
  • -- ++
  • Statistics
  • Measurements
  • Experiment
  • SLA
  • diff --combined portal/templates/fed4fire/fed4fire_projectrequest_view.html index 962976fc,962976fc..a4c433bc --- a/portal/templates/fed4fire/fed4fire_projectrequest_view.html +++ b/portal/templates/fed4fire/fed4fire_projectrequest_view.html @@@ -2,68 -2,68 +2,126 @@@ {% load i18n %} {% block content %} --
    --
    -- --
    --
    ++
    ++
    ++ ++
    -- {% if errors %} --
    --
    --
      -- {% for error in errors %} --
    • {{ error }}
    • -- {% endfor %} --
    --
    --
    -- {% endif %} -- --
    --
    --
    -- {% csrf_token %} -- --
    -- --
    --
    -- New Project --
    --
    -- Existing Project --
    --
    -- --
    -- {%if 'is_pi' in pi %} -- -- {%else%} -- -- {%endif%} --
    -- --
    --
    ++{% if errors %} ++
    ++
    ++
      ++ {% for error in errors %} ++
    • {{ error }}
    • ++ {% endfor %} ++
    ++
    ++
    ++{% endif %} ++ ++
    ++ ++
    ++
    ++
    ++

    Join an existing Project

    ++
    ++
    ++

    List of projects you are part of

    ++
    ++
    ++
    ++
    ++
    ++ {% csrf_token %} ++ ++
    ++
    ++
    ++ ++ {% for pending in pending_projects %} ++ ++ {% endfor %} ++
    (PENDING) {{ pending.project_name }}{{ pending.authority_hrn }}{{ pending.created|date:"d/m/Y" }}
    ++
    ++
    ++
    ++ ++
    ++
    ++
    ++

    Create a new Project

    ++
    ++
    ++ ++ ++
    ++
    ++
    ++ {% csrf_token %} ++
    ++ ++
    ++
    ++ ++
    ++ ++ ++
    ++ ++
    ++ ++
    ++ ++
    ++
    ++
    ++ ++
    diff --combined portal/templates/management-tab-requests.html index dad0e6e7,dad0e6e7..dd3ce14f --- a/portal/templates/management-tab-requests.html +++ b/portal/templates/management-tab-requests.html @@@ -139,6 -139,6 +139,8 @@@ {{request.first_name}} {{request.last_name}} <{{request.email}}> {% elif request.type == 'slice' %} {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}} ++ {% elif request.type == 'project' %} ++ {{request.project_name}} -- {{ request.user_hrn }} -- Purpose: {{request.purpose}} {% else %} {{request.site_name}} ({{request.site_authority}}) -- {{request.address_city}}, {{request.address_country}} {% endif %} @@@ -201,6 -201,6 +203,8 @@@ {% else %} {% if request.type == 'slice' %} Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}} ++ {% elif request.type == 'project' %} ++ {{request.project_name}} -- {{ request.user_hrn }} -- Purpose: {{request.purpose}} {% else %} {# authority #} Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}} {% endif %} @@@ -255,6 -255,6 +259,8 @@@ {% else %} {% if request.type == 'slice' %} Slice name: {{request.slice_name}} -- Number of nodes: {{request.number_of_nodes}} -- Type of nodes: {{request.type_of_nodes}} -- Purpose: {{request.purpose}} ++ {% elif request.type == 'project' %} ++ {{request.project_name}} -- {{ request.user_hrn }} -- Purpose: {{request.purpose}} {% else %} {# authority #} Authority name: {{request.site_name}} -- authority_hrn: {{request.site_authority}} -- City: {{request.address_city}} -- Country: {{request.address_country}} {% endif %} diff --combined portal/templates/slice-resource-view.html index ff1fc3e0,ff1fc3e0..93285e12 --- a/portal/templates/slice-resource-view.html +++ b/portal/templates/slice-resource-view.html @@@ -54,9 -54,9 +54,9 @@@ $(document).ready(function()