From: Jozef Zigmund <[email protected]>
---
src/app/views/quota/edit.haml | 17 +++++++++++++++++
src/app/views/quota/edit.html.erb | 18 ------------------
src/app/views/quota/show.haml | 21 +++++++++++++++++++++
src/app/views/quota/show.html.erb | 27 ---------------------------
4 files changed, 38 insertions(+), 45 deletions(-)
create mode 100644 src/app/views/quota/edit.haml
delete mode 100644 src/app/views/quota/edit.html.erb
create mode 100644 src/app/views/quota/show.haml
delete mode 100644 src/app/views/quota/show.html.erb
diff --git a/src/app/views/quota/edit.haml b/src/app/views/quota/edit.haml
new file mode 100644
index 0000000..f8a13aa
--- /dev/null
+++ b/src/app/views/quota/edit.haml
@@ -0,0 +1,17 @@
+.dcloud_form
+ = error_messages_for @parent_type
+ = error_messages_for 'quota'
+ %h2
+ Edit Quota for #...@parent_type + ": " + @name}
+ %br/
+ - form_tag :action => 'update' do
+ = hidden_field_tag 'id', @parent.id
+ = hidden_field_tag 'parent_type', @parent_type
+ %ul
+ %li
+ %label Max Running Instances
+ = text_field :quota, :maximum_running_instances
+ %li
+ %label Max Total Instances
+ = text_field :quota, :maximum_total_instances
+ = submit_tag "Save", :class => "submit"
diff --git a/src/app/views/quota/edit.html.erb
b/src/app/views/quota/edit.html.erb
deleted file mode 100644
index 8d9ae97..0000000
--- a/src/app/views/quota/edit.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-<div class="dcloud_form">
- <%= error_messages_for @parent_type %>
- <%= error_messages_for 'quota' %>
-
- <h2>Edit Quota for <%= @parent_type + ": " + @name%></legend></h2><br />
-
- <% form_tag :action => 'update' do -%>
- <%=hidden_field_tag 'id', @parent.id %>
- <%=hidden_field_tag 'parent_type', @parent_type %>
-
- <ul>
- <li><label>Max Running Instances</label><%= text_field :quota,
:maximum_running_instances %></li>
- <li><label>Max Total Instances</label><%= text_field :quota,
:maximum_total_instances %></li>
- </ul>
- </fieldset>
- <%= submit_tag "Save", :class => "submit" %>
- <% end %>
-</div>
\ No newline at end of file
diff --git a/src/app/views/quota/show.haml b/src/app/views/quota/show.haml
new file mode 100644
index 0000000..1c229a8
--- /dev/null
+++ b/src/app/views/quota/show.haml
@@ -0,0 +1,21 @@
+- if !...@quota
+ %h1
+ There is no Quota on this #...@parent_type}
+- else
+ %table
+ %thead
+ %tr
+ %th{:scope => "col"} Resource
+ %th{:scope => "col"} Max Capacity
+ %th{:scope => "col"} Used
+ %th{:scope => "col"} Available
+ %tbody
+ - quota_resources = @quota.quota_resources
+ - quota_resources.each_value do |quota_resource|
+ %tr
+ %td= quota_resource.name + " " + quota_resource.unit
+ %td= quota_resource.max
+ %td= quota_resource.used
+ %td= quota_resource.available
+ = link_to "Edit", {:action => "edit", :id => @parent, :parent_type =>
@parent_type}, :class=>"actionlink"
+ = link_to "Reset", {:action => "reset", :id => @parent, :parent_type =>
@parent_type}, :class=>"actionlink"
diff --git a/src/app/views/quota/show.html.erb
b/src/app/views/quota/show.html.erb
deleted file mode 100644
index 136f65a..0000000
--- a/src/app/views/quota/show.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<% if !...@quota %>
-<h1>There is no Quota on this <%= @parent_type %></h1>
-<% else %>
- <table>
- <thead>
- <tr>
- <th scope="col">Resource</th>
- <th scope="col">Max Capacity</th>
- <th scope="col">Used</th>
- <th scope="col">Available</th>
- </tr>
- </thead>
- <tbody>
- <% quota_resources = @quota.quota_resources
- quota_resources.each_value do |quota_resource| %>
- <tr>
- <td><%= quota_resource.name + " " + quota_resource.unit%></td>
- <td><%= quota_resource.max %></td>
- <td><%= quota_resource.used %></td>
- <td><%= quota_resource.available %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- <%= link_to "Edit", {:action => "edit", :id => @parent, :parent_type =>
@parent_type}, :class=>"actionlink"%>
- <%= link_to "Reset", {:action => "reset", :id => @parent, :parent_type =>
@parent_type}, :class=>"actionlink"%>
-<% end %>
\ No newline at end of file
--
1.7.2.2
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel