incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lutterkort <lut...@redhat.com>
Subject Re: ['PATCH' 2/4] Adds haml views for buckets and blobs - part of blobstore API
Date Wed, 22 Sep 2010 22:31:01 GMT
On Mon, 2010-09-20 at 19:52 +0100, mandreou@redhat.com wrote:
> From: marios <marios@redhat.com>
> 
> ---
>  server/views/blobs/show.html.haml    |   21 ++++++++++++++++++++
>  server/views/blobs/show.xml.haml     |    7 ++++++
>  server/views/buckets/index.html.haml |   35 ++++++++++++++++++++++++++++++++++
>  server/views/buckets/index.xml.haml  |    8 +++++++
>  server/views/buckets/new.html.haml   |   13 ++++++++++++
>  server/views/buckets/show.html.haml  |   19 ++++++++++++++++++
>  server/views/buckets/show.xml.haml   |    9 ++++++++
>  7 files changed, 112 insertions(+), 0 deletions(-)
>  create mode 100644 server/views/blobs/show.html.haml
>  create mode 100644 server/views/blobs/show.xml.haml
>  create mode 100644 server/views/buckets/index.html.haml
>  create mode 100644 server/views/buckets/index.xml.haml
>  create mode 100644 server/views/buckets/new.html.haml
>  create mode 100644 server/views/buckets/show.html.haml
>  create mode 100644 server/views/buckets/show.xml.haml

Looks good. One question:

> diff --git a/server/views/buckets/show.xml.haml b/server/views/buckets/show.xml.haml
> new file mode 100644
> index 0000000..e61470f
> --- /dev/null
> +++ b/server/views/buckets/show.xml.haml
> @@ -0,0 +1,9 @@
> +!!! 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}
                                         ^^^^^^^^^

Do you really mean that or do you mean bucket_url(@bucket.id) + blb ? Or
maybe something entirely different ? The Rabbit DSL doesn't have a
notion of nesting resources, so it might be easier to just manually
create helpers like 'blob_in_bucket_url(bucket_id, blob_id)'

David



Mime
View raw message