From: Yasin Rahman Date: Fri, 10 Apr 2015 15:17:37 +0000 (+0200) Subject: Several modifications in fed4fire UI + Slice creation is restricted under projects... X-Git-Url: http://git.onelab.eu/?p=unfold.git;a=commitdiff_plain;h=958afd7b86e20e1529c2f7cc4662b47205945c40 Several modifications in fed4fire UI + Slice creation is restricted under projects only --- diff --git a/portal/projectrequestview.py b/portal/projectrequestview.py index 6b1bc7c2..451469de 100644 --- a/portal/projectrequestview.py +++ b/portal/projectrequestview.py @@ -119,6 +119,11 @@ class ProjectRequestView(LoginRequiredAutoLogoutView, ThemeView): # What kind of project name is valid? if (post['project_name'] is None or post['project_name'] == ''): errors.append('Project name is mandatory') + + # max project_name length is 10 + if (len(post['project_name']) >10): + errors.append('Project name can be maximum 10 characters long') + if not errors: print "is_pi on auth_hrn = ", user_authority diff --git a/portal/slicerequestview.py b/portal/slicerequestview.py index a880d391..0a8f9989 100644 --- a/portal/slicerequestview.py +++ b/portal/slicerequestview.py @@ -17,6 +17,7 @@ from myslice.theme import ThemeView import json, time, re import activity.user +theme = ThemeView() class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView): template_name = 'slicerequest_view.html' @@ -148,9 +149,17 @@ class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView): if (re.search(r'^[A-Za-z0-9_]*$', slice_name) == None): errors.append('Slice name may contain only letters, numbers, and underscore.') - organization = slice_request['organization'] - if (organization is None or organization == ''): - errors.append('Organization is mandatory') + organization = slice_request['organization'] + if theme.theme == 'fed4fire': + if (organization is None or organization == ''): + errors.append('Selecting project is mandatory') + else: + if (organization is None or organization == ''): + errors.append('Organization is mandatory') + + slice_length= len(slice_request['slice_name']) + if slice_length >19: + errors.append('Slice name can be maximum 19 characters long') diff --git a/portal/static/js/my_account.edit_profile.js b/portal/static/js/my_account.edit_profile.js index f98427e9..026321f2 100644 --- a/portal/static/js/my_account.edit_profile.js +++ b/portal/static/js/my_account.edit_profile.js @@ -136,7 +136,7 @@ jQuery(document).ready(function(){ jQuery("#upload_file").click(function(){ jQuery("#span_upload").show(); - jQuery("#dl_file").hide(); + jQuery("#dl_pubkey").hide(); jQuery("#upload_file").hide(); jQuery("#keyval").hide(); // enforcing when one edit is clicked the rest will not work at same time @@ -157,7 +157,7 @@ jQuery(document).ready(function(){ jQuery("#span_upload").hide(); jQuery("#keyval").show(); - jQuery("#dl_file").show(); + jQuery("#dl_pubkey").show(); jQuery("#upload_file").show(); }); }); diff --git a/portal/templates/fed4fire/fed4fire_account-view.html b/portal/templates/fed4fire/fed4fire_account-view.html index 985974fb..b71f3da8 100644 --- a/portal/templates/fed4fire/fed4fire_account-view.html +++ b/portal/templates/fed4fire/fed4fire_account-view.html @@ -33,7 +33,6 @@ @@ -301,55 +300,8 @@ {%endif%} - - -
-
- -

Testbed Access Reference Accounts in the following testbeds

- - - - - - - - {% for row in ref_acc %} - - - - - - - {%endfor%} -
PlatformAccount TypeReference toRemove Account
{{ row.platform_name }} {{ row.account_type }} {{ row.account_reference }} - -
- - -

Add reference account to the following testbeds

- - - - - - {% for platform in platform_list %} - - - - - {%endfor%} -
PlatformsAdd Account
{{ platform.platform_no_access }} - -
-
{%endif%}
- +{% endblock head %} + {% widget "_widget-no_credentials.html" %}
@@ -20,10 +26,10 @@ EXPERIMENT
- +
- +

Your slices @@ -40,10 +46,9 @@

Loading Slices

Experiment now

- + jFed
@@ -52,7 +57,7 @@
- +
@@ -136,6 +141,17 @@ - + {# widget "_widget-monitor.html" #} {# widget "_widget-stats-top-slices.html" #} diff --git a/portal/templates/fed4fire/fed4fire_projectrequest_view.html b/portal/templates/fed4fire/fed4fire_projectrequest_view.html index d0021525..be597501 100644 --- a/portal/templates/fed4fire/fed4fire_projectrequest_view.html +++ b/portal/templates/fed4fire/fed4fire_projectrequest_view.html @@ -10,8 +10,8 @@
@@ -30,39 +30,8 @@ {% endif %}
- -
-
-
-

Join an existing Project

-
-
-

List of projects you are part of

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

Create a new Project

@@ -102,6 +71,36 @@
+
+
+
+

Join an existing Project

+
+
+

List of projects you are part of

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