From: Michal Fojtik <[email protected]>
---
.../lib/deltacloud/helpers/application_helper.rb | 32 ++++++++++++++++++-
server/public/images/bread-bg.png | Bin 0 -> 257 bytes
server/public/images/error.png | Bin 0 -> 3080 bytes
server/public/stylesheets/compiled/application.css | 34 +++++++++++++++++---
server/public/stylesheets/compiled/screen.css | 2 +-
server/views/api/show.html.haml | 5 +--
server/views/docs/operation.html.haml | 16 +++------
server/views/error.html.haml | 31 ++++++++++++++++++
server/views/images/index.html.haml | 4 --
server/views/layout.html.haml | 5 +++
10 files changed, 104 insertions(+), 25 deletions(-)
create mode 100644 server/public/images/bread-bg.png
create mode 100644 server/public/images/error.png
create mode 100644 server/views/error.html.haml
diff --git a/server/lib/deltacloud/helpers/application_helper.rb
b/server/lib/deltacloud/helpers/application_helper.rb
index fdd73e9..89ef205 100644
--- a/server/lib/deltacloud/helpers/application_helper.rb
+++ b/server/lib/deltacloud/helpers/application_helper.rb
@@ -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/#[email protected]_s}")
+ elsif [:show, :stop, :start, :reboot, :attach,
:detach].include?(@operation.name)
+ url_for("/api/#[email protected]_s}/:id/#[email protected]}")
+ elsif [:destroy].include?(@operation.name)
+ url_for("/api/#[email protected]_s}/:id")
+ else
+ url_for("/api/#[email protected]}/#[email protected]}")
+ end
+ end
+
end
diff --git a/server/public/images/bread-bg.png
b/server/public/images/bread-bg.png
new file mode 100644
index
0000000000000000000000000000000000000000..7321df4be23ef125db28eca29804e51f4c9d547d
GIT binary patch
literal 257
zcm...@n?(olHy`uVBq!ia0vp^%s?#4!3HFomxovaDaPU;cPEB*=VV?2Ic!PZ?k)`P
zK(H(Gg9uQBv%n*=n1O*?7=#%aX3dcR3bL1Y`ns~;w...@o_q)mT(KQ6DHIS>hT|;+&tG
zo0?a`;9qinsdy...@y+mq2tw68xy>eCk|8;<LTlUB5^si|D>QxAP3WK-Ov7?SRcv6
zyy{mMclfY3oPlHICQ*emO79mKUn!6>n<FMLRpJL1&q...@x{z0!`tfszrp!iel_nit<
t9p8uhj;|t>{coH$o}OnWqrChN!!}+X4f}&fynyyFc)I$ztaD0e0svnpP4WN$
literal 0
HcmV?d00001
diff --git a/server/public/images/error.png b/server/public/images/error.png
new file mode 100644
index
0000000000000000000000000000000000000000..d64c533f52ac464452294b70abdbf84f9e65d37a
GIT binary patch
literal 3080
zcmV+j4EOViP)<h;3K|lk000e1njltq001xm001x...@s6r|5Hm000ZmNkl<ZXo1z5
zTZ~oLdB=b2vM=W{b7la0fSCb<!CY)827(QyjPD_~!ICevNNf?OCQd9<>>xX|O`rPE
zs!vs=Dt)qgOQcwl>`Ez7DqC*qhT5sY!6dO$7~>ifU|{au%sg4...@y2-ou0edw?nt
zmh@@wGiRT*zW?|CZfork&N+UUhX(k&m10^aZCg}D#R45`(t%M<9BEAJ`~W8LS2^u7
zpBwGKysJ1raCHDQ0e`#Zu?G*Wx^L4V;3Z(jRagfo0J!Osz_H_&EnUyFuNi8cyR5Hy
z^OLtdS&4WK1BmGp75UrgW}v<8y4L6CZdnDtI11f;L|sc*w5Dw*uw<Io0;ZXPQ1Z;$
z$L{T*_W+~<f)X4&z`7?lv@|!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#gd=4P<((r)TiwM+Xocf|JJ_K_pR;K!p$l3KuG5sBt<#Xzdl08leL3
z_ez2?AkKo$K#qYN0TGO66=xbgfNcY3QZNb5Wd69tD1?cynZTt2VHGY5v1x`d2A3Ix
z5oFd;ks0nedujb2g$g...@zkzt}o9}jf%jp-j^a{xt2uwgzcdthh9;YiJmpF8*~#s
z7kk*^KL6U~Zaw~z<O0{<xX;PZRVm^YRUaEj|6z21*S(uN$M<g&fs{l-oKsZtoBLNW
z0YIU+n5g(gm!~+d...@`e?3n60f<#4K;+LE!1|Xz^&%LH<Geg1e)q=j{az8...@gb
W3^&|4gHQbc0000<MNUMnLSTYBHqEgB
literal 0
HcmV?d00001
diff --git a/server/public/stylesheets/compiled/application.css
b/server/public/stylesheets/compiled/application.css
index 569007b..dd8e763 100644
--- a/server/public/stylesheets/compiled/application.css
+++ b/server/public/stylesheets/compiled/application.css
@@ -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;
+}
diff --git a/server/public/stylesheets/compiled/screen.css
b/server/public/stylesheets/compiled/screen.css
index 81df7e5..6e5be2d 100644
--- a/server/public/stylesheets/compiled/screen.css
+++ b/server/public/stylesheets/compiled/screen.css
@@ -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
*/
diff --git a/server/views/api/show.html.haml b/server/views/api/show.html.haml
index 74ec175..140d227 100644
--- a/server/views/api/show.html.haml
+++ b/server/views/api/show.html.haml
@@ -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})
diff --git a/server/views/docs/operation.html.haml
b/server/views/docs/operation.html.haml
index 79bb6bb..4b483b8 100644
--- a/server/views/docs/operation.html.haml
+++ b/server/views/docs/operation.html.haml
@@ -1,17 +1,13 @@
%h2
- %a{:href => url_for("/api/docs/#[email protected]_s}")}
#[email protected]_s.titlecase}
- #{'::'}
- #[email protected]}
+ = action_method(@operation.name, @collection.name).to_s.upcase
+ = action_url
-%p #[email protected]}
+%p
+ #[email protected]}
%br
-%h3
- URL:
- %u
- = url_for("/api/#[email protected]_s}/#[email protected]_s}")
-%br
-%h3 Parameters:
+
+%h2 Parameters:
%table
diff --git a/server/views/error.html.haml b/server/views/error.html.haml
new file mode 100644
index 0000000..b8f0246
--- /dev/null
+++ b/server/views/error.html.haml
@@ -0,0 +1,31 @@
+!!!
+!!! XML
+
+%html
+ %head
+ = stylesheet_link_tag '/stylesheets/compiled/screen.css', :media =>
'screen, projection'
+ = stylesheet_link_tag '/stylesheets/compiled/print.css', :media => 'print'
+ /[if lt IE 8]
+ = stylesheet_link_tag '/stylesheets/compiled/ie.css', :media => 'screen,
projection'
+ = stylesheet_link_tag '/stylesheets/compiled/application.css', :media =>
'screen, projection'
+ %script{:type => "text/javascript", :src =>
"/javascripts/jquery-1.4.2.min.js" }
+ %script{:type => "text/javascript", :src => "/javascripts/application.js" }
+ %body
+ #wrapper
+ #header
+ = link_to image_tag( "/images/logo-wide.png" ), root_url
+ = bread_crumb
+ #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
+ Copyright 2009, 2010
+ %a{:href => 'http://redhat.com'} Red Hat
+ and individual contributors.
diff --git a/server/views/images/index.html.haml
b/server/views/images/index.html.haml
index 33499b9..a713259 100644
--- a/server/views/images/index.html.haml
+++ b/server/views/images/index.html.haml
@@ -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
diff --git a/server/views/layout.html.haml b/server/views/layout.html.haml
index 1556272..60e3130 100644
--- a/server/views/layout.html.haml
+++ b/server/views/layout.html.haml
@@ -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
--
1.7.3.4