From: NjeriChelimo <[email protected]>
---
clients/cimi/views/machine_templates/index.haml | 50 +++++++++++++++++++++--
1 file changed, 46 insertions(+), 4 deletions(-)
diff --git a/clients/cimi/views/machine_templates/index.haml
b/clients/cimi/views/machine_templates/index.haml
index 3daff47..3077bf7 100644
--- a/clients/cimi/views/machine_templates/index.haml
+++ b/clients/cimi/views/machine_templates/index.haml
@@ -1,4 +1,4 @@
-- @title=@machine_templates.description
+- @title=collection_name @machine_templates
- content_for :breadcrumb do
%ul.breadcrumb
@@ -9,6 +9,49 @@
MachineTemplateCollection
+
+
+
+- content_for :actions do
+
+ %p
+ %a{ :href => '#machineTemplateModal', :class => 'btn btn-primary',
:'data-toggle' => :modal} New Machine Template
+
+ %div{ :id => :machineTemplateModal, :class => 'modal hide fade' }
+ .modal-header
+ %h3 Create new Machine Template
+ .modal-body
+ %form{ :action => "/cimi/machine_templates", :method => :post }
+ %fieldset
+ .control-group
+ %label.control-label{ :for => 'machine_template[name]' } Machine
Template Name
+ .controls
+ %input{ :type => :text, :name => 'machine_template[name]' }
+ %label.control-label{ :for => 'machine_template[machine_image]' }
Machine Image
+ .controls
+ %select{ :name => 'machine_template[machine_image]' }
+ - @machine_images.machine_images.each do |image|
+ %option{ :value => image.id }=href_to_id(image.id)
+ %label.control-label{ :for =>
'machine_template[machine_configuration]' } Machine Configuration
+ .controls
+ %select{ :name => 'machine_template[machine_configuration]' }
+ - @machine_configurations.machine_configurations.each do
|configuration|
+ %option{ :value => configuration.id
}=href_to_id(configuration.id)
+ .modal-footer
+ %a{ :href => '#', :class => 'btn btn-primary', :'data-loading-text' =>
'Creating MachineTemplate...', :onclick => "postModalForm(this,
'machineTemplateModal')"} Continue
+ %a{ :href => '#', :class => 'btn', :'data-dismiss' => 'modal'} Cancel
+ %p{:style => 'text-align:right;'}
+ %a{ :href => "#{@machine_templates.id}?format=xml", :class => 'label
warning' } XML
+ %a{ :href => "#{@machine_templates.id}?format=json", :class => 'label
warning' } JSON
+
+
+
+
+
+
+
+
+
%blockquote
%p
A Machine Template Collection entity represents the collection of
@@ -19,9 +62,8 @@
%ul
- @machine_templates.machine_templates.each do |temp|
%li
- %a{ :href =>
"/cimi/machine_templates/#{temp.href.split('/').last}"}=temp.href.split('/').last
+ %a{ :href =>
"/cimi/machine_templates/#{href_to_id(temp.id)}"}=href_to_id(temp.id)
-details 'MachineTemplateCollection details' do
-row 'id',@machine_templates.id
- -row 'Description',@machine_templates.description
- -row 'Created',@machine_templates.created
+ -row 'Count',@machine_templates.count
--
1.7.9.5