Every patch apply files conversion for one set of views belonging to controller
From: Jozef Zigmund jzigmund@redhat.com
--- src/app/views/cloud_accounts/_form.haml | 22 ++++++++++++++++++++++ src/app/views/cloud_accounts/_form.html.erb | 13 ------------- src/app/views/cloud_accounts/edit.haml | 6 ++++++ src/app/views/cloud_accounts/edit.html.erb | 10 ---------- src/app/views/cloud_accounts/new.haml | 8 ++++++++ src/app/views/cloud_accounts/new.html.erb | 10 ---------- 6 files changed, 36 insertions(+), 33 deletions(-) create mode 100644 src/app/views/cloud_accounts/_form.haml delete mode 100644 src/app/views/cloud_accounts/_form.html.erb create mode 100644 src/app/views/cloud_accounts/edit.haml delete mode 100644 src/app/views/cloud_accounts/edit.html.erb create mode 100644 src/app/views/cloud_accounts/new.haml delete mode 100644 src/app/views/cloud_accounts/new.html.erb
diff --git a/src/app/views/cloud_accounts/_form.haml b/src/app/views/cloud_accounts/_form.haml new file mode 100644 index 0000000..42960b3 --- /dev/null +++ b/src/app/views/cloud_accounts/_form.haml @@ -0,0 +1,22 @@ +%fieldset + %legend Account + = hidden_field :cloud_account, :id + = hidden_field :cloud_account, :provider_id, :value => @provider.id + %ul + %li + %label + Label + %span user-visible name for the account + = text_field :cloud_account, :label + - if @cloud_account.id.nil? + %li + %label + UserName + %span UserName for the provider account you wish to add. + = text_field :cloud_account, :username + %li + %label + Password + %span Password for the provider account you wish to add. + = password_field :cloud_account, :password += submit_tag "Save", :class => "submit" diff --git a/src/app/views/cloud_accounts/_form.html.erb b/src/app/views/cloud_accounts/_form.html.erb deleted file mode 100644 index 95f339c..0000000 --- a/src/app/views/cloud_accounts/_form.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<fieldset> -<legend>Account</legend> -<%= hidden_field :cloud_account, :id %> -<%= hidden_field :cloud_account, :provider_id, :value => @provider.id %> -<ul> -<li><label>Label<span>user-visible name for the account</span></label><%=text_field :cloud_account, :label %></li> -<% if @cloud_account.id.nil? %> -<li><label>UserName<span>UserName for the provider account you wish to add.</span></label><%= text_field :cloud_account, :username %></li> -<% end %> -<li><label>Password<span>Password for the provider account you wish to add.</span></label><%=password_field :cloud_account, :password %></li> -</ul> -</fieldset> -<%= submit_tag "Save", :class => "submit" %> diff --git a/src/app/views/cloud_accounts/edit.haml b/src/app/views/cloud_accounts/edit.haml new file mode 100644 index 0000000..9e16553 --- /dev/null +++ b/src/app/views/cloud_accounts/edit.haml @@ -0,0 +1,6 @@ +.dcloud_form + = error_messages_for 'cloud_account' + %h2 Edit Cloud Account + %br/ + - form_for @cloud_account, :url => { :action => 'update' } do |form| + = render :partial => 'form' diff --git a/src/app/views/cloud_accounts/edit.html.erb b/src/app/views/cloud_accounts/edit.html.erb deleted file mode 100644 index 3ae86aa..0000000 --- a/src/app/views/cloud_accounts/edit.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<div class="dcloud_form"> - <%= error_messages_for 'cloud_account' %> - - <h2>Edit Cloud Account</h2><br /> - - <% form_for @cloud_account, :url => { :action => 'update' } do |form| -%> - <%= render :partial => 'form' %> - <% end %> - -</div> diff --git a/src/app/views/cloud_accounts/new.haml b/src/app/views/cloud_accounts/new.haml new file mode 100644 index 0000000..446fd36 --- /dev/null +++ b/src/app/views/cloud_accounts/new.haml @@ -0,0 +1,8 @@ +.dcloud_form + = error_messages_for 'account' + %h2 Add a new Account from this Provider + %br/ + - form_for @cloud_account, :url => { :action => "create" } do |f| + = f.error_messages + = render :partial => "form", :object => f + = link_to "Cancel", root_path, :class => 'actionlink' diff --git a/src/app/views/cloud_accounts/new.html.erb b/src/app/views/cloud_accounts/new.html.erb deleted file mode 100644 index c8e6d60..0000000 --- a/src/app/views/cloud_accounts/new.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<div class="dcloud_form"> - <%= error_messages_for 'account' %> - - <h2>Add a new Account from this Provider</h2><br /> - <% form_for @cloud_account, :url => { :action => "create" } do |f| %> - <%= f.error_messages %> - <%= render :partial => "form", :object => f %> - <% end %> - <%= link_to "Cancel", root_path, :class => 'actionlink' %> -</div>
From: Jozef Zigmund jzigmund@redhat.com
--- src/app/views/hardware_profiles/_list.haml | 20 ++++++++++++++++++ src/app/views/hardware_profiles/_list.html.erb | 26 ------------------------ src/app/views/hardware_profiles/index.haml | 1 + src/app/views/hardware_profiles/index.html.erb | 1 - 4 files changed, 21 insertions(+), 27 deletions(-) create mode 100644 src/app/views/hardware_profiles/_list.haml delete mode 100644 src/app/views/hardware_profiles/_list.html.erb create mode 100644 src/app/views/hardware_profiles/index.haml delete mode 100644 src/app/views/hardware_profiles/index.html.erb
diff --git a/src/app/views/hardware_profiles/_list.haml b/src/app/views/hardware_profiles/_list.haml new file mode 100644 index 0000000..9dca88e --- /dev/null +++ b/src/app/views/hardware_profiles/_list.haml @@ -0,0 +1,20 @@ +- if @hardware_profiles.size == 0 + %h1 There are no hardware profiles to display +- else + %table + %thead + %tr + %th{:scope => "col"} Name + %th{:scope => "col"} Memory + %th{:scope => "col"} Storage + %th{:scope => "col"} CPU + %th{:scope => "col"} Architecture + %tbody + - @hardware_profiles.each {|hp| + %tr + %td= hp.name + %td= hp.memory.value if hp.memory + %td= hp.storage.value if hp.storage + %td= hp.cpu.value if hp.cpu + %td= hp.architecture.value if hp.architecture + - } diff --git a/src/app/views/hardware_profiles/_list.html.erb b/src/app/views/hardware_profiles/_list.html.erb deleted file mode 100644 index 1125c09..0000000 --- a/src/app/views/hardware_profiles/_list.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<% if @hardware_profiles.size == 0 %> -<h1>There are no hardware profiles to display</h1> -<% else %> - <table> - <thead> - <tr> - <th scope="col">Name</th> - <th scope="col">Memory</th> - <th scope="col">Storage</th> - <th scope="col">CPU</th> - <th scope="col">Architecture</th> - </tr> - </thead> - <tbody> - <%@hardware_profiles.each {|hp| %> - <tr> - <td><%= hp.name %></td> - <td><%= hp.memory.value if hp.memory %></td> - <td><%= hp.storage.value if hp.storage %></td> - <td><%= hp.cpu.value if hp.cpu %></td> - <td><%= hp.architecture.value if hp.architecture %></td> - </tr> - <% } %> - </tbody> - </table> -<% end %> diff --git a/src/app/views/hardware_profiles/index.haml b/src/app/views/hardware_profiles/index.haml new file mode 100644 index 0000000..9dabd7e --- /dev/null +++ b/src/app/views/hardware_profiles/index.haml @@ -0,0 +1 @@ += render :partial => 'list' diff --git a/src/app/views/hardware_profiles/index.html.erb b/src/app/views/hardware_profiles/index.html.erb deleted file mode 100644 index c19c3fa..0000000 --- a/src/app/views/hardware_profiles/index.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render :partial => 'list' %>
From: Jozef Zigmund jzigmund@redhat.com
--- src/app/views/instance/create.haml | 2 + src/app/views/instance/create.html.erb | 2 - src/app/views/instance/delete.haml | 2 + src/app/views/instance/delete.html.erb | 2 - src/app/views/instance/index.haml | 1 + src/app/views/instance/index.html.erb | 1 - src/app/views/instance/new.haml | 78 +++++++++++++++++++++++++++++++ src/app/views/instance/new.html.erb | 79 -------------------------------- src/app/views/instance/show.haml | 2 + src/app/views/instance/show.html.erb | 2 - 10 files changed, 85 insertions(+), 86 deletions(-) create mode 100644 src/app/views/instance/create.haml delete mode 100644 src/app/views/instance/create.html.erb create mode 100644 src/app/views/instance/delete.haml delete mode 100644 src/app/views/instance/delete.html.erb create mode 100644 src/app/views/instance/index.haml delete mode 100644 src/app/views/instance/index.html.erb create mode 100644 src/app/views/instance/new.haml delete mode 100644 src/app/views/instance/new.html.erb create mode 100644 src/app/views/instance/show.haml delete mode 100644 src/app/views/instance/show.html.erb
diff --git a/src/app/views/instance/create.haml b/src/app/views/instance/create.haml new file mode 100644 index 0000000..6fd9474 --- /dev/null +++ b/src/app/views/instance/create.haml @@ -0,0 +1,2 @@ +%h1 Instance#create +%p Find me in app/views/instance/create.html.erb diff --git a/src/app/views/instance/create.html.erb b/src/app/views/instance/create.html.erb deleted file mode 100644 index 4f6287a..0000000 --- a/src/app/views/instance/create.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<h1>Instance#create</h1> -<p>Find me in app/views/instance/create.html.erb</p> diff --git a/src/app/views/instance/delete.haml b/src/app/views/instance/delete.haml new file mode 100644 index 0000000..63de29b --- /dev/null +++ b/src/app/views/instance/delete.haml @@ -0,0 +1,2 @@ +%h1 Instance#delete +%p Find me in app/views/instance/delete.html.erb diff --git a/src/app/views/instance/delete.html.erb b/src/app/views/instance/delete.html.erb deleted file mode 100644 index 2afa7f3..0000000 --- a/src/app/views/instance/delete.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<h1>Instance#delete</h1> -<p>Find me in app/views/instance/delete.html.erb</p> diff --git a/src/app/views/instance/index.haml b/src/app/views/instance/index.haml new file mode 100644 index 0000000..fa8a917 --- /dev/null +++ b/src/app/views/instance/index.haml @@ -0,0 +1 @@ += render :partial => 'instance/instances' diff --git a/src/app/views/instance/index.html.erb b/src/app/views/instance/index.html.erb deleted file mode 100644 index 7c00833..0000000 --- a/src/app/views/instance/index.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render :partial => 'instance/instances' %> diff --git a/src/app/views/instance/new.haml b/src/app/views/instance/new.haml new file mode 100644 index 0000000..d797d57 --- /dev/null +++ b/src/app/views/instance/new.haml @@ -0,0 +1,78 @@ +:javascript + $(document).ready(function() { + $(".select_image").click(function() { + var wrapper = $("#select_template_dialog"); + if (wrapper.length == 0) wrapper = $('<div id="select_template_dialog"></div>'); + wrapper.dialog({ + title: "Select template for new instance", + width: 600, + height: 500, + modal: true, + overlay: {opacity: 0.2, background: "black"} + }); + wrapper.load('#{url_for :action => 'select_image'}', null, function() { + $(":submit[name=select]").click(function() { + var checkbox = $("input[name='ids[]']:checked").first(); + var id = checkbox.val(); + if (id !== undefined) { + var name = $(".image_name", checkbox.parent().parent()).text(); + $(".select_image").text(name); + $("input[name='instance[image_id]']").val(id); + } + $("#select_template_dialog").dialog('close'); + return false; + }); + }); + return false; + }); + + $("select[name='instance[pool_id]']").change(function() { + location.href = '#{url_for(:action => "new")}?' + $("#instance_form").serialize(); + }); + }); +.dcloud_form + = error_messages_for 'instance' + %h2 Add a New Instance + %br/ + - form_tag({:action => 'create'}, :id => "instance_form") do + %ul + %li + %label + Name + %span Name for this new Instance + = text_field :instance, :name, :class => "txtfield" + %li + %label + Template + %span Choose a template to use + = link_to(@instance.image ? @instance.image.name : "Select template...", {:action => 'select_image'}, {:class => 'actionlink select_image'}) + %input{:name => "instance[image_id]", :type => "hidden", :value => @instance.image ? @instance.image.id : ''}/ + - if @instance.pool + %input{:name => "instance[pool_id]", :type => "hidden", :value => @instance.pool_id}/ + - if (@pools.size > 1) + %li + %label Pool + = @instance.pool.name + - else + %li + %label + Pool + %span Pick your pool + = select("instance", "pool_id", | + @pools.collect {|p| [ p.name, p.id ] }, | + { :include_blank => true }) | + - if @instance.pool and @instance.pool.hardware_profiles.size > 0 + %li + %label + Hardware Profile + %span Pick your hardware profile + = select("instance", "hardware_profile_id", | + @instance.pool.hardware_profiles.collect {|p| [ p.name, p.id ] }, | + { :include_blank => true }) | + - if @instance.pool and @instance.pool.realms.size > 0 + %li + %label + Realm + %span Choose a realm + = select("instance", "front_end_realm", @instance.pool.realms, { :include_blank => true }) + = submit_tag "Save", :class => "submit" diff --git a/src/app/views/instance/new.html.erb b/src/app/views/instance/new.html.erb deleted file mode 100644 index 499b2cf..0000000 --- a/src/app/views/instance/new.html.erb +++ /dev/null @@ -1,79 +0,0 @@ -<script type="text/javascript"> - $(document).ready(function() { - $(".select_image").click(function() { - var wrapper = $("#select_template_dialog"); - if (wrapper.length == 0) wrapper = $('<div id="select_template_dialog"></div>'); - wrapper.dialog({ - title: "Select template for new instance", - width: 600, - height: 500, - modal: true, - overlay: {opacity: 0.2, background: "black"} - }); - wrapper.load('<%= url_for :action => 'select_image' %>', null, function() { - $(":submit[name=select]").click(function() { - var checkbox = $("input[name='ids[]']:checked").first(); - var id = checkbox.val(); - if (id !== undefined) { - var name = $(".image_name", checkbox.parent().parent()).text(); - $(".select_image").text(name); - $("input[name='instance[image_id]']").val(id); - } - $("#select_template_dialog").dialog('close'); - return false; - }); - }); - return false; - }); - - $("select[name='instance[pool_id]']").change(function() { - location.href = '<%= url_for(:action => "new") %>?' + $("#instance_form").serialize(); - }); - }); -</script> - -<div class="dcloud_form"> - <%= error_messages_for 'instance' %> - - <h2>Add a New Instance</h2><br /> - <% form_tag({:action => 'create'}, - :id => "instance_form") do-%> - <ul> - <li><label>Name<span>Name for this new Instance</span></label><%= text_field :instance, :name, :class => "txtfield" %></li> - - <li><label>Template<span>Choose a template to use</span></label> - <%= link_to(@instance.image ? @instance.image.name : "Select template...", {:action => 'select_image'}, {:class => 'actionlink select_image'}) %> - </li> - <input type=hidden name="instance[image_id]" value="<%= @instance.image ? @instance.image.id : '' %>"> - - <% if @instance.pool %> - <input type=hidden name="instance[pool_id]" value="<%= @instance.pool_id %>"> - <% if (@pools.size > 1) %> - <li><label>Pool</label> - <%= @instance.pool.name %> - </li> - <% end %> - <% else %> - <li><label>Pool<span>Pick your pool</span></label> - <%= select("instance", "pool_id", - @pools.collect {|p| [ p.name, p.id ] }, - { :include_blank => true }) %> - </li> - <% end %> - - <% if @instance.pool and @instance.pool.hardware_profiles.size > 0 %> - <li><label>Hardware Profile<span>Pick your hardware profile</span></label> - <%= select("instance", "hardware_profile_id", - @instance.pool.hardware_profiles.collect {|p| [ p.name, p.id ] }, - { :include_blank => true }) %> - </li> - <% end %> - <% if @instance.pool and @instance.pool.realms.size > 0 %> - <li><label>Realm<span>Choose a realm</span></label> - <%= select("instance", "front_end_realm", @instance.pool.realms, { :include_blank => true }) %> - </li> - <% end %> - </ul> - <%= submit_tag "Save", :class => "submit" %> - <% end %> -</div> diff --git a/src/app/views/instance/show.haml b/src/app/views/instance/show.haml new file mode 100644 index 0000000..8036db2 --- /dev/null +++ b/src/app/views/instance/show.haml @@ -0,0 +1,2 @@ += render :partial => 'instance/instances' += link_to "Add a new instance", :controller => "instance", :action => "new", :id => @pool diff --git a/src/app/views/instance/show.html.erb b/src/app/views/instance/show.html.erb deleted file mode 100644 index 689ead1..0000000 --- a/src/app/views/instance/show.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<%= render :partial => 'instance/instances' %> -<%= link_to "Add a new instance", :controller => "instance", :action => "new", :id => @pool %>
On Wed, 2010-09-01 at 16:05 +0200, jzigmund@redhat.com wrote:
Every patch apply files conversion for one set of views belonging to controller _______________________________________________
ACK to series, and pushed. One note, testing this I noticed there is an error on instance/show/{id}, but this was not introduced by this series. It will need to be corrected at some point soon though, as we need to view instance details.
-j
deltacloud-devel@lists.fedorahosted.org