You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2013/04/26 17:47:01 UTC
[04/14] git commit: Network API rev 3 - Subnet Views (haml)
Network API rev 3 - Subnet Views (haml)
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/a2d52f7d
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/a2d52f7d
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/a2d52f7d
Branch: refs/heads/master
Commit: a2d52f7d9a1003203298ffc0d304b173241148ba
Parents: 765ee10
Author: marios <ma...@redhat.com>
Authored: Fri Apr 12 12:17:30 2013 +0300
Committer: marios <ma...@redhat.com>
Committed: Fri Apr 26 18:01:55 2013 +0300
----------------------------------------------------------------------
server/views/subnets/index.html.haml | 10 ++++++++++
server/views/subnets/index.xml.haml | 4 ++++
server/views/subnets/new.html.haml | 14 ++++++++++++++
server/views/subnets/show.html.haml | 24 ++++++++++++++++++++++++
server/views/subnets/show.xml.haml | 13 +++++++++++++
5 files changed, 65 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a2d52f7d/server/views/subnets/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/subnets/index.html.haml b/server/views/subnets/index.html.haml
new file mode 100644
index 0000000..5442c17
--- /dev/null
+++ b/server/views/subnets/index.html.haml
@@ -0,0 +1,10 @@
+=header "Subnets" do
+ %a{ :href => url_for('subnets/new'), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right'} Create new subnet
+
+%div{ :'data-role' => :content, :'data-theme' => 'c'}
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
+ - @elements.each do |subnet|
+ %li
+ %a{ :href => subnet_url(subnet.id), :'data-ajax' => 'false'}
+ %img{ :class => 'ui-link-thumb', :src => '/images/cloud.png'}
+ %h3=subnet.id
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a2d52f7d/server/views/subnets/index.xml.haml
----------------------------------------------------------------------
diff --git a/server/views/subnets/index.xml.haml b/server/views/subnets/index.xml.haml
new file mode 100644
index 0000000..5079a8d
--- /dev/null
+++ b/server/views/subnets/index.xml.haml
@@ -0,0 +1,4 @@
+!!!XML
+%subnets
+ - @elements.each do |c|
+ = haml :'subnets/show', :locals => { :subnet => c, :partial => true }
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a2d52f7d/server/views/subnets/new.html.haml
----------------------------------------------------------------------
diff --git a/server/views/subnets/new.html.haml b/server/views/subnets/new.html.haml
new file mode 100644
index 0000000..c542d8e
--- /dev/null
+++ b/server/views/subnets/new.html.haml
@@ -0,0 +1,14 @@
+=header "Create new subnet"
+
+%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
+ %form{ :action => subnets_url, :method => :post}
+ %div{ 'data-role' => :fieldcontain }
+ %p
+ %label{ :for => :network_id} Network ID:
+ %p
+ %input{ :type => :text, :id => :network_id, :name => :network_id, :value => '' }
+ %p
+ %label{ :for => :address_block} CIDR Address block:
+ %p
+ %input{ :type => :text, :id => :address_block, :name => :address_block, :value => '' }
+ %button{ :type => :submit} Create subnet
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a2d52f7d/server/views/subnets/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/subnets/show.html.haml b/server/views/subnets/show.html.haml
new file mode 100644
index 0000000..dcb33c9
--- /dev/null
+++ b/server/views/subnets/show.html.haml
@@ -0,0 +1,24 @@
+=header "Subnet"
+=subheader @subnet.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'}=@subnet.id
+ %li{ :'data-role' => 'list-divider'} Name
+ %li
+ %p{ :'data-role' => 'fieldcontain'}=@subnet.name
+ %li{ :'data-role' => 'list-divider'} Network
+ %li
+ %a{ :href => network_url(@subnet.network.strip), :'data-ajax'=>'false' }=@subnet.network
+ %li{ :'data-role' => 'list-divider'} State
+ %li
+ %p{ :'data-role' => 'fieldcontain'}=@subnet.state
+ %li{ :'data-role' => 'list-divider'} Address Block
+ %li
+ %p{ :'data-role' => 'fieldcontain'}=(@subnet.address_block ? @subnet.address_block : nil)
+ %li{ :'data-role' => 'list-divider'} Actions
+ %li
+ %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
+ =link_to_action "Destroy", destroy_subnet_url(@subnet.id), :delete
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a2d52f7d/server/views/subnets/show.xml.haml
----------------------------------------------------------------------
diff --git a/server/views/subnets/show.xml.haml b/server/views/subnets/show.xml.haml
new file mode 100644
index 0000000..75363af
--- /dev/null
+++ b/server/views/subnets/show.xml.haml
@@ -0,0 +1,13 @@
+- unless defined?(partial)
+ !!! XML
+%subnet{ :href => subnet_url(subnet.id), :id => subnet.id }
+ %name=subnet.name
+ %state<
+ =subnet.state
+ %address_block
+ =subnet.address_block
+ %network
+ =subnet.network
+ %actions
+ - if driver.respond_to?(:destroy_subnet)
+ %link{ :rel => "destroy", :method => "delete", :href => destroy_subnet_url(subnet.id)}