deltacloud-commits mailing list archives

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


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

Branch: refs/heads/master
Commit: 765ee10afe0594a1ccdaec95805f52e73a116a62
Parents: da7f912
Author: marios <marios@redhat.com>
Authored: Fri Apr 12 12:17:06 2013 +0300
Committer: marios <marios@redhat.com>
Committed: Fri Apr 26 18:01:55 2013 +0300

----------------------------------------------------------------------
 server/views/networks/index.html.haml |   10 ++++++++++
 server/views/networks/index.xml.haml  |    4 ++++
 server/views/networks/new.html.haml   |   10 ++++++++++
 server/views/networks/show.html.haml  |   25 +++++++++++++++++++++++++
 server/views/networks/show.xml.haml   |   15 +++++++++++++++
 5 files changed, 64 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


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

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

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/765ee10a/server/views/networks/new.html.haml
----------------------------------------------------------------------
diff --git a/server/views/networks/new.html.haml b/server/views/networks/new.html.haml
new file mode 100644
index 0000000..0087259
--- /dev/null
+++ b/server/views/networks/new.html.haml
@@ -0,0 +1,10 @@
+=header "Create new network"
+
+%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
+  %form{ :action => networks_url, :method => :post}
+    %div{ 'data-role' => :fieldcontain }
+      %p
+        %label{ :for => :address_block} CIDR Address block (optional):
+      %p
+        %input{ :type => :text, :id => :address_block, :name => :address_block,
:value => '' }
+    %button{ :type => :submit} Create network

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/765ee10a/server/views/networks/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/networks/show.html.haml b/server/views/networks/show.html.haml
new file mode 100644
index 0000000..89a636e
--- /dev/null
+++ b/server/views/networks/show.html.haml
@@ -0,0 +1,25 @@
+=header "Network"
+=subheader @network.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.id
+    %li{ :'data-role' => 'list-divider'} Name
+    %li
+      %p{ :'data-role' => 'fieldcontain'}=@network.name
+    %li{ :'data-role' => 'list-divider'} State
+    %li
+      %p{ :'data-role' => 'fieldcontain'}=@network.state
+    %li{ :'data-role' => 'list-divider'} Address Blocks
+    %li
+      %p{ :'data-role' => 'fieldcontain'}=(@network.address_blocks ? @network.address_blocks.join(",")
: nil)
+    %li{ :'data-role' => 'list-divider'} Subnets
+    -@network.subnets.each do |sn|
+      %li
+        %a{ :href => subnet_url(sn.strip), :'data-ajax'=>'false' }=sn
+    %li{ :'data-role' => 'list-divider'} Actions
+    %li
+      %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
+        =link_to_action "Destroy", destroy_network_url(@network.id), :delete

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/765ee10a/server/views/networks/show.xml.haml
----------------------------------------------------------------------
diff --git a/server/views/networks/show.xml.haml b/server/views/networks/show.xml.haml
new file mode 100644
index 0000000..16f9e41
--- /dev/null
+++ b/server/views/networks/show.xml.haml
@@ -0,0 +1,15 @@
+- unless defined?(partial)
+  !!! XML
+%network{ :href => network_url(network.id), :id => network.id }
+  %name=network.name
+  %state<
+    =network.state
+  %address_blocks
+    - network.address_blocks.each do |addr_block|
+      %address_block=addr_block
+  %subnets
+    - (network.subnets || []).each do |subnet|
+      %subnet{:href => subnet_url(subnet), :id=>subnet}
+  %actions
+    - if driver.respond_to?(:destroy_network)
+      %link{ :rel => "destroy", :method => "delete", :href => destroy_network_url(network.id)}


Mime
View raw message