incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r1000439 - in /incubator/deltacloud/trunk/server/views: blobs/ blobs/show.html.haml blobs/show.xml.haml buckets/ buckets/index.html.haml buckets/index.xml.haml buckets/new.html.haml buckets/show.html.haml buckets/show.xml.haml
Date Thu, 23 Sep 2010 12:55:43 GMT
Author: marios
Date: Thu Sep 23 12:55:42 2010
New Revision: 1000439

URL: http://svn.apache.org/viewvc?rev=1000439&view=rev
Log:
Adds haml views for buckets and blobs - part of blobstore API

Added:
    incubator/deltacloud/trunk/server/views/blobs/
    incubator/deltacloud/trunk/server/views/blobs/show.html.haml
    incubator/deltacloud/trunk/server/views/blobs/show.xml.haml
    incubator/deltacloud/trunk/server/views/buckets/
    incubator/deltacloud/trunk/server/views/buckets/index.html.haml
    incubator/deltacloud/trunk/server/views/buckets/index.xml.haml
    incubator/deltacloud/trunk/server/views/buckets/new.html.haml
    incubator/deltacloud/trunk/server/views/buckets/show.html.haml
    incubator/deltacloud/trunk/server/views/buckets/show.xml.haml

Added: incubator/deltacloud/trunk/server/views/blobs/show.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/blobs/show.html.haml?rev=1000439&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/blobs/show.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/blobs/show.html.haml Thu Sep 23 12:55:42 2010
@@ -0,0 +1,20 @@
+%h1 Blob
+%h2
+  = @blob.id
+
+%dl
+  %dt bucket
+  %dd
+    = @blob.bucket
+  %dt Content_Length
+  %dd
+    = @blob.content_length
+  %dt Content_Type
+  %dd
+    = @blob.content_type
+  %dt Last_Modified
+  %dd
+    = @blob.last_modified
+  %dt Content
+  %dd
+    =link_to 'Blob content', bucket_url(@blob.bucket) + '/' + @blob.id + '/content'

Added: incubator/deltacloud/trunk/server/views/blobs/show.xml.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/blobs/show.xml.haml?rev=1000439&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/blobs/show.xml.haml (added)
+++ incubator/deltacloud/trunk/server/views/blobs/show.xml.haml Thu Sep 23 12:55:42 2010
@@ -0,0 +1,7 @@
+!!! XML
+%blob{:href => bucket_url(@blob.bucket) + '/' + @blob.id, :id => @blob.id}
+  - @blob.attributes.select{ |attr| attr!=:id}.each do |attribute|
+    - unless attribute == :content
+      - haml_tag(attribute, :<) do
+        - haml_concat @blob.send(attribute)
+  %content{:href => bucket_url(@blob.bucket) + '/' + @blob.id + '/content'}

Added: incubator/deltacloud/trunk/server/views/buckets/index.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/buckets/index.html.haml?rev=1000439&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/buckets/index.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/buckets/index.html.haml Thu Sep 23 12:55:42 2010
@@ -0,0 +1,33 @@
+%h1
+  Buckets
+%br
+%p
+  =link_to 'Create new bucket', "/api/buckets/new"
+
+%table.display
+  %thead
+    %tr
+      %th
+        ID
+      %th
+        Name
+      %th
+        Size
+      %th
+        Blob List
+      %th
+
+  %tbody
+    - @buckets.each do |bucket|
+      %tr
+        %td
+          = link_to bucket.id, bucket_url(bucket.id)
+        %td
+          = bucket.name
+        %td
+          = bucket.size
+        %td
+          -bucket.blob_list.each do |blob|
+            = blob
+        %td
+          =link_to 'Delete', destroy_bucket_url(bucket.name), :class => 'delete'

Added: incubator/deltacloud/trunk/server/views/buckets/index.xml.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/buckets/index.xml.haml?rev=1000439&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/buckets/index.xml.haml (added)
+++ incubator/deltacloud/trunk/server/views/buckets/index.xml.haml Thu Sep 23 12:55:42 2010
@@ -0,0 +1,7 @@
+!!! XML
+%buckets
+  - @elements.each do |bucket|
+    %bucket{:href => bucket_url(bucket.id), :id => bucket.id}
+      - bucket.attributes.select{ |attr| attr!=:id }.each do |attribute|
+        - haml_tag("#{attribute}".tr('-', '_'), :<) do
+          - haml_concat bucket.send(attribute)

Added: incubator/deltacloud/trunk/server/views/buckets/new.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/buckets/new.html.haml?rev=1000439&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/buckets/new.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/buckets/new.html.haml Thu Sep 23 12:55:42 2010
@@ -0,0 +1,13 @@
+%h1 New Bucket
+
+%form{ :action => buckets_url, :method => :post }
+  %label
+    Bucket Name:
+    %input{ :name => 'name', :size => 250}/
+    %br
+  -if driver_has_bucket_location_feature?
+    %p
+      %label
+        Location: (optional)
+        %input{ :name => 'location', :size => 20 }/
+  %input{ :type => :submit, :name => "commit", :value => "create"}/

Added: incubator/deltacloud/trunk/server/views/buckets/show.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/buckets/show.html.haml?rev=1000439&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/buckets/show.html.haml (added)
+++ incubator/deltacloud/trunk/server/views/buckets/show.html.haml Thu Sep 23 12:55:42 2010
@@ -0,0 +1,19 @@
+%h1 Bucket
+%h2
+  = @bucket.id
+
+%dl
+  %di
+    %dt Name
+    %dd
+      = @bucket.name
+    %dt Size
+    %dd
+      = @bucket.size
+    %dt Blobs
+    %dd
+      -@bucket.blob_list.each do |blob|
+        = link_to blob, bucket_url(@bucket.name) + '/' + blob
+    %dt delete bucket (must be empty)
+    %dd
+      =link_to 'Delete', destroy_bucket_url(@bucket.name), :class => 'delete'

Added: incubator/deltacloud/trunk/server/views/buckets/show.xml.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/buckets/show.xml.haml?rev=1000439&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/views/buckets/show.xml.haml (added)
+++ incubator/deltacloud/trunk/server/views/buckets/show.xml.haml Thu Sep 23 12:55:42 2010
@@ -0,0 +1,8 @@
+!!! XML
+%bucket{:href => bucket_url(@bucket.id), :id => @bucket.id}
+  - @bucket.attributes.select{ |attr| attr!=:id }.each do |attribute|
+    - unless attribute == :blob_list
+      -haml_tag(attribute, :<) do
+        - haml_concat @bucket.send(attribute)
+  - @bucket.blob_list.each do |blb|
+    %blob{:href => bucket_url(@bucket.id + blb), :id => blb}



Mime
View raw message