diff options
Diffstat (limited to 'chef-server/lib/views')
27 files changed, 584 insertions, 0 deletions
diff --git a/chef-server/lib/views/cookbook_templates/index.html.haml b/chef-server/lib/views/cookbook_templates/index.html.haml new file mode 100644 index 0000000000..307aefd812 --- /dev/null +++ b/chef-server/lib/views/cookbook_templates/index.html.haml @@ -0,0 +1,8 @@ +%h1 Cookbook Templates +- @templates.each do |template, data| + .index + %table + %tr + %td + %a{ :href => url(:cookbook_template, { :cookbook_id => params[:cookbook_id], :id => data[:link_name], :version => data[:version] }) } + = "#{data[:version]} - #{data[:name]}" diff --git a/chef-server/lib/views/cookbooks/_attribute_file.html.haml b/chef-server/lib/views/cookbooks/_attribute_file.html.haml new file mode 100644 index 0000000000..af859d5ff3 --- /dev/null +++ b/chef-server/lib/views/cookbooks/_attribute_file.html.haml @@ -0,0 +1,2 @@ +%h3= name += ::Uv.parse(contents, "xhtml", "ruby", true, "twilight")
\ No newline at end of file diff --git a/chef-server/lib/views/cookbooks/attribute_files.html.haml b/chef-server/lib/views/cookbooks/attribute_files.html.haml new file mode 100644 index 0000000000..56fdcf7bee --- /dev/null +++ b/chef-server/lib/views/cookbooks/attribute_files.html.haml @@ -0,0 +1,4 @@ +%h1 All Attribute Files +- @attribute_files.each do |af_hash| + %h2= "#{af_hash[:cookbook]}" + = partial(:attribute_file, :name => af_hash[:name], :contents => af_hash[:contents])
\ No newline at end of file diff --git a/chef-server/lib/views/cookbooks/index.html.haml b/chef-server/lib/views/cookbooks/index.html.haml new file mode 100644 index 0000000000..008f74765c --- /dev/null +++ b/chef-server/lib/views/cookbooks/index.html.haml @@ -0,0 +1,7 @@ +%h1 Cookbooks +- @cl.each do |cookbook| + .index + %table + %tr + %td + %a{ :href => url(:cookbook, { :id => cookbook.name }) }= cookbook.name diff --git a/chef-server/lib/views/cookbooks/show.html.haml b/chef-server/lib/views/cookbooks/show.html.haml new file mode 100644 index 0000000000..1b6557e012 --- /dev/null +++ b/chef-server/lib/views/cookbooks/show.html.haml @@ -0,0 +1,24 @@ +%h1= "Cookbook #{h @cookbook.name}" +.cookbook +- if @cookbook.attribute_files.length > 0 + %h2 Attribute Files + - @cookbook.attribute_files.each do |af| + = partial(:attribute_file, :name => File.basename(af), :contents => File.read(af)) + +- if @cookbook.definition_files.length > 0 + - @cookbook.definition_files.each do |df| + %h2 Definition Files + %h3= File.basename(df) + = ::Uv.parse(File.read(df), "xhtml", "ruby", true, "twilight") + +- if @cookbook.recipe_files.length > 0 + - @cookbook.recipe_files.each do |rf| + %h2 Recipe Files + %h3= File.basename(rf) + = ::Uv.parse(File.read(rf), "xhtml", "ruby", true, "twilight") + +- if @cookbook.template_files.length > 0 + - @cookbook.template_files.each do |tf| + %h2 Template Files + %h3= File.basename(tf) + = ::Uv.parse(File.read(tf), "xhtml", "html_rails", true, "twilight") diff --git a/chef-server/lib/views/exceptions/bad_request.json.erb b/chef-server/lib/views/exceptions/bad_request.json.erb new file mode 100644 index 0000000000..f266cf99b9 --- /dev/null +++ b/chef-server/lib/views/exceptions/bad_request.json.erb @@ -0,0 +1 @@ +<%= { :error => params[:exception], :code => 400 }.to_json %>
\ No newline at end of file diff --git a/chef-server/lib/views/exceptions/internal_server_error.html.erb b/chef-server/lib/views/exceptions/internal_server_error.html.erb new file mode 100644 index 0000000000..aadbfad350 --- /dev/null +++ b/chef-server/lib/views/exceptions/internal_server_error.html.erb @@ -0,0 +1,216 @@ +<html> +<head> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <title><%= @exception_name %></title> + <style type="text/css" media="screen"> + body { + font-family:arial; + font-size:11px; + } + h1 { + font-size:48px; + letter-spacing:-4px; + margin:0; + line-height:36px; + color:#333; + } + h1 sup { + font-size: 0.5em; + } + h1 sup.error_500, h1 sup.error_400 { + color:#990E05; + } + h1 sup.error_100, h1 sup.error_200 { + color:#00BF10; + } + h1 sup.error_300 { + /* pretty sure you cant 'see' status 300 + errors but if you could I think they + would be blue */ + color:#1B2099; + } + h2 { + font-size:36px; + letter-spacing:-3px; + margin:0; + line-height:28px; + color:#444; + } + a, a:visited { + color:#00BF10; + } + .internalError { + width:800px; + margin:50px auto; + } + .header { + border-bottom:10px solid #333; + margin-bottom:1px; + background-image: url("data:image/gif;base64,R0lGODlhAwADAIAAAP///8zMzCH5BAAAAAAALAAAAAADAAMAAAIEBHIJBQA7"); + padding:20px; + } + table.trace { + width:100%; + font-family:courier, monospace; + letter-spacing:-1px; + border-collapse: collapse; + border-spacing:0; + } + table.trace tr td{ + padding:0; + height:26px; + font-size:13px; + vertical-align:middle; + } + table.trace tr.file{ + border-top:2px solid #fff; + background-color:#F3F3F3; + } + table.trace tr.source { + background-color:#F8F8F8; + display:none; + } + table.trace .open tr.source { + display:table-row; + } + table.trace tr.file td.expand { + width:23px; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAXCAIAAABvSEP3AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAdVJREFUeNqMVL+TwUAYxaRIOlEhlZHGDAUzzOQ61+AqXMV1lJSU7q/QRqm8KFUcJTNn5qJkaPyoKKVz7y4mF8na5Kt29tt9+/Z97/u81+vVQ4r9frdarS6Xi7ETDIZisRjxMGPfmk4niNPpZE+xLAugbPaZ53nzvtfMBe/3+/3dbuehBrAKhZdUKkVAWa9Xsiybv0CPZDJZLr/qa5/BwgwRjYqOKIvFYjQa/aNommZh0Ww2K5UqzwfoQOPxaLPZ3FAmk0+7lplMpt1u53J5OpBOR0eZEE9wHJfP5zud93g88QhluwWbjW+5VOmKBgKBer3eaDTDYeGBQF8+x7rqIYoiPgixWJazpA6HA+MSxRArkUgMh0M409g8Ho8+9wYxxCqVSq1W26EDHGM2m4HOHQrEc38f/Yn7cLmlIRhBENzcx8cVRZnPZ/YUep2BWkjTIfA+PKVpZAXR5QxsjiqCKvGEqqp443w+0dvy17swqD0HB3S73V5PpkNg1qBqt8kwGCjmPkinM0QJbIoEa7U6UG6ToVgs4V9G2g0ESoP5Aoi7KYX5oCgf8IKbkvn9/mr1LRQKESamzgJy0g0tSZIuB3nuGqRU9Vv9C4sKkUhEkp4soxvxI8AAhWrrtXa3X8EAAAAASUVORK5CYII=); + background-position:top left; + background-repeat:no-repeat; + } + table.trace .open tr.file td.expand { + width:19px; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAB1CAIAAAAqdO2mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAXZJREFUeNrslK1ywkAUhcMOBomEOiSdqLxEBJX0NaijOsjyHGGmCGyQQYaiiiw4gktkcOmZbpsuuzQ/M5XnqJ2d3S/n3nM3rTzPLUP7/Tt0+pLcGQwG3W53OLyHzPMtjYL7q9UqSRLrD4E1Gj1orCvKYuFHUWTVkOM44/HjDcp8/lL4r6NerzeZPMm1KFw0QkDn83m5fP2lHA4fNQvRtNvtjsfDd0WzmSfb2e/fdTqdOvdh/HLJZLOn0+d2HJ+KRGzbdl23EpFlmed5cp2maRzHQq1lvQ5KMi6EUZBGfup6E1pTfd+vrGW7jbQ2C9hTt9BpqNyIWaAwAy6xg2eBz5iRC/NomiZhGN5sqmnkauo0BUGgVQoBjQ80oCACgNQdZHfTYBkF2mxCtWWAqunWpahxIDUt3QYUxIFQpJHyIWpXjinabKbbwItMHT+NyjchrP8QKaSQQgoppJBCCimkkEIKKaSQQgoppJBCCimkkEIKKaSo+hRgAEFD17X08O2NAAAAAElFTkSuQmCC); + background-position:top left; + background-repeat:no-repeat; + } + table.trace tr.source td.collapse { + width:19px; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAB1CAIAAAAqdO2mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAVxJREFUeNrs0zFygkAUBmBlUkgJHdABlQwVkVJKKUxBYWbkALTxMJwhltyDFkss03IF8pudIcwaDaDl/6pd2P327b7d+eHwMXs4lNkzggoVKlSoUKFChQoVKlSoUKFChQoVKlSoUKFChQqVEYqm6ft9+qiSJEkYho7jTlcw2fd9NOI4nq4gEdFwXXe1Cqco63VkWVbXRTqLhTpOwQRpF7quR1E0TgGhqvLKUFCyoQqG/rks3O6kZKW/eRFpevOCoGTXVTcMQ5EyxyDEkML1c5RzuZOICIyXqn7JBVez6282MWrx731HOv2qB8Hri2lamNk0DfpVVdV1Peodappmmua8bdvzuc7zfNprzrLMth1FnGh/X8MjCAIQv/cFz/+65PcDh7rbvYv2ZUfdj+PxsyzLgVl0hKwgTqeqKApx2LeOc7t98zyv/1FWOgvx9RPii23bmL9cetJ8Ed8CDAC6aFW8bCzFhwAAAABJRU5ErkJggg==); + background-position:bottom left; + background-repeat:no-repeat; + background-color:#6F706F; + } + table.trace tr td.path { + padding-left:10px; + } + table.trace tr td.code { + padding-left:35px; + white-space: pre; + line-height:9px; + padding-bottom:10px; + } + table.trace tr td.code em { + font-weight:bold; + color:#00BF10; + } + table.trace tr td.code a { + width: 20px; + float: left; + } + table.trace tr td.code .more { + color:#666; + } + table.trace tr td.line { + width:30px; + text-align:right; + padding-right:4px; + } + .footer { + margin-top:5px; + font-size:11px; + color:#444; + text-align:right; + } + </style> +</head> +<body> + <div class="internalError"> + + <div class="header"> + <h1><%= @exception_name %> <sup class="error_<%= @exception.class::STATUS %>"><%= @exception.class::STATUS %></sup></h1> + <% if show_details = ::Merb::Config[:exception_details] -%> + <h2><%= @exception.message %></h2> + <% else -%> + <h2>Sorry about that...</h2> + <% end -%> + <h3>Parameters</h3> + <ul> + <% params[:original_params].each do |param, value| %> + <li><strong><%= param %>:</strong> <%= value.inspect %></li> + <% end %> + <%= "<li>None</li>" if params[:original_params].empty? %> + </ul> + + <h3>Session</h3> + <ul> + <% params[:original_session].each do |param, value| %> + <li><strong><%= param %>:</strong> <%= value.inspect %></li> + <% end %> + <%= "<li>None</li>" if params[:original_session].empty? %> + </ul> + + <h3>Cookies</h3> + <ul> + <% params[:original_cookies].each do |param, value| %> + <li><strong><%= param %>:</strong> <%= value.inspect %></li> + <% end %> + <%= "<li>None</li>" if params[:original_cookies].empty? %> + </ul> + </div> + + <% if show_details %> + <table class="trace"> + <% @exception.backtrace.each_with_index do |line, index| %> + <tbody class="close"> + <tr class="file"> + <td class="expand"> + </td> + <td class="path"> + <%= (line.match(/^([^:]+)/)[1] rescue 'unknown').sub(/\/((opt|usr)\/local\/lib\/(ruby\/)?(gems\/)?(1.8\/)?(gems\/)?|.+\/app\/)/, '') %> + <% unless line.match(/\.erb:/) %> + in "<strong><%= line.match(/:in `(.+)'$/)[1] rescue '?' %></strong>" + <% else %> + (<strong>ERB Template</strong>) + <% end %> + </td> + <td class="line"> + <a href="txmt://open?url=file://<%=file = (line.match(/^([^:]+)/)[1] rescue 'unknown')%>&line=<%= lineno = line.match(/:([0-9]+):/)[1] rescue '?' %>"><%=lineno%></a> + </td> + </tr> + <tr class="source"> + <td class="collapse"> + </td> + <td class="code" colspan="2"><% (__caller_lines__(file, lineno, 5) rescue []).each do |llineno, lcode, lcurrent| %> +<a href="txmt://open?url=file://<%=file%>&line=<%=llineno%>"><%= llineno %></a><%='<em>' if llineno==lineno.to_i %><%= lcode.size > 90 ? CGI.escapeHTML(lcode[0..90])+'<span class="more">......</span>' : CGI.escapeHTML(lcode) %><%='</em>' if llineno==lineno.to_i %> +<% end %> + +</td> + </tr> + </tbody> + <% end %> + </table> + <script type="text/javascript" charset="utf-8"> + // swop the open & closed classes + els = document.getElementsByTagName('td'); + for(i=0; i<els.length; i++){ + if(els[i].className=='expand' || els[i].className=='collapse'){ + els[i].onclick = function(e){ + tbody = this.parentNode.parentNode; + if(tbody.className=='open'){ + tbody.className='closed'; + }else{ + tbody.className='open'; + } + } + } + } + </script> + <% end %> + <div class="footer"> + lots of love, from <a href="#">merb</a> + </div> + </div> +</body> +</html>
\ No newline at end of file diff --git a/chef-server/lib/views/exceptions/not_acceptable.html.erb b/chef-server/lib/views/exceptions/not_acceptable.html.erb new file mode 100644 index 0000000000..f632712bb2 --- /dev/null +++ b/chef-server/lib/views/exceptions/not_acceptable.html.erb @@ -0,0 +1,63 @@ +<div id="container"> + <div id="header-container"> + <img src="/images/merb.jpg" /> + <!-- <h1>Mongrel + Erb</h1> --> + <h2>pocket rocket web framework</h2> + <hr /> + </div> + + <div id="left-container"> + <h3>Exception:</h3> + <p><%= params[:exception] %></p> + </div> + + <div id="main-container"> + <h3>Why am I seeing this page?</h3> + <p>Merb couldn't find an appropriate content_type to return, + based on what you said was available via provides() and + what the client requested.</p> + + <h3>How to add a mime-type</h3> + <pre><code> + Merb.add_mime_type :pdf, :to_pdf, %w[application/pdf], "Content-Encoding" => "gzip" + </code></pre> + <h3>What this means is:</h3> + <ul> + <li>Add a mime-type for :pdf</li> + <li>Register the method for converting objects to PDF as <code>#to_pdf</code>.</li> + <li>Register the incoming mime-type "Accept" header as <code>application/pdf</code>.</li> + <li>Specify a new header for PDF types so it will set <code>Content-Encoding</code> to gzip.</li> + </ul> + + <h3>You can then do:</h3> + <pre><code> + class Foo < Application + provides :pdf + end + </code></pre> + + <h3>Where can I find help?</h3> + <p>If you have any questions or if you can't figure something out, please take a + look at our <a href="http://merbivore.com/"> project page</a>, + feel free to come chat at irc.freenode.net, channel #merb, + or post to <a href="http://groups.google.com/group/merb">merb mailing list</a> + on Google Groups.</p> + + <h3>What if I've found a bug?</h3> + <p>If you want to file a bug or make your own contribution to Merb, + feel free to register and create a ticket at our + <a href="http://merb.lighthouseapp.com/">project development page</a> + on Lighthouse.</p> + + <h3>How do I edit this page?</h3> + <p>You can change what people see when this happens by editing <tt>app/views/exceptions/not_acceptable.html.erb</tt>.</p> + + </div> + + <div id="footer-container"> + <hr /> + <div class="left"></div> + <div class="right">© 2007 the merb dev team</div> + <p> </p> + </div> +</div> diff --git a/chef-server/lib/views/exceptions/not_found.html.erb b/chef-server/lib/views/exceptions/not_found.html.erb new file mode 100644 index 0000000000..388c72c31d --- /dev/null +++ b/chef-server/lib/views/exceptions/not_found.html.erb @@ -0,0 +1,47 @@ +<div id="container"> + <div id="header-container"> + <img src="/images/merb.jpg" /> + <!-- <h1>Mongrel + Erb</h1> --> + <h2>pocket rocket web framework</h2> + <hr /> + </div> + + <div id="left-container"> + <h3>Exception:</h3> + <p><%= params[:exception] %></p> + </div> + + <div id="main-container"> + <h3>Welcome to Merb!</h3> + <p>Merb is a light-weight MVC framework written in Ruby. We hope you enjoy it.</p> + + <h3>Where can I find help?</h3> + <p>If you have any questions or if you can't figure something out, please take a + look at our <a href="http://merbivore.com/"> project page</a>, + feel free to come chat at irc.freenode.net, channel #merb, + or post to <a href="http://groups.google.com/group/merb">merb mailing list</a> + on Google Groups.</p> + + <h3>What if I've found a bug?</h3> + <p>If you want to file a bug or make your own contribution to Merb, + feel free to register and create a ticket at our + <a href="http://merb.lighthouseapp.com/">project development page</a> + on Lighthouse.</p> + + <h3>How do I edit this page?</h3> + <p>You're seeing this page because you need to edit the following files: + <ul> + <li>config/router.rb <strong><em>(recommended)</em></strong></li> + <li>app/views/exceptions/not_found.html.erb <strong><em>(recommended)</em></strong></li> + <li>app/views/layout/application.html.erb <strong><em>(change this layout)</em></strong></li> + </ul> + </p> + </div> + + <div id="footer-container"> + <hr /> + <div class="left"></div> + <div class="right">© 2007 the merb dev team</div> + <p> </p> + </div> +</div> diff --git a/chef-server/lib/views/layout/application.html.haml b/chef-server/lib/views/layout/application.html.haml new file mode 100644 index 0000000000..2be4097d29 --- /dev/null +++ b/chef-server/lib/views/layout/application.html.haml @@ -0,0 +1,26 @@ +!!! XML +!!! +%html + %head + %title Chef Server + %meta{"http-equiv" => "content-type", :content => "text/html; charset=utf-8" } + %link{:rel => "stylesheet", :href => "/stylesheets/master.css", :type => "text/css", :media => "screen", :charset => "utf-8" } + %body + .header + %a{:href => url(:searches) } Search + | + %a{:href => url(:nodes) } Nodes + | + %a{:href => url(:cookbooks) } Cookbooks + | + %a{:href => url(:registrations)} Registrations + - if session[:openid] + | + %a{:href => url(:openid_consumer_logout)}= "Logout #{h session[:openid]}" + = "(#{session[:level].to_s})" + - else + | + %a{:href => url(:openid_consumer)} Login + = catch_content :for_layout + +
\ No newline at end of file diff --git a/chef-server/lib/views/nodes/_action.html.haml b/chef-server/lib/views/nodes/_action.html.haml new file mode 100644 index 0000000000..8adb39338d --- /dev/null +++ b/chef-server/lib/views/nodes/_action.html.haml @@ -0,0 +1,13 @@ +%table + - actions.each do |action, resource_hash| + %tr + %td.action_name= action.to_s + %td.action_resources + %table + - resource_hash.keys.sort{ |a,b| a.to_s <=> b.to_s }.each do |rk| + %tr + %td.action_when= rk.to_s + %td + - resource_hash[rk].each do |resource| + = partial(:resource, :resource => resource) +
\ No newline at end of file diff --git a/chef-server/lib/views/nodes/_node.html.haml b/chef-server/lib/views/nodes/_node.html.haml new file mode 100644 index 0000000000..24b1f2816b --- /dev/null +++ b/chef-server/lib/views/nodes/_node.html.haml @@ -0,0 +1,9 @@ +.node + %h1 + = "Node #{h node.name}" + %h2 Recipes + %ol + = recipe_list(node) + %h2 Attributes + %ol + = attribute_list(node) diff --git a/chef-server/lib/views/nodes/_resource.html.haml b/chef-server/lib/views/nodes/_resource.html.haml new file mode 100644 index 0000000000..7b9776b816 --- /dev/null +++ b/chef-server/lib/views/nodes/_resource.html.haml @@ -0,0 +1,22 @@ +.resource + %h3= "#{h resource.to_s} (#{resource.class})" + %table + - resource.instance_variables.sort.each do |v| + - attr_name = v.gsub(/\@/, "") + - unless attr_name == "collection" + %tr.attr_group + %td.attr_name + = "#{h attr_name}" + %td.attr_value + - value = resource.instance_variable_get(v) + - if value.kind_of?(String) + = "#{h value}" + - elsif value.kind_of?(Array) + = "#{h value.join(", ")}" + - elsif value.kind_of?(Symbol) + = "#{h value.to_s}" + - elsif attr_name == "actions" + = partial(:action, :actions => value) + - else + = "#{h value.inspect}" + diff --git a/chef-server/lib/views/nodes/compile.html.haml b/chef-server/lib/views/nodes/compile.html.haml new file mode 100644 index 0000000000..5656447ea8 --- /dev/null +++ b/chef-server/lib/views/nodes/compile.html.haml @@ -0,0 +1,5 @@ += partial(:node, :node => @output[:node]) +.resource_collection + %h1 Resource Collection + - @output[:collection].each do |resource| + = partial(:resource, :resource => resource) diff --git a/chef-server/lib/views/nodes/index.html.haml b/chef-server/lib/views/nodes/index.html.haml new file mode 100644 index 0000000000..667e1c7317 --- /dev/null +++ b/chef-server/lib/views/nodes/index.html.haml @@ -0,0 +1,9 @@ +%h1 Node List +- @node_list.each do |node| + .node + %a{ :href => url(:node, { :id => node.gsub(/\./, "_") }) } + = node + %form{ :method => "post", :action => url(:node, { :id => node.gsub(/\./, "_") })} + %input{ :type => "hidden", :name => "_method", :value => "delete" } + %input{ :type => "submit", :name => "Delete", :value => "Delete" } +
\ No newline at end of file diff --git a/chef-server/lib/views/nodes/show.html.haml b/chef-server/lib/views/nodes/show.html.haml new file mode 100644 index 0000000000..94708af6d3 --- /dev/null +++ b/chef-server/lib/views/nodes/show.html.haml @@ -0,0 +1 @@ += partial(:node, :node => @node)
\ No newline at end of file diff --git a/chef-server/lib/views/openid_consumer/index.html.haml b/chef-server/lib/views/openid_consumer/index.html.haml new file mode 100644 index 0000000000..576ef8d787 --- /dev/null +++ b/chef-server/lib/views/openid_consumer/index.html.haml @@ -0,0 +1,25 @@ +%h1 OpenID Relying Party +-if session[:alert] + .alert= h session[:alert] +-if session[:error] + .error= h session[:error] +-if session[:success] + .success= h session[:success] +#verify-form + %form{ :method => "get", "accept-charset" => "UTF-8", :action => url(:openid_consumer_start) } + Identifier: + %input.openid{ :type => "text", :name => "openid_identifier" }/ + %input{ :type => "submit", :value => "Verify"}/ + %br + %input#immediate{ :name => "immediate", :type => "checkbox" }/ + %label{:for => "immediate"} Use immediate mode + %br + %input#immediate{ :name => "use_sreg", :type => "checkbox" }/ + %label{:for => "use_sreg"} Request registration data + %br + %input#immediate{ :name => "use_pape", :type => "checkbox" }/ + %label{:for => "use_pape"} Request phishing-resistent auth policy + %br + %input#immediate{ :name => "force_post", :type => "checkbox" }/ + %label{:for => "force_post"} Force the transaction to POST + %br diff --git a/chef-server/lib/views/openid_consumer/start.html.haml b/chef-server/lib/views/openid_consumer/start.html.haml new file mode 100644 index 0000000000..75ed9a9257 --- /dev/null +++ b/chef-server/lib/views/openid_consumer/start.html.haml @@ -0,0 +1,4 @@ +<%= @form_text %> +<script type="text/javascript"> +document.getElementById('openid_form').submit(); +</script>
\ No newline at end of file diff --git a/chef-server/lib/views/openid_login/index.html.haml b/chef-server/lib/views/openid_login/index.html.haml new file mode 100644 index 0000000000..17ae69017a --- /dev/null +++ b/chef-server/lib/views/openid_login/index.html.haml @@ -0,0 +1,6 @@ +%h1 Login +#login-form + %form{ :method => "get", :action => url(:openid_login_submit) } + %input{ :type => "text", :name => "username" }/ + %input{ :type => "submit", :value => "Log In"}/ +
\ No newline at end of file diff --git a/chef-server/lib/views/openid_register/index.html.haml b/chef-server/lib/views/openid_register/index.html.haml new file mode 100644 index 0000000000..fe4798c59d --- /dev/null +++ b/chef-server/lib/views/openid_register/index.html.haml @@ -0,0 +1,15 @@ +%h1 Registered OpenID Nodes List +%table +- @registered_nodes.each do |node| + %tr + %td + %a{ :href => url(:registration, { :id => node.name }) } + = h node.name + %td + - if session[:level] == :admin + %form{ :method => "post", :action => url(:validate_registration, { :id => node.name })} + - submit_name = node.validated ? "Invalidate" : "Validate" + %input{ :type => "submit", :name => submit_name, :value => submit_name } + %form{ :method => "post", :action => url(:registration, { :id => node.name })} + %input{ :type => "hidden", :name => "_method", :value => "delete" } + %input{ :type => "submit", :name => "Delete", :value => "Delete" } diff --git a/chef-server/lib/views/openid_register/show.html.haml b/chef-server/lib/views/openid_register/show.html.haml new file mode 100644 index 0000000000..cfd38e8963 --- /dev/null +++ b/chef-server/lib/views/openid_register/show.html.haml @@ -0,0 +1,5 @@ +%h1= "Registered OpenID Node #{@registered_node.name}" +%ol + %li + %a{ :href => url(:openid_node , { :id => @registered_node.name.gsub(/\./, "_") }) } OpenID URL + %li= "Validated: #{@registered_node.validated}" diff --git a/chef-server/lib/views/openid_server/decide.html.haml b/chef-server/lib/views/openid_server/decide.html.haml new file mode 100644 index 0000000000..8082a5068d --- /dev/null +++ b/chef-server/lib/views/openid_server/decide.html.haml @@ -0,0 +1,27 @@ +%form{:method => "post", :action => url(:openid_server_decision)} + %table + %tr + %td Site: + %td= @oidreq.trust_root + - if @oidreq.id_select + %tr + %td{:colspan => "2"} + You entered the server identifier at the relying party. + You will need to send an identifier of your choosing. + Enter a username and password below. + %tr + %td Identity to send: + %td + %input{:type => "text", :name => "id_to_send", :size => "25"} + - else + %tr + %td Identity: + %td= @oidreq.identity + %tr + %td + %label{:for => "password"} Password: + %td + %input{:type => "password", :name => "password"} + %input{:type => "submit", :name => "submit", :value => "Authenticate"} + %input{:type => "submit", :name => "cancel", :value => "Cancel"} + diff --git a/chef-server/lib/views/search/_search_form.html.haml b/chef-server/lib/views/search/_search_form.html.haml new file mode 100644 index 0000000000..99303e1714 --- /dev/null +++ b/chef-server/lib/views/search/_search_form.html.haml @@ -0,0 +1,6 @@ +%form{ :method => "get", :action => url(:search, { :id => index_name }) } + Q: + %input{ :type => "text", :name => "q" } + A: + %input{ :type => "text", :name => "a" } + %input{ :type => "submit", :value => "Search #{index_name}" } diff --git a/chef-server/lib/views/search/index.html.haml b/chef-server/lib/views/search/index.html.haml new file mode 100644 index 0000000000..742c1110b0 --- /dev/null +++ b/chef-server/lib/views/search/index.html.haml @@ -0,0 +1,9 @@ +%h1 Search Indexes +- @search_indexes.each do |index| + .index + %table + %tr + %td + %a{ :href => url(:search, { :id => index }) }= index + %td + = partial(:search_form, :index_name => index) diff --git a/chef-server/lib/views/search/show.html.haml b/chef-server/lib/views/search/show.html.haml new file mode 100644 index 0000000000..5380a7477a --- /dev/null +++ b/chef-server/lib/views/search/show.html.haml @@ -0,0 +1,13 @@ +%h1 Search Results +.search + = partial(:search_form, :index_name => params[:id]) +.query + %h2= "Search Query was #{params[:q] ? params[:q] : '*'}" +- @results.each do |result| + .search_result + %h3= "#{h result[:index_name]} (#{h result[:id]})" + %table + - result.each do |k, v| + %tr.attr_group + %td.attr_name= k + %td.attr_value= v.kind_of?(Array) ? v.join(",") : v
\ No newline at end of file diff --git a/chef-server/lib/views/search_entries/index.html.haml b/chef-server/lib/views/search_entries/index.html.haml new file mode 100644 index 0000000000..77d140242e --- /dev/null +++ b/chef-server/lib/views/search_entries/index.html.haml @@ -0,0 +1,9 @@ +%h1= "Search Index #{h params[:search_id]}" +- @entries.each do |result| + .search_result + %h3= "#{h result[:index_name]} (#{h result[:id]})" + %table + - result.each do |k, v| + %tr.attr_group + %td.attr_name= k + %td.attr_value= v.kind_of?(Array) ? v.join(",") : v
\ No newline at end of file diff --git a/chef-server/lib/views/search_entries/show.html.haml b/chef-server/lib/views/search_entries/show.html.haml new file mode 100644 index 0000000000..7ca34b32ab --- /dev/null +++ b/chef-server/lib/views/search_entries/show.html.haml @@ -0,0 +1,8 @@ +%h1= "Search Index #{h params[:search_id]} entry #{h params[:id]}" +.search_result + %h3= "#{h @entry[:index_name]} (#{h @entry[:id]})" + %table + - @entry.each do |k, v| + %tr.attr_group + %td.attr_name= k + %td.attr_value= v.kind_of?(Array) ? v.join(",") : v
\ No newline at end of file |