1 {% extends "layout.html" %}
6 <div class="col-md-12">
7 <div class="breadcrumbs" style="line-height: 3;">
8 Experiment > Request a new Slice
15 <div class="col-md-12">
17 {% for error in errors %}
26 <div class="col-md-8 el">
27 <form role="form" method="post">
29 <div class="form-group" style="display:none">
30 <input type="email" class="form-control" id="email" style="width:300px" value="{{ email }}" readonly="readonly">
32 <div class="form-group">
33 <input type="text" class="form-control" name="slice_name" id="slice_name" style="width:300px" placeholder="Slice name" value="{{slice_name}}"
34 title="Please enter a name for your slice"required="required">
36 <div class="form-group">
38 <input type="text" class="form-control" id="authority_hrn" name="org_name" style="width:300px" placeholder="Organization"
39 title="An authority responsible for vetting your slice" required="required">
41 <input type="text" class="form-control" id="authority_hrn" name="org_name" placeholder="Organization" style="width:300px;"
42 title="An authority responsible for vetting your slice" required="required" readonly>
45 <div class="form-group">
47 <select id="projects">
48 <option>project A</option>
51 <div class="form-group">
52 <input type="text" class="form-control" name="url" id="url" style="width:300px" placeholder="Experiment URL (if one exists)"
53 title="Please provide the url of your experiment if you have one." value="{{url}}">
55 <div class="form-group">
56 <textarea id="purpose" name="purpose" class="form-control" rows="6" placeholder="Experiment purpose" style="width:300px"
57 title="Purpose of your experiment (informative)" required="required">{{ purpose }}</textarea>
60 <button type="submit" id=submit_pi class="btn btn-onelab"><span class="glyphicon glyphicon-plus"></span> Create slice</button>
62 <button type="submit" class="btn btn-onelab"><span class="glyphicon glyphicon-plus"></span> Request slice</button>
70 jQuery(document).ready(function(){
72 $("#authority_hrn").load("/rest/user/", {"fields" : ["parent_authority"], "filters": {"user_hrn": "{{ user_hrn }}"}}, function(data) {
73 var jsonData = JSON.parse(data);
74 $(this).attr("value", jsonData[0]['parent_authority']);
75 draw_projects(jsonData[0]['parent_authority']);
77 $("#authority_hrn").val("{{authority_name}}");
80 {% for authority in authorities %}
81 {% if authority.name %}
82 {value:"{{ authority.name }}",label:"{{authority.name}}"},
83 // to show only full name
85 {value:"{{ authority.authority_hrn }}",label:"{{authority.authority_hrn}}"},
89 {value:"",label:"No authority found !!!"}
93 availableTags.sort(function(a,b){
94 var nameA=a.value.toLowerCase(), nameB=b.value.toLowerCase();
103 $( "#authority_hrn" ).autocomplete({
104 source: availableTags,
106 select: function( event, ui ) {
107 draw_projects(jQuery('.ui-state-focus').html());
113 function draw_projects(authority_hrn){
114 $.post("/rest/myslice:authority/",{'fields':['authority_hrn','pi_users'],'filters':{'authority_hrn':'CONTAINS'+authority_hrn}}, function( data ) {
117 project_row = "<option value=''> - </option>";
118 projects.push(project_row);
120 $.each( data, function( key, val ) {
122 project_row = "<option value='"+val.authority_hrn+"'>"+val.authority_hrn+"</option>";
123 projects.push(project_row);
125 $("#projects").html(projects.join( "" ));