Commit ad0e2281 authored by Roberto P. Rubio's avatar Roberto P. Rubio
Browse files

VM_Copy: Owner is set to current user by default, volatile is set to true if base is volatile

parent 3500fff8
......@@ -212,6 +212,7 @@
var data = JSON.parse(event.data);
$scope.$apply(function () {
$scope.showmachine = data;
$scope.copy_is_volatile = $scope.showmachine.is_volatile;
if (!subscribed_extra) {
subscribed_extra = true;
subscribe_nodes(url,data.type);
......@@ -739,6 +740,7 @@
$scope.list_users=response.data;
for (var i = 0; i < response.data.length; i++) {
if (response.data[i].id == $scope.showmachine.id_owner) {
$scope.copy_owner = response.data[i].id;
$scope.new_owner = response.data[i];
}
}
......
......@@ -39,28 +39,24 @@
<label class="control-label" for="copy_is_volatile"><%=l 'Volatile' %></label>
</div>
</div>
<div class="row">
<div class="row" ng-show="showmachine.is_pool">
<div class="col-md-12 mt-12">
<input type="checkbox" name="copy_is_pool" ng-model="copy_is_pool" ng-disabled="showmachine.is_pool != 1">
<input type="checkbox" name="copy_is_pool" ng-model="copy_is_pool">
<label class="control-label" for="copy_is_pool"><%=l 'Pool' %></label>
</div>
</div>
% if ($USER->is_admin){
<div class="form-group row">
<div class="col-md-2 mt-2">
<label class="control-label" for="copy_owner"><%=l 'Owner' %></label>{{copy_owner_id}}
<label class="control-label" for="copy_owner"><%=l 'Owner' %></label>
</div>
<div class="col-md-4">
<select class="form-control" ng-model="copy_owner" name="copy_owner">
<option ng-repeat="user in list_users" value="{{user.id}}">{{user.name}}</option>
<option ng-repeat="user in list_users" ng-value="user.id" ng-selected="user.id == copy_owner">{{user.name}}</option>
</select>
</div>
</div>
% }
<div ng-show="copy_request" class="alert alert-warning">
Copy {{showmachine.name}} {{copy_request.status}}.
<br/>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment