incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1055848 - in /incubator/deltacloud/trunk/server: lib/deltacloud/helpers/ public/images/ public/stylesheets/compiled/ views/ views/api/ views/docs/ views/images/
Date Thu, 06 Jan 2011 12:26:34 GMT
Author: mfojtik
Date: Thu Jan  6 12:26:34 2011
New Revision: 1055848

URL: http://svn.apache.org/viewvc?rev=1055848&view=rev
Log:
Small UI improvement in HTML interface

Added:
    incubator/deltacloud/trunk/server/public/images/bread-bg.png
    incubator/deltacloud/trunk/server/public/images/error.png
    incubator/deltacloud/trunk/server/views/error.html.haml
      - copied, changed from r1055026, incubator/deltacloud/trunk/server/views/layout.html.haml
Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/helpers/application_helper.rb
    incubator/deltacloud/trunk/server/public/stylesheets/compiled/application.css
    incubator/deltacloud/trunk/server/public/stylesheets/compiled/screen.css
    incubator/deltacloud/trunk/server/views/api/show.html.haml
    incubator/deltacloud/trunk/server/views/docs/operation.html.haml
    incubator/deltacloud/trunk/server/views/images/index.html.haml
    incubator/deltacloud/trunk/server/views/layout.html.haml

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/helpers/application_helper.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/helpers/application_helper.rb?rev=1055848&r1=1055847&r2=1055848&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/helpers/application_helper.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/helpers/application_helper.rb Thu Jan
 6 12:26:34 2011
@@ -34,6 +34,7 @@ module ApplicationHelper
         end
       end
     end
+    s+="<li class='docs'>#{link_to_documentation}</li>"
     s+="</ul>"
   end
 
@@ -101,7 +102,7 @@ module ApplicationHelper
     response.status = status
     respond_to do |format|
       format.xml { haml :"errors/#{template}", :layout => false }
-      format.html { haml :"errors/#{template}" }
+      format.html { haml :"errors/#{template}", :layout => :error }
     end
   end
 
@@ -145,4 +146,33 @@ module ApplicationHelper
     end
   end
 
+  def link_to_format(format)
+    uri = request.env['REQUEST_URI']
+    return if uri.include?('format=')
+    if uri.include?('?')
+      uri+="&format=#{format}"
+    else
+      uri+="?format=#{format}"
+    end
+    '<a href="%s">%s</a>' % [uri, "#{format}".upcase]
+  end
+
+  def link_to_documentation
+    uri = request.env['REQUEST_URI']
+    uri.gsub!('/api/', '/api/docs/')
+    '<a href="%s">[ Documentation ]</a>' % uri
+  end
+
+  def action_url
+    if [:index].include?(@operation.name)
+      url_for("/api/#{@collection.name.to_s}")
+    elsif [:show, :stop, :start, :reboot, :attach, :detach].include?(@operation.name)
+      url_for("/api/#{@collection.name.to_s}/:id/#{@operation.name}")
+    elsif [:destroy].include?(@operation.name)
+      url_for("/api/#{@collection.name.to_s}/:id")
+    else
+      url_for("/api/#{@collection.name}/#{@operation.name}")
+    end
+  end
+
 end

Added: incubator/deltacloud/trunk/server/public/images/bread-bg.png
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/public/images/bread-bg.png?rev=1055848&view=auto
==============================================================================
Files incubator/deltacloud/trunk/server/public/images/bread-bg.png (added) and incubator/deltacloud/trunk/server/public/images/bread-bg.png
Thu Jan  6 12:26:34 2011 differ

Added: incubator/deltacloud/trunk/server/public/images/error.png
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/public/images/error.png?rev=1055848&view=auto
==============================================================================
Files incubator/deltacloud/trunk/server/public/images/error.png (added) and incubator/deltacloud/trunk/server/public/images/error.png
Thu Jan  6 12:26:34 2011 differ

Modified: incubator/deltacloud/trunk/server/public/stylesheets/compiled/application.css
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/public/stylesheets/compiled/application.css?rev=1055848&r1=1055847&r2=1055848&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/public/stylesheets/compiled/application.css (original)
+++ incubator/deltacloud/trunk/server/public/stylesheets/compiled/application.css Thu Jan
 6 12:26:34 2011
@@ -6,7 +6,6 @@ html, body {
   font-weight: inherit;
   font-style: inherit;
   font-size: 100%;
-  font-family: inherit;
   vertical-align: baseline; }
 
 /* line 12, ../../../../../../../../.gem/ruby/1.8/gems/compass-0.8.17/frameworks/blueprint/stylesheets/blueprint/modules/_reset.sass
*/
@@ -461,7 +460,6 @@ html {
 
 /* line 12, ../../../app/stylesheets/application.sass */
 body {
-  font-family: "Trebuchet MS";
   font-size: 90%; }
   /* line 15, ../../../app/stylesheets/application.sass */
   body a {
@@ -479,7 +477,9 @@ body {
 
 /* line 21, ../../../app/stylesheets/application.sass */
 #header {
+  border-radius: 5px 5px 0 0;
   padding: 1em;
+  margin-top : 0.5em;
   background-image: url('/images/topbar-bg.png'); }
   /* line 24, ../../../app/stylesheets/application.sass */
   #header img {
@@ -494,7 +494,7 @@ body {
   border-top: 1px solid #BBB;
   padding-top: 1ex;
   text-align: right;
-  color: #BBB;
+  color: #777;
   font-size: 70%; }
 
 /* line 38, ../../../app/stylesheets/application.sass */
@@ -538,7 +538,8 @@ body {
 
 /* line 70, ../../../app/stylesheets/application.sass */
 ul.breadcrumb {
-  background-color: #eee;
+  border-radius : 0 0 5px 5px;
+  background: #eeeeee url('/images/bread-bg.png') repeat-x top left;
   border: 1px solid #6498c5;
   padding: 1ex;
   font-size: 90%;
@@ -551,7 +552,8 @@ ul.breadcrumb {
     display: inline; }
     /* line 81, ../../../app/stylesheets/application.sass */
     ul.breadcrumb li.subsequent:before {
-      content: " >> "; }
+      color : #aaa;
+      content: " \25b6  "; }
 
 /* line 84, ../../../app/stylesheets/application.sass */
 table {
@@ -613,3 +615,25 @@ table.docs td { border : 1px solid #ccc 
 table.docs table td { border : none }
 
 td form.link { display : inline }
+li.docs {
+  float : right;
+}
+
+li.docs {
+  font-size : 80%;
+}
+
+.error h1 {
+  background : url('/images/error.png') no-repeat center left;
+  height : 35px;
+  padding-left : 55px;
+  padding-top : 10px;
+}
+
+.error p {
+  padding : 1em 0.5em;
+  margin : 1em 0;
+  font-size : 115%;
+  border : 1px solid #c00;
+  background : #fbd1d1;
+}

Modified: incubator/deltacloud/trunk/server/public/stylesheets/compiled/screen.css
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/public/stylesheets/compiled/screen.css?rev=1055848&r1=1055847&r2=1055848&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/public/stylesheets/compiled/screen.css (original)
+++ incubator/deltacloud/trunk/server/public/stylesheets/compiled/screen.css Thu Jan  6 12:26:34
2011
@@ -6,7 +6,7 @@ html, body {
   font-weight: inherit;
   font-style: inherit;
   font-size: 100%;
-  font-family: inherit;
+  font-family : "Helvetica Neue","Liberation Sans",Arial,sans-serif;
   vertical-align: baseline; }
 
 /* line 12, ../../../../../../../.gem/ruby/1.8/gems/compass-0.8.17/frameworks/blueprint/stylesheets/blueprint/modules/_reset.sass
*/

Modified: incubator/deltacloud/trunk/server/views/api/show.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/api/show.html.haml?rev=1055848&r1=1055847&r2=1055848&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/api/show.html.haml (original)
+++ incubator/deltacloud/trunk/server/views/api/show.html.haml Thu Jan  6 12:26:34 2011
@@ -1,5 +1,5 @@
 %h1
-  API v#{settings.version}
+  Deltacloud API #{settings.version}
 
 %ul
   - collections.keys.sort_by { |k| k.to_s }.each do |key|
@@ -10,6 +10,3 @@
           - next if [:index, :show].include?(op)
           %dt
             = op
-  %li
-    %strong
-      %a{:href => url_for("/api/docs")} Documentation (#{settings.version})

Modified: incubator/deltacloud/trunk/server/views/docs/operation.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/docs/operation.html.haml?rev=1055848&r1=1055847&r2=1055848&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/docs/operation.html.haml (original)
+++ incubator/deltacloud/trunk/server/views/docs/operation.html.haml Thu Jan  6 12:26:34 2011
@@ -1,17 +1,13 @@
 %h2
-  %a{:href => url_for("/api/docs/#{@collection.name.to_s}")} #{@collection.name.to_s.titlecase}
-  #{'::'}
-  #{@operation.name}
+  = action_method(@operation.name, @collection.name).to_s.upcase
+  = action_url
 
-%p #{@operation.description}
+%p
+  #{@operation.description}
 
 %br
-%h3
-  URL:
-  %u
-    = url_for("/api/#{@collection.name.to_s}/#{@operation.name.to_s}")
-%br
-%h3 Parameters:
+
+%h2 Parameters:
 
 
 %table

Copied: incubator/deltacloud/trunk/server/views/error.html.haml (from r1055026, incubator/deltacloud/trunk/server/views/layout.html.haml)
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/error.html.haml?p2=incubator/deltacloud/trunk/server/views/error.html.haml&p1=incubator/deltacloud/trunk/server/views/layout.html.haml&r1=1055026&r2=1055848&rev=1055848&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/layout.html.haml (original)
+++ incubator/deltacloud/trunk/server/views/error.html.haml Thu Jan  6 12:26:34 2011
@@ -15,9 +15,14 @@
       #header
         = link_to image_tag( "/images/logo-wide.png" ), root_url
       = bread_crumb
-      #content
+      #content{:class => :error}
         = yield
       #footer
+        #formats
+          Format:
+          =link_to_format(:xml)
+          |
+          =link_to_format(:json)
         #driver_info
           Driver: #{driver_symbol} | API version: #{settings.version}
         #copyright

Modified: incubator/deltacloud/trunk/server/views/images/index.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/images/index.html.haml?rev=1055848&r1=1055847&r2=1055848&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/images/index.html.haml (original)
+++ incubator/deltacloud/trunk/server/views/images/index.html.haml Thu Jan  6 12:26:34 2011
@@ -11,8 +11,6 @@
       %th
         Owner
       %th
-        Architecture
-      %th
         Description
   %tbody
     - @images.each do |image|
@@ -24,7 +22,5 @@
         %td
           = link_to image.owner_id, images_url
         %td
-          = image.architecture
-        %td
           = image.description
 

Modified: incubator/deltacloud/trunk/server/views/layout.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/layout.html.haml?rev=1055848&r1=1055847&r2=1055848&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/layout.html.haml (original)
+++ incubator/deltacloud/trunk/server/views/layout.html.haml Thu Jan  6 12:26:34 2011
@@ -18,6 +18,11 @@
       #content
         = yield
       #footer
+        #formats
+          Format:
+          =link_to_format(:xml)
+          |
+          =link_to_format(:json)
         #driver_info
           Driver: #{driver_symbol} | API version: #{settings.version}
         #copyright



Mime
View raw message