From: Michal Fojtik mfojtik@redhat.com
* Replaced almost every ERB view with HAML * Fixed year in copyright (application layout)
--- server/libexec/app/views/accounts/index.html.erb | 16 ---- server/libexec/app/views/accounts/index.html.haml | 10 ++ server/libexec/app/views/accounts/show.html.erb | 41 --------- server/libexec/app/views/accounts/show.html.haml | 14 +++ server/libexec/app/views/flavors/index.html.erb | 35 -------- server/libexec/app/views/flavors/index.html.haml | 22 +++++ server/libexec/app/views/flavors/show.html.erb | 28 ------ server/libexec/app/views/flavors/show.html.haml | 16 ++++ .../app/views/hardware_profiles/index.html.haml | 49 ++++++----- server/libexec/app/views/images/index.html.erb | 41 --------- server/libexec/app/views/images/index.html.haml | 30 +++++++ server/libexec/app/views/images/show.html.erb | 42 --------- server/libexec/app/views/images/show.html.haml | 22 +++++ .../app/views/instance_states/show.html.erb | 53 ------------ .../app/views/instance_states/show.html.haml | 31 +++++++ server/libexec/app/views/instances/index.html.erb | 68 --------------- server/libexec/app/views/instances/index.html.haml | 33 +++++++ server/libexec/app/views/instances/show.html.erb | 88 -------------------- server/libexec/app/views/instances/show.html.haml | 41 +++++++++ .../app/views/layouts/application.html.haml | 4 +- server/libexec/app/views/realms/index.html.erb | 35 -------- server/libexec/app/views/realms/index.html.haml | 29 +++++++ server/libexec/app/views/realms/show.html.erb | 28 ------ server/libexec/app/views/realms/show.html.haml | 15 ++++ server/libexec/app/views/root/index.html.erb | 5 - server/libexec/app/views/root/index.html.haml | 4 + .../app/views/storage_snapshots/index.html.erb | 35 -------- .../app/views/storage_snapshots/index.html.haml | 20 +++++ .../app/views/storage_snapshots/show.html.erb | 29 ------- .../app/views/storage_snapshots/show.html.haml | 14 +++ .../app/views/storage_volumes/index.html.erb | 35 -------- .../app/views/storage_volumes/index.html.haml | 21 +++++ .../app/views/storage_volumes/show.html.erb | 39 --------- .../app/views/storage_volumes/show.html.haml | 20 +++++ 34 files changed, 371 insertions(+), 642 deletions(-) delete mode 100644 server/libexec/app/views/accounts/index.html.erb create mode 100644 server/libexec/app/views/accounts/index.html.haml delete mode 100644 server/libexec/app/views/accounts/show.html.erb create mode 100644 server/libexec/app/views/accounts/show.html.haml delete mode 100644 server/libexec/app/views/flavors/index.html.erb create mode 100644 server/libexec/app/views/flavors/index.html.haml delete mode 100644 server/libexec/app/views/flavors/show.html.erb create mode 100644 server/libexec/app/views/flavors/show.html.haml delete mode 100644 server/libexec/app/views/images/index.html.erb create mode 100644 server/libexec/app/views/images/index.html.haml delete mode 100644 server/libexec/app/views/images/show.html.erb create mode 100644 server/libexec/app/views/images/show.html.haml delete mode 100644 server/libexec/app/views/instance_states/show.html.erb create mode 100644 server/libexec/app/views/instance_states/show.html.haml delete mode 100644 server/libexec/app/views/instances/index.html.erb create mode 100644 server/libexec/app/views/instances/index.html.haml delete mode 100644 server/libexec/app/views/instances/show.html.erb create mode 100644 server/libexec/app/views/instances/show.html.haml delete mode 100644 server/libexec/app/views/realms/index.html.erb create mode 100644 server/libexec/app/views/realms/index.html.haml delete mode 100644 server/libexec/app/views/realms/show.html.erb create mode 100644 server/libexec/app/views/realms/show.html.haml delete mode 100644 server/libexec/app/views/root/index.html.erb create mode 100644 server/libexec/app/views/root/index.html.haml delete mode 100644 server/libexec/app/views/storage_snapshots/index.html.erb create mode 100644 server/libexec/app/views/storage_snapshots/index.html.haml delete mode 100644 server/libexec/app/views/storage_snapshots/show.html.erb create mode 100644 server/libexec/app/views/storage_snapshots/show.html.haml delete mode 100644 server/libexec/app/views/storage_volumes/index.html.erb create mode 100644 server/libexec/app/views/storage_volumes/index.html.haml delete mode 100644 server/libexec/app/views/storage_volumes/show.html.erb create mode 100644 server/libexec/app/views/storage_volumes/show.html.haml
diff --git a/server/libexec/app/views/accounts/index.html.erb b/server/libexec/app/views/accounts/index.html.erb deleted file mode 100644 index a9b9d88..0000000 --- a/server/libexec/app/views/accounts/index.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -<h1>Accounts</h1> - -<table> - <tr> - <th> - ID - </th> - </tr> - <% for account in @accounts %> - <tr> - <td> - <%= link_to account, account %> - </td> - </tr> - <% end %> -</table> diff --git a/server/libexec/app/views/accounts/index.html.haml b/server/libexec/app/views/accounts/index.html.haml new file mode 100644 index 0000000..7aee4c9 --- /dev/null +++ b/server/libexec/app/views/accounts/index.html.haml @@ -0,0 +1,10 @@ +%h1 Accounts + +%table + %thead + %th ID + %tbody + - @accounts.each do |account| + %tr + %td + = link_to account, account diff --git a/server/libexec/app/views/accounts/show.html.erb b/server/libexec/app/views/accounts/show.html.erb deleted file mode 100644 index a445154..0000000 --- a/server/libexec/app/views/accounts/show.html.erb +++ /dev/null @@ -1,41 +0,0 @@ -<h1><%= @account[:id] %></h1> - -<h2>Instances</h2> - -<table> - <tr> - <th> - Instance ID - </th> - </tr> - <% for instance_id in @account[:instance_ids] %> - <tr> - <td> - <%= link_to instance_id, instance_url( instance_id ) %> - </td> - </tr> - <% end %> -</table> - -<h2>Images</h2> - -<table> - <tr> - <th> - Image ID - </th> - <th> - Description - </th> - </tr> - <% for image in @images %> - <tr> - <td> - <%= link_to image[:id], image_url( image[:id] ) %> - </td> - <td> - <%= image[:description] %> - </td> - </tr> - <% end %> -</table> diff --git a/server/libexec/app/views/accounts/show.html.haml b/server/libexec/app/views/accounts/show.html.haml new file mode 100644 index 0000000..c09e63c --- /dev/null +++ b/server/libexec/app/views/accounts/show.html.haml @@ -0,0 +1,14 @@ +%h1 + = @account[:id] + +%h2 Instances + +%table + %thead + %tr + %th Instance ID + %tbody + - @account[:instance_ids].each do |instance_id| + %tr + %td + = link_to instance_id, instance_url( instance_id ) diff --git a/server/libexec/app/views/flavors/index.html.erb b/server/libexec/app/views/flavors/index.html.erb deleted file mode 100644 index 8becc1d..0000000 --- a/server/libexec/app/views/flavors/index.html.erb +++ /dev/null @@ -1,35 +0,0 @@ - -<h1>Flavors</h1> - -<table> - <tr> - <th> - ID - </th> - <th> - Architecture - </th> - <th> - Memory - </th> - <th> - Storage - </th> - </tr> - <% for flavor in @flavors %> - <tr> - <td> - <%= link_to flavor.id, flavor_url( flavor.id ) %> - </td> - <td> - <%= flavor.architecture %> - </td> - <td> - <%= flavor.memory %> GB - </td> - <td> - <%= flavor.storage %> GB - </td> - </tr> - <% end %> -</table> diff --git a/server/libexec/app/views/flavors/index.html.haml b/server/libexec/app/views/flavors/index.html.haml new file mode 100644 index 0000000..3beee0b --- /dev/null +++ b/server/libexec/app/views/flavors/index.html.haml @@ -0,0 +1,22 @@ +%h1 + Flavors + +%table.display + %thead + %tr + %th ID + %th Architecture + %th Memory + %th Storage + %tbody + - @flavors.each do |flavor| + %tr + %td + = link_to flavor.id, flavor_url( flavor.id ) + %td + = flavor.architecture + %td + = "#{flavor.memory} GB" + %td + = "#{flavor.storage} GB" + diff --git a/server/libexec/app/views/flavors/show.html.erb b/server/libexec/app/views/flavors/show.html.erb deleted file mode 100644 index e17936c..0000000 --- a/server/libexec/app/views/flavors/show.html.erb +++ /dev/null @@ -1,28 +0,0 @@ -<h1><%= @flavor.id %></h1> - -<dl> - <di> - <dt> - Architecture - </dt> - <dd> - <%= @flavor.architecture %> - </dd> - </di> - <di> - <dt> - Memory - </dt> - <dd> - <%= @flavor.memory %> GB - </dd> - </di> - <di> - <dt> - Storage - </dt> - <dd> - <%= @flavor.storage %> GB - </dd> - </di> -</dl> diff --git a/server/libexec/app/views/flavors/show.html.haml b/server/libexec/app/views/flavors/show.html.haml new file mode 100644 index 0000000..d81e75b --- /dev/null +++ b/server/libexec/app/views/flavors/show.html.haml @@ -0,0 +1,16 @@ +%h1 + = @flavor.id + +%dl + %di + %dt Architecture + %dd + = @flavor.architecture + %di + %dt Memory + %dd + = "#{@flavor.memory} GB" + %di + %dt Storage + %dd + = "#{@flavor.storage} GB" diff --git a/server/libexec/app/views/hardware_profiles/index.html.haml b/server/libexec/app/views/hardware_profiles/index.html.haml index 63fce7c..0c7503d 100644 --- a/server/libexec/app/views/hardware_profiles/index.html.haml +++ b/server/libexec/app/views/hardware_profiles/index.html.haml @@ -1,27 +1,30 @@ %h1 Hardware Profiles
-%table - %tr - %th - Name - %th - Architecture - %th - Memory - %th - Storage - %th - Mutable - - for profile in @profiles +%table.display + %thead %tr - %td - = link_to profile.name, hardware_profile_url( profile.name ) - %td - = profile.architecture - %td - = format_hardware_aspect profile.memory - %td - = format_hardware_aspect profile.storage - %td - = profile.mutable? + %th + Name + %th + Architecture + %th + Memory + %th + Storage + %th + Mutable + %tbody + - for profile in @profiles + %tr + %td + = link_to profile.name, hardware_profile_url( profile.name ) + %td + = profile.architecture + %td + = format_hardware_aspect profile.memory + %td + = format_hardware_aspect profile.storage + %td + = profile.mutable? + diff --git a/server/libexec/app/views/images/index.html.erb b/server/libexec/app/views/images/index.html.erb deleted file mode 100644 index a353c7e..0000000 --- a/server/libexec/app/views/images/index.html.erb +++ /dev/null @@ -1,41 +0,0 @@ - -<h1>Images</h1> - -<table> - <tr> - <th> - ID - </th> - <th> - Name - </th> - <th> - Owner - </th> - <th> - Architecture - </th> - <th> - Description - </th> - </tr> - <% for image in @images %> - <tr> - <td> - <%= link_to image.id, image_url( image.id ) %> - </td> - <td> - <%= image.name %> - </td> - <td> - <%= link_to image.owner_id, images_url( :owner_id=>image.owner_id ) %> - </td> - <td> - <%= image.architecture %> - </td> - <td> - <%= image.description %> - </td> - </tr> - <% end %> -</table> diff --git a/server/libexec/app/views/images/index.html.haml b/server/libexec/app/views/images/index.html.haml new file mode 100644 index 0000000..f199402 --- /dev/null +++ b/server/libexec/app/views/images/index.html.haml @@ -0,0 +1,30 @@ +%h1 + Images + +%table.display + %thead + %tr + %th + ID + %th + Name + %th + Owner + %th + Architecture + %th + Description + %tbody + - @images.each do |image| + %tr + %td + = link_to image.id, image_url(image.id) + %td + = image.name + %td + = link_to image.owner_id, images_url( :owner_id => image.owner_id ) + %td + = image.architecture + %td + = image.description + diff --git a/server/libexec/app/views/images/show.html.erb b/server/libexec/app/views/images/show.html.erb deleted file mode 100644 index 3d37143..0000000 --- a/server/libexec/app/views/images/show.html.erb +++ /dev/null @@ -1,42 +0,0 @@ - -<h1>Image</h1> -<h2><%= @image.id %></h2> - -<dl> - <di> - <dt> - Name - </dt> - <dd> - <%= @image.name %> - </dd> - </di> - <di> - <dt> - Owner - </dt> - <dd> - <%= link_to @image.owner_id, images_url( :owner_id=>@image.owner_id ) %> - </dd> - </di> - <di> - <dt> - Architecture - </dt> - <dd> - <%= @image.architecture %> - </dd> - </di> - <di> - <dt> - Description - </dt> - <dd> - <%= @image.description %> - </dd> - </di> -</dl> - -<div> - <%= link_to 'launch', new_instance_url( :image_id=>@image.id ) %> -</div> diff --git a/server/libexec/app/views/images/show.html.haml b/server/libexec/app/views/images/show.html.haml new file mode 100644 index 0000000..f50f496 --- /dev/null +++ b/server/libexec/app/views/images/show.html.haml @@ -0,0 +1,22 @@ +%h1 Image +%h2 + = @image.id + +%dl + %di + %dt Name + %dd + = @image.name + %dt Owner + %dd + = link_to @image.owner_id, images_url( :owner_id => @image.owner_id ) + %dt Architecture + %dd + = @image.architecture + %dt Description + %dd + = @image.description + %dt + %dd + = link_to 'Launch', new_instance_url( :image_id => @image.id ) + diff --git a/server/libexec/app/views/instance_states/show.html.erb b/server/libexec/app/views/instance_states/show.html.erb deleted file mode 100644 index 96bde93..0000000 --- a/server/libexec/app/views/instance_states/show.html.erb +++ /dev/null @@ -1,53 +0,0 @@ - -<h1>Instance States</h1> - -<div id="state_graph"> - <%= image_tag url_for( :format=>:png ) %> -</div> - -<table class="states"> - <tr> - <th> - Origin - </th> - <th> - Action - </th> - <th> - Destination - </th> - </tr> - <% @machine.states.each do |state| %> - <tr> - <td rowspan="<%= state.transitions.empty? ? 2 : state.transitions.size + 1 %>" class="origin"> - <%= state %> - </td> - </tr> - <% if ( state.transitions.empty? ) %> - <tr> - <td> - -- - </td> - <td> - -- - </td> - </tr> - <% else %> - <% state.transitions.each do |transition| %> - <tr> - <td> - <% if ( transition.automatically? ) %> - <em>auto</em> - <% else %> - <%= transition.action %> - <% end %> - </td> - <td> - <%= transition.destination %> - </td> - </tr> - <% end %> - <% end %> - <% end %> -</table> - diff --git a/server/libexec/app/views/instance_states/show.html.haml b/server/libexec/app/views/instance_states/show.html.haml new file mode 100644 index 0000000..8bbc046 --- /dev/null +++ b/server/libexec/app/views/instance_states/show.html.haml @@ -0,0 +1,31 @@ +%h1 Instance States + +%div#state_graph + = image_tag url_for( :format => :png ) + +%table.states + %thead + %tr + %th Origin + %th Action + %th Destination + %tbody + - @machine.states.each do |state| + %tr + %td.origin{:rowspan => "#{state.transitions.empty? ? 2 : (state.transitions.size + 1)}"} + = state + - if state.transitions.empty? + %tr + %td -- + %td -- + - else + - state.transitions.each do |transition| + %tr + %td + - if transition.automatically? + %em auto + - else + = transition.action + %td + = transition.destination + diff --git a/server/libexec/app/views/instances/index.html.erb b/server/libexec/app/views/instances/index.html.erb deleted file mode 100644 index 4f1ffa3..0000000 --- a/server/libexec/app/views/instances/index.html.erb +++ /dev/null @@ -1,68 +0,0 @@ -<h1>Instances</h1> - -<table> - <tr> - <th> - ID - </th> - <th> - Owner - </th> - <th> - Name - </th> - <th> - Image - </th> - <th> - Flavor - </th> - <th> - Realm - </th> - <th> - State - </th> - <th> - Actions - </th> - </tr> - <% for instance in @instances %> - <tr> - <td> - <%= link_to instance.id, instance_url( instance.id ) %> - </td> - <td> - <%= link_to instance.owner_id, images_url( :owner=>instance.owner_id ) %> - </td> - <td> - <%= instance.name %> - </td> - <td> - <%= link_to instance.image_id, image_url( instance.image_id ) %> - </td> - <td> - <% if ( instance.flavor_id ) %> - <%= link_to instance.flavor_id, flavor_url( instance.flavor_id ) %> - <% else %> - default - <% end %> - </td> - <td> - <% if ( instance.realm_id ) %> - <%= link_to instance.realm_id, realm_url( instance.realm_id ) %> - <% else %> - default - <% end %> - </td> - <td> - <%= instance.state %> - </td> - <td> - <% instance.actions.each do |action| %> - <%= link_to action, self.send( "#{action}_instance_url", instance.id ), :method=>:post %> - <% end %> - </td> - </tr> - <% end %> -</table> diff --git a/server/libexec/app/views/instances/index.html.haml b/server/libexec/app/views/instances/index.html.haml new file mode 100644 index 0000000..6d513b6 --- /dev/null +++ b/server/libexec/app/views/instances/index.html.haml @@ -0,0 +1,33 @@ +%h1 Instances + +%table.display + %thead + %tr + %th ID + %th Owner + %th Name + %th Image + %th Flavor + %th Realm + %th State + %th Actions + %tbody + - @instances.each do |instance| + %tr + %td + = link_to instance.id, instance_url( instance.id ) + %td + = link_to instance.owner_id, images_url( instance.owner_id ) + %td + = instance.name + %td + = link_to instance.image_id, image_url( instance.image_id ) + %td + = instance.flavor_id ? link_to(instance.flavor_id, flavor_url(instance.flavor_url)) : default + %td + = instance.realm_id ? link_to(instance.realm_id, realm_url( instance.realm_id )) : default + %td + = instance.state + %td + = instance.actions.collect { |a| link_to(a, self.send("#{a}_instance_url", instance.id), :method => :post)}.join(' ') + diff --git a/server/libexec/app/views/instances/show.html.erb b/server/libexec/app/views/instances/show.html.erb deleted file mode 100644 index 2f1d8a1..0000000 --- a/server/libexec/app/views/instances/show.html.erb +++ /dev/null @@ -1,88 +0,0 @@ - - -<h1><%= @instance.id %></h1> - -<dl> - <di> - <dt> - Image - </dt> - <dd> - <%= link_to @instance.image_id, image_url( @instance.image_id ) %> - </dd> - </di> - <di> - <dt> - Owner - </dt> - <dd> - <%= @instance.owner_id %> - </dd> - </di> - <di> - <dt> - Name - </dt> - <dd> - <%= @instance.name %> - </dd> - </di> - <di> - <dt> - Flavor - </dt> - <dd> - <% if ( @instance.flavor_id ) %> - <%= link_to @instance.flavor_id, flavor_url( @instance.flavor_id ) %> - <% else %> - default - <% end %> - </dd> - </di> - <di> - <dt> - Realm - </dt> - <dd> - <% if ( @instance.realm_id ) %> - <%= link_to @instance.realm_id, realm_url( @instance.realm_id ) %> - <% else %> - default - <% end %> - </dd> - </di> - <di> - <dt> - State - </dt> - <dd> - <%= @instance.state %> - </dd> - </di> - <di> - <dt> - Public Addresses - </dt> - <dd> - <% for address in @instance.public_addresses %> - <div><%= address %></div> - <% end %> - </dd> - </di> - <di> - <dt> - Private Addresses - </dt> - <dd> - <% for address in @instance.private_addresses %> - <div><%= address %></div> - <% end %> - </dd> - </di> -</dl> - -<div> - <% @instance.actions.each do |action| %> - <%= link_to action, send( "#{action}_instance_url", @instance.id ), :method=>:post %> - <% end %> -</div> diff --git a/server/libexec/app/views/instances/show.html.haml b/server/libexec/app/views/instances/show.html.haml new file mode 100644 index 0000000..5ef1306 --- /dev/null +++ b/server/libexec/app/views/instances/show.html.haml @@ -0,0 +1,41 @@ +%h1 + = @instance.id + +%dl + %di + %dt Image + %dd + = link_to @instance.image_id, image_url( @instance.image_id ) + %di + %dt Owner + %dd + = @instance.owner_id + %di + %dt Name + %dd + = @instance.name + %di + %dt Flavor + %dd + = @instance.flavor_id ? link_to(@instance.flavor_id, flavor_url(@instance.flavor_id)) ? default + %di + %dt Realm + %dd + = @instance.realm_id ? link_to(@instance.realm_id, realm_url(@instance.realm_id)) ? default + %di + %dt State + %dd + = @instance.state + %di + %dt Public Addresses + %dd + = @instance.public_addresses.collect { |address| "<div>#{address}</div>" }.join + %di + %dt Private Addresses + %dd + = @instance.private_addresses.collect { |address| "<div>#{address}</div>" }.join + %di + %dt + %dd + = @instance.actions.collect { |action| link_to(action, send("#{action}_instance_url", @instance.id, :method => :post))}.join + diff --git a/server/libexec/app/views/layouts/application.html.haml b/server/libexec/app/views/layouts/application.html.haml index 5a5e096..a218e22 100644 --- a/server/libexec/app/views/layouts/application.html.haml +++ b/server/libexec/app/views/layouts/application.html.haml @@ -19,6 +19,8 @@ #driver_info Driver: #{DRIVER} #copyright - Copyright 2009 #{link_to 'Red Hat', 'http://redhat.com%27%7D and individual contributors. + Copyright + = Time.now.year + #{link_to 'Red Hat', 'http://redhat.com%27%7D and individual contributors.
diff --git a/server/libexec/app/views/realms/index.html.erb b/server/libexec/app/views/realms/index.html.erb deleted file mode 100644 index 7be82b5..0000000 --- a/server/libexec/app/views/realms/index.html.erb +++ /dev/null @@ -1,35 +0,0 @@ - -<h1>Realms</h1> - -<table> - <tr> - <th> - ID - </th> - <th> - Name - </th> - <th> - State - </th> - <th> - Limit - </th> - </tr> - <% for realm in @realms %> - <tr> - <td> - <%= link_to realm.id, realm_url( realm.id ) %> - </td> - <td> - <%= realm.name %> - </td> - <td> - <%= realm.state %> - </td> - <td> - <%= realm.limit %> - </td> - </tr> - <% end %> -</table> diff --git a/server/libexec/app/views/realms/index.html.haml b/server/libexec/app/views/realms/index.html.haml new file mode 100644 index 0000000..cfee320 --- /dev/null +++ b/server/libexec/app/views/realms/index.html.haml @@ -0,0 +1,29 @@ +%h1 + Realms + +%table.display + %thead + %tr + %th + Name + %th + Architecture + %th + Memory + %th + Storage + %th + Mutable + %tbody + - @realms.each do |realm| + %tr + %td + = link_to realm.id, realm_url( realm.id ) + %td + = realm.name + %td + = realm.state + %td + = realm.limit + %td + diff --git a/server/libexec/app/views/realms/show.html.erb b/server/libexec/app/views/realms/show.html.erb deleted file mode 100644 index e0e30d5..0000000 --- a/server/libexec/app/views/realms/show.html.erb +++ /dev/null @@ -1,28 +0,0 @@ -<h1><%= @realm.id %></h1> - -<dl> - <di> - <dt> - Name - </dt> - <dd> - <%= @realm.name %> - </dd> - </di> - <di> - <dt> - State - </dt> - <dd> - <%= @realm.state %> - </dd> - </di> - <di> - <dt> - Limit - </dt> - <dd> - <%= @realm.limit %> - </dd> - </di> -</dl> diff --git a/server/libexec/app/views/realms/show.html.haml b/server/libexec/app/views/realms/show.html.haml new file mode 100644 index 0000000..4ed33ad --- /dev/null +++ b/server/libexec/app/views/realms/show.html.haml @@ -0,0 +1,15 @@ +%h1 + = @realm.id +%dl + %di + %dt Name + %dd + = @realm.name + %di + %dt State + %dd + = @realm.state + %di + %dt Limit + %dd + = @realm.limit diff --git a/server/libexec/app/views/root/index.html.erb b/server/libexec/app/views/root/index.html.erb deleted file mode 100644 index 7f6d5d7..0000000 --- a/server/libexec/app/views/root/index.html.erb +++ /dev/null @@ -1,5 +0,0 @@ - -<!-- <h1>δ-cloud-foundation</h1> --> -<h1>Deltacloud: <%= DRIVER.to_s.titlecase %></h1> - -<%= link_to 'API', api_url %> diff --git a/server/libexec/app/views/root/index.html.haml b/server/libexec/app/views/root/index.html.haml new file mode 100644 index 0000000..4c350de --- /dev/null +++ b/server/libexec/app/views/root/index.html.haml @@ -0,0 +1,4 @@ +%h1 + Deltacloud: + = DRIVER.to_s.titlecase += link_to 'API', api_url diff --git a/server/libexec/app/views/storage_snapshots/index.html.erb b/server/libexec/app/views/storage_snapshots/index.html.erb deleted file mode 100644 index c00d2f5..0000000 --- a/server/libexec/app/views/storage_snapshots/index.html.erb +++ /dev/null @@ -1,35 +0,0 @@ - -<h1>Storage Snapshots</h1> - -<table> - <tr> - <th> - ID - </th> - <th> - Volume - </th> - <th> - Created - </th> - <th> - State - </th> - </tr> - <% for snapshot in @snapshots %> - <tr> - <td> - <%= link_to snapshot.id, storage_snapshot_url( snapshot.id ) %> - </td> - <td> - <%= link_to snapshot.storage_volume_id, storage_volume_url( snapshot.storage_volume_id ) %> - </td> - <td> - <%= snapshot.created %> - </td> - <td> - <%= snapshot.state %> - </td> - </tr> - <% end %> -</table> diff --git a/server/libexec/app/views/storage_snapshots/index.html.haml b/server/libexec/app/views/storage_snapshots/index.html.haml new file mode 100644 index 0000000..7633388 --- /dev/null +++ b/server/libexec/app/views/storage_snapshots/index.html.haml @@ -0,0 +1,20 @@ +%h1 Storage Snapshots + +%table + %thead + %tr + %th ID + %th Volume + %th Created + %th State + %tbody + - @snapshots.each do |snapshot| + %tr + %td + = link_to snapshot.id, storage_snapshot_url( snapshot.id ) + %td + = link_to snapshot.storage_volume_id, storage_volume_url( snapshot.storage_volume_id ) + %td + = snapshot.created + %td + = snapshot.state diff --git a/server/libexec/app/views/storage_snapshots/show.html.erb b/server/libexec/app/views/storage_snapshots/show.html.erb deleted file mode 100644 index 7087df1..0000000 --- a/server/libexec/app/views/storage_snapshots/show.html.erb +++ /dev/null @@ -1,29 +0,0 @@ - -<h1><%= @snapshot.id %></h1> - -<dl> - <di> - <dt> - Volume - </dt> - <dd> - <%= @snapshot.storage_volume_id %> - </dd> - </di> - <di> - <dt> - Created - </dt> - <dd> - <%= @snapshot.created %> - </dd> - </di> - <di> - <dt> - State - </dt> - <dd> - <%= @snapshot.state %> - </dd> - </di> -</dl> diff --git a/server/libexec/app/views/storage_snapshots/show.html.haml b/server/libexec/app/views/storage_snapshots/show.html.haml new file mode 100644 index 0000000..5cd1a95 --- /dev/null +++ b/server/libexec/app/views/storage_snapshots/show.html.haml @@ -0,0 +1,14 @@ +%h1 + = @snapshot.id + +%dl + %di + %dt Volume + %dd + = @snapshot.storage_volume_id + %dt Created + %dd + = @snapshot.created + %dt State + %dd + = @snapshot.state diff --git a/server/libexec/app/views/storage_volumes/index.html.erb b/server/libexec/app/views/storage_volumes/index.html.erb deleted file mode 100644 index 5b0559c..0000000 --- a/server/libexec/app/views/storage_volumes/index.html.erb +++ /dev/null @@ -1,35 +0,0 @@ - -<h1>Storage Volumes</h1> - -<table> - <tr> - <th> - ID - </th> - <th> - Created - </th> - <th> - Capacity - </th> - <th> - Status - </th> - </tr> - <% for volume in @volumes %> - <tr> - <td> - <%= link_to volume.id, storage_volume_url( volume.id ) %> - </td> - <td> - <%= volume.created %> - </td> - <td> - <%= volume.capacity %> GB - </td> - <td> - <%= volume.state %> - </td> - </tr> - <% end %> -</table> diff --git a/server/libexec/app/views/storage_volumes/index.html.haml b/server/libexec/app/views/storage_volumes/index.html.haml new file mode 100644 index 0000000..7bee08f --- /dev/null +++ b/server/libexec/app/views/storage_volumes/index.html.haml @@ -0,0 +1,21 @@ +%h1 Storage Volumes + +%table.display + %thead + %tr + %th ID + %th Created + %th Capacity + %th Status + %tbody + - @volumes.each do |volume| + %tr + %td + = link_to volume.id, storage_volume_url( volume.id ) + %td + = volume.created + %td + = "#{volume.capacity} GB" + %td + = "#{volume.state}" + diff --git a/server/libexec/app/views/storage_volumes/show.html.erb b/server/libexec/app/views/storage_volumes/show.html.erb deleted file mode 100644 index f524543..0000000 --- a/server/libexec/app/views/storage_volumes/show.html.erb +++ /dev/null @@ -1,39 +0,0 @@ - -<h1><%= @volume.id %></h1> - -<dl> - <di> - <dt> - Created - </dt> - <dd> - <%= @volume.created %> - </dd> - </di> - <di> - <dt> - Capacity - </dt> - <dd> - <%= @volume.capacity %> GB - </dd> - </di> - <di> - <dt> - State - </dt> - <dd> - <%= @volume.state %> - </dd> - </di> - <di> - <dt> - Attached - </dt> - <dd> - <% if ( @volume.instance_id ) %> - <%= link_to @volume.instance_id, instance_url( @volume.instance_id ) %> - <%= @volume.device %> - <% end %> - </dd> - </di> -</dl> diff --git a/server/libexec/app/views/storage_volumes/show.html.haml b/server/libexec/app/views/storage_volumes/show.html.haml new file mode 100644 index 0000000..4839ac3 --- /dev/null +++ b/server/libexec/app/views/storage_volumes/show.html.haml @@ -0,0 +1,20 @@ +%h1 + = @volume.id + +%dl + %di + %dt Created + %dd + = @volume.created + %di + %dt Capacity + %dd + = "#{@volume.capacity} GB" + %di + %dt State + %dd + = @volume.state + %di + %dt Attached + %dd + = link_to(@volume.instance_id, instance_url( @volume.instance_id)) + ' - ' + @volume.device.to_s if @volume.instance_id
On Fri, 2010-01-22 at 10:59 +0100, Michal Fojtik wrote:
From: Michal Fojtik mfojtik@redhat.com
- Replaced almost every ERB view with HAML
- Fixed year in copyright (application layout)
ACK. There's a few small nits, but feel free to commit this after addressing them:
diff --git a/server/libexec/app/views/accounts/index.html.haml b/server/libexec/app/views/accounts/index.html.haml new file mode 100644 index 0000000..7aee4c9 --- /dev/null +++ b/server/libexec/app/views/accounts/index.html.haml @@ -0,0 +1,10 @@ +%h1 Accounts
+%table
- %thead
- %th ID
There's a %tr missing here.
diff --git a/server/libexec/app/views/accounts/show.html.haml b/server/libexec/app/views/accounts/show.html.haml new file mode 100644 index 0000000..c09e63c --- /dev/null +++ b/server/libexec/app/views/accounts/show.html.haml @@ -0,0 +1,14 @@ +%h1
- = @account[:id]
+%h2 Instances
+%table
- %thead
- %tr
%th Instance ID
- %tbody
- @account[:instance_ids].each do |instance_id|
%tr
%td
= link_to instance_id, instance_url( instance_id )
The '%h2 Images' part from the ERB went missing
diff --git a/server/libexec/app/views/images/show.html.haml b/server/libexec/app/views/images/show.html.haml new file mode 100644 index 0000000..f50f496 --- /dev/null +++ b/server/libexec/app/views/images/show.html.haml @@ -0,0 +1,22 @@ +%h1 Image +%h2
- = @image.id
+%dl
- %di
<di> isn't an HTML element. The content model of <dl> is (dt+ dd+)*. This should be removed from all the templates.
diff --git a/server/libexec/app/views/instances/show.html.haml b/server/libexec/app/views/instances/show.html.haml new file mode 100644 index 0000000..5ef1306 --- /dev/null +++ b/server/libexec/app/views/instances/show.html.haml @@ -0,0 +1,41 @@
- %di
- %dt Flavor
- %dd
= @instance.flavor_id ? link_to(@instance.flavor_id, flavor_url(@instance.flavor_id)) ? default
- %di
- %dt Realm
- %dd
= @instance.realm_id ? link_to(@instance.realm_id, realm_url(@instance.realm_id)) ? default
The 'default' needs to be a string, i.e. "default"
diff --git a/server/libexec/app/views/layouts/application.html.haml b/server/libexec/app/views/layouts/application.html.haml index 5a5e096..a218e22 100644 --- a/server/libexec/app/views/layouts/application.html.haml +++ b/server/libexec/app/views/layouts/application.html.haml @@ -19,6 +19,8 @@ #driver_info Driver: #{DRIVER} #copyright
Copyright 2009 #{link_to 'Red Hat', 'http://redhat.com'} and individual contributors.
Copyright
= Time.now.year
#{link_to 'Red Hat', 'http://redhat.com'} and individual contributors.
IANAL, but the recommended way is to write 'Copyright 2009, 2010 Red Hat ..' - I would just leave it as literal text.
David
+%dl
- %di
<di> isn't an HTML element. The content model of <dl> is (dt+ dd+)*. This should be removed from all the templates.
I think in XHTML (which our doctype should be saying?) does use <di>
http://www.w3.org/TR/2005/WD-xhtml2-20050527/mod-list.html
Or do I have an old/wrong/bad spec?
-Bob
On Fri, 2010-01-22 at 13:10 -0500, Bob McWhirter wrote:
+%dl
- %di
<di> isn't an HTML element. The content model of <dl> is (dt+ dd+)*. This should be removed from all the templates.
I think in XHTML (which our doctype should be saying?) does use <di>
http://www.w3.org/TR/2005/WD-xhtml2-20050527/mod-list.html
Or do I have an old/wrong/bad spec?
Arrgh .. you're right. I only looked at the HTML 4 and 5 specs. So forget about that nitpick.
David
On 22/01/10 10:06 -0800, David Lutterkort wrote:
On Fri, 2010-01-22 at 10:59 +0100, Michal Fojtik wrote:
From: Michal Fojtik mfojtik@redhat.com
- Replaced almost every ERB view with HAML
- Fixed year in copyright (application layout)
ACK. There's a few small nits, but feel free to commit this after addressing them
I'm fixed all things:
--- server/libexec/app/views/accounts/index.html.haml | 3 ++- server/libexec/app/views/accounts/show.html.haml | 16 ++++++++++++++++ server/libexec/app/views/instances/index.html.haml | 4 ++-- server/libexec/app/views/instances/show.html.haml | 4 ++-- .../app/views/layouts/application.html.haml | 3 +-- 5 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/server/libexec/app/views/accounts/index.html.haml b/server/libexec/app/views/accounts/index.html.haml index 7aee4c9..df73d19 100644 --- a/server/libexec/app/views/accounts/index.html.haml +++ b/server/libexec/app/views/accounts/index.html.haml @@ -2,7 +2,8 @@
%table %thead - %th ID + %tr + %th ID %tbody - @accounts.each do |account| %tr diff --git a/server/libexec/app/views/accounts/show.html.haml b/server/libexec/app/views/accounts/show.html.haml index c09e63c..2688b3e 100644 --- a/server/libexec/app/views/accounts/show.html.haml +++ b/server/libexec/app/views/accounts/show.html.haml @@ -12,3 +12,19 @@ %tr %td = link_to instance_id, instance_url( instance_id ) + +%h2 Images + +%table + %thead + %tr + %th Image ID + %th Description + %tbody + %tbody + - @images.each do |image| + %tr + %td + = link_to image[:id], image_url( image[:id] ) + %td + = image[:description] diff --git a/server/libexec/app/views/instances/index.html.haml b/server/libexec/app/views/instances/index.html.haml index 6d513b6..085e6c6 100644 --- a/server/libexec/app/views/instances/index.html.haml +++ b/server/libexec/app/views/instances/index.html.haml @@ -23,9 +23,9 @@ %td = link_to instance.image_id, image_url( instance.image_id ) %td - = instance.flavor_id ? link_to(instance.flavor_id, flavor_url(instance.flavor_url)) : default + = instance.flavor_id ? link_to(instance.flavor_id, flavor_url(instance.flavor_url)) : 'default' %td - = instance.realm_id ? link_to(instance.realm_id, realm_url( instance.realm_id )) : default + = instance.realm_id ? link_to(instance.realm_id, realm_url( instance.realm_id )) : 'default' %td = instance.state %td diff --git a/server/libexec/app/views/instances/show.html.haml b/server/libexec/app/views/instances/show.html.haml index 5ef1306..5d3d435 100644 --- a/server/libexec/app/views/instances/show.html.haml +++ b/server/libexec/app/views/instances/show.html.haml @@ -17,11 +17,11 @@ %di %dt Flavor %dd - = @instance.flavor_id ? link_to(@instance.flavor_id, flavor_url(@instance.flavor_id)) ? default + = @instance.flavor_id ? link_to(@instance.flavor_id, flavor_url(@instance.flavor_id)) ? 'default' %di %dt Realm %dd - = @instance.realm_id ? link_to(@instance.realm_id, realm_url(@instance.realm_id)) ? default + = @instance.realm_id ? link_to(@instance.realm_id, realm_url(@instance.realm_id)) ? 'default' %di %dt State %dd diff --git a/server/libexec/app/views/layouts/application.html.haml b/server/libexec/app/views/layouts/application.html.haml index a218e22..1f9f47b 100644 --- a/server/libexec/app/views/layouts/application.html.haml +++ b/server/libexec/app/views/layouts/application.html.haml @@ -19,8 +19,7 @@ #driver_info Driver: #{DRIVER} #copyright - Copyright - = Time.now.year + Copyright 2009, 2010 #{link_to 'Red Hat', 'http://redhat.com%27%7D and individual contributors.
On Mon, 2010-01-25 at 10:01 +0100, Michal Fojtik wrote:
On 22/01/10 10:06 -0800, David Lutterkort wrote:
On Fri, 2010-01-22 at 10:59 +0100, Michal Fojtik wrote:
From: Michal Fojtik mfojtik@redhat.com
- Replaced almost every ERB view with HAML
- Fixed year in copyright (application layout)
ACK. There's a few small nits, but feel free to commit this after addressing them
I'm fixed all things:
Perfect .. now, push, push.
David
deltacloud-devel@lists.fedorahosted.org