Project

General

Profile

« Previous | Next » 

Revision 2a08c26b

Added by Amos Benari about 12 years ago

  • ID 2a08c26bdc183fc0631e09d6b2663ec6047acea9

fixed ui for adding and removing ovirt volumes.
when creating a vm from template, if there was an error in the
form. the vm volumes didnot display correctly.
adding and removing volumes in the same submit action did not function well too.

View differences:

app/views/compute_resources/vms/form/ovirt/_volume.html.erb
<div class="fields">
<div class="control-group">
<% if f.object._delete != '1' -%>
<% disabled = (f.object.persisted? == "true" || f.object.persisted? == true) %>
<%= text_f f, :size_gb,:label => "Size GB", :disabled => disabled, :class => "span2" %>
<% disabled = !f.object.id.blank? %>
<%= text_f f,:size_gb, :label => 'Size GB', :disabled => disabled, :class => "span2" %>
<%= f.hidden_field :size_gb if disabled %>
<%= select_f f, :storage_domain, compute_resource.storage_domains, :id, :name,
{ },:label => "Storage Domain", :disabled => disabled, :class => "span2",
:help_inline => remove_child_link("X", f, { :method => :'_delete', :title => 'remove volume', :class => 'label label-important' }) %>
{ }, :label => 'Storage Domain', :disabled => disabled, :class => "span2",
:help_inline=> remove_child_link("X", f, { :method => :'_delete', :title => 'remove volume', :class => 'label label-important' }) %>
<%= f.hidden_field :storage_domain if disabled %>
<%= checkbox_f f, :bootable, {:label => "Is Bootable", :disabled => disabled, :checked => (f.object.bootable == 'true'),
:help_block => "Note that only one volume is allowed to be bootable" } %>
<%= f.hidden_field :id %>
<%= field(f, :bootable, :label => 'Bootable') do
radio_button_f f, :bootable, {:disabled => disabled, :value=>'true', :checked => (f.object.bootable == 'true'), :onclick => 'bootable_radio(this)',
:text => 'Only one volume can be Bootable'}
end %>
<% end -%>
</div>
</div>

Also available in: Unified diff