Create slice: clears local storage now
[myslice.git] / portal / templates / onelab / onelab_slicerequest_view.html
index 82ccd16..211f35d 100644 (file)
@@ -13,7 +13,7 @@
        {% if errors %}
        <div class="row">
                <div class="col-md-12">
-               <ul>
+               <ul class="error">
                  {% for error in errors %}
                  <li>{{ error }}</li>
                  {% endfor %}
                                {%endif%}
                          </div>
                          <div class="form-group">
-                           <input type="text" class="form-control" name="exp_url" id="exp_url" style="width:300px" placeholder="Experiment URL (if one exists)"
-                               title="Please provide the url of your experiment if you have one." value="{{exp_url}}">
+                           <input type="text" class="form-control" name="url" id="url" style="width:300px" placeholder="Experiment URL (if one exists)"
+                               title="Please provide the url of your experiment if you have one." value="{{url}}">
                          </div>
                          <div class="form-group">
-                               <textarea id="purpose" name="purpose" class="form-control" rows="6" placeholder="Experiment Purpose" style="width:300px" 
+                               <textarea id="purpose" name="purpose" class="form-control" rows="6" placeholder="Experiment purpose" style="width:300px" 
                                title="Purpose of your experiment (informative)" required="required">{{ purpose }}</textarea>
                          </div>
-                         <button type="submit" class="btn btn-onelab"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
+                         {%if 'is_pi'  in pi %}        
+                         <button type="submit" id=submit_pi class="btn btn-onelab"><span class="glyphicon glyphicon-plus"></span> Create slice</button>
+                         {%else%}
+                         <button type="submit" class="btn btn-onelab"><span class="glyphicon glyphicon-plus"></span> Request slice</button>
+                         {%endif%}     
                        </form>
        
                </div>
 <script>
 jQuery(document).ready(function(){
        
-       $("#authority_hrn").load("/rest/user/", {"fields" : ["parent_authority"], "filters": {"user_hrn": "{{ user_hrn }}"}}, function(data) {
+       /*$("#authority_hrn").load("/rest/user/", {"fields" : ["parent_authority"], "filters": {"user_hrn": "{{ user_hrn }}"}}, function(data) {
                var jsonData = JSON.parse(data);
-               // getting the authority from the view not rest
-        $(this).attr("value", "{{authority_name}}");
-    });
+        $(this).attr("value", jsonData[0]['parent_authority']);
+    });*/
+       $("#authority_hrn").val("{{authority_name}}");
        var availableTags = [
     {% if authorities %}
         {% for authority in authorities %}
@@ -94,6 +98,10 @@ jQuery(document).ready(function(){
       minLength: 0,
       select: function( event, ui ) {console.log(jQuery(this));}
     });
+
+       $("#submit_pi").click(function() {
+               localStorage.clear();
+       });
 });
 </script>
 {% endblock %}