deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [09/14] git commit: Network API rev 3 - NetworkInterface Views (haml)
Date Fri, 26 Apr 2013 15:47:06 GMT
Network API rev 3 - NetworkInterface Views (haml)


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/da7f912d
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/da7f912d
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/da7f912d

Branch: refs/heads/master
Commit: da7f912d846381f58e7877f4694cbcc4fa022d67
Parents: 3aefaac
Author: marios <marios@redhat.com>
Authored: Fri Apr 12 12:15:47 2013 +0300
Committer: marios <marios@redhat.com>
Committed: Fri Apr 26 18:01:55 2013 +0300

----------------------------------------------------------------------
 server/views/network_interfaces/index.html.haml |   10 ++++++
 server/views/network_interfaces/index.xml.haml  |    4 ++
 server/views/network_interfaces/new.html.haml   |   20 ++++++++++++
 server/views/network_interfaces/show.html.haml  |   29 ++++++++++++++++++
 server/views/network_interfaces/show.xml.haml   |   13 ++++++++
 5 files changed, 76 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/da7f912d/server/views/network_interfaces/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/network_interfaces/index.html.haml b/server/views/network_interfaces/index.html.haml
new file mode 100644
index 0000000..d0bfed7
--- /dev/null
+++ b/server/views/network_interfaces/index.html.haml
@@ -0,0 +1,10 @@
+=header "Network Interfaces" do
+  %a{ :href => url_for('network_interfaces/new'), :'data-icon' => :plus, :'data-role'
=> :button, :class => 'ui-btn-right'} Create new Network Interface
+
+%div{ :'data-role' => :content, :'data-theme' => 'c'}
+  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' =>
'a'}
+    - @elements.each do |nic|
+      %li
+        %a{ :href => network_interface_url(nic.id), :'data-ajax' => 'false'}
+          %img{ :class => 'ui-link-thumb', :src => '/images/cloud.png'}
+          %h3=nic.id

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/da7f912d/server/views/network_interfaces/index.xml.haml
----------------------------------------------------------------------
diff --git a/server/views/network_interfaces/index.xml.haml b/server/views/network_interfaces/index.xml.haml
new file mode 100644
index 0000000..2f012d3
--- /dev/null
+++ b/server/views/network_interfaces/index.xml.haml
@@ -0,0 +1,4 @@
+!!!XML
+%network_interfaces
+  - @elements.each do |c|
+    = haml :'network_interfaces/show', :locals => { :network_interface => c, :subnets
=> subnets, :partial => true }

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/da7f912d/server/views/network_interfaces/new.html.haml
----------------------------------------------------------------------
diff --git a/server/views/network_interfaces/new.html.haml b/server/views/network_interfaces/new.html.haml
new file mode 100644
index 0000000..608b820
--- /dev/null
+++ b/server/views/network_interfaces/new.html.haml
@@ -0,0 +1,20 @@
+=header "Create new Network Interface"
+
+%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
+  %form{ :action => network_interfaces_url, :method => :post}
+    %div{ 'data-role' => :fieldcontain }
+      %p
+        %label{ :for => :name} Name (optional):
+      %p
+        %input{ :type => :text, :id => :name, :name => :name, :value => '' }
+    %div{ 'data-role' => :fieldcontain }
+      %label{ :for => :instance, :class => 'ui-input-text'} Instance for attachment:
+      %select{:name => 'instance', :'data-native-menu' => "true" }
+        - instances.each do |inst|
+          %option{ :value => inst.id } #{inst.id}
+    %div{ 'data-role' => :fieldcontain }
+      %label{ :for => :network, :class => 'ui-input-text'} Network to attach to:
+      %select{:name => 'network', :'data-native-menu' => "true" }
+        - networks.each do |net|
+          %option{ :value => net.id } #{net.id}
+    %button{ :type => :submit} Create Network Interface

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/da7f912d/server/views/network_interfaces/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/network_interfaces/show.html.haml b/server/views/network_interfaces/show.html.haml
new file mode 100644
index 0000000..877dd0f
--- /dev/null
+++ b/server/views/network_interfaces/show.html.haml
@@ -0,0 +1,29 @@
+=header "Network Interface"
+=subheader network_interface.id
+
+%div{ :'data-role' => :content, :'data-theme' => 'c'}
+  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' =>
'd'}
+    %li{ :'data-role' => 'list-divider'} Identifier
+    %li
+      %p{ :'data-role' => 'fieldcontain'}=network_interface.id
+    %li{ :'data-role' => 'list-divider'} Name
+    %li
+      %p{ :'data-role' => 'fieldcontain'}=network_interface.name
+    %li{ :'data-role' => 'list-divider'} IP Address
+    %li
+      %p{ :'data-role' => 'fieldcontain'}=network_interface.ip_address
+    -if subnets
+      %li{ :'data-role' => 'list-divider'} Network (subnet)
+      %li
+        %a{ :href => subnet_url(network_interface.network), :'data-ajax'=>'false' }=network_interface.network
+    -else
+      %li{ :'data-role' => 'list-divider'} Network
+      %li
+        %a{ :href => network_url(network_interface.network), :'data-ajax'=>'false'
}=network_interface.network
+    %li{ :'data-role' => 'list-divider'} Instance
+    %li
+      %a{ :href => instance_url(network_interface.instance), :'data-ajax'=>'false'
}=network_interface.instance
+    %li{ :'data-role' => 'list-divider'} Actions
+    %li
+      %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
+        =link_to_action "Destroy", destroy_network_interface_url(network_interface.id), :delete

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/da7f912d/server/views/network_interfaces/show.xml.haml
----------------------------------------------------------------------
diff --git a/server/views/network_interfaces/show.xml.haml b/server/views/network_interfaces/show.xml.haml
new file mode 100644
index 0000000..995cb7b
--- /dev/null
+++ b/server/views/network_interfaces/show.xml.haml
@@ -0,0 +1,13 @@
+- unless defined?(partial)
+  !!! XML
+%network_interface{ :href => network_interface_url(network_interface.id), :id => network_interface.id
}
+  %name=network_interface.name
+  %ip_address=network_interface.ip_address
+  -if subnets
+    %network{:href => subnet_url(network_interface.network), :rel => "subnet", :id
=> network_interface.network} #{network_interface.network}
+  -else
+    %network{:href => network_url(network_interface.network), :rel => "network", :id
=> network_interface.network} #{network_interface.network}
+  %instance{:href => instance_url(network_interface.instance), :id=>network_interface.instance}
#{network_interface.instance}
+  %actions
+    - if driver.respond_to?(:destroy_network_interface)
+      %link{ :rel => "destroy", :method => "delete", :href => destroy_network_interface_url(network_interface.id)}


Mime
View raw message