From cafbf6c7150cb3dadab7a0ac32de42a4c1f6e2ad Mon Sep 17 00:00:00 2001 From: Brandon West Date: Fri, 6 Jan 2012 09:57:53 -0700 Subject: [PATCH] add most of the containers and input fields for endpoints/methods/params --- public/css/default.css | 4 ++ views/endpoints.haml | 90 +++++++++++++++++++++++++++++++++++++++++- views/index.haml | 18 --------- views/methods.haml | 0 views/parameters.haml | 0 5 files changed, 92 insertions(+), 20 deletions(-) delete mode 100644 views/index.haml create mode 100644 views/methods.haml create mode 100644 views/parameters.haml diff --git a/public/css/default.css b/public/css/default.css index 0cf0bcf..c579680 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -1,3 +1,7 @@ body { padding-top: 60px; +} + +.hidden { + display:none; } \ No newline at end of file diff --git a/views/endpoints.haml b/views/endpoints.haml index 77eaa74..f04ce95 100644 --- a/views/endpoints.haml +++ b/views/endpoints.haml @@ -1,2 +1,88 @@ -- @result.endpoints.each do |e| - %h2 #{e.name} \ No newline at end of file +.container-fluid + .sidebar + .well + %h3 Endpoints + %ul + - @result.endpoints.each do |e| + %li + #{e.name} + %ul + - e["methods"].each do |m| + %li #{m.MethodName} + + .content + %form + -count=0 + - @result.endpoints.each do |e| + -count=count+1 + .endpoint{:id => "ep#{count}"} + %h2 + Endpoint: #{e.name} + %fieldset + + .clearfix + %label{:for => "name#{count}"} Endpoint Name + .input + %input{:name => "name#{count}", :id => "name#{count}", :value => "#{e.name}"} + + -# should break this out into another subview + -method_count = 0 + - e["methods"].each do |m| + -method_count=method_count+1 + %legend + Method: #{m.MethodName} + %br/ + .clearfix + %label{:for => "MethodName#{method_count}"} Method Name + .input + %input{:name => "MethodName#{method_count}", :id => "MethodName#{method_count}", :value => "#{m.MethodName}"} + .clearfix + %label{:for => "Synopsis#{method_count}"} Synopsis + .input + %input{:name => "Synopsis#{method_count}", :id => "Synopsis#{method_count}", :value => "#{m.Synopsis}"} + .clearfix + %label{:for => "HTTPMethod#{method_count}"} HTTP Method (GET, POST, PUT, etc) + .input + %input{:name => "HTTPMethod#{method_count}", :id => "HTTPMethod#{method_count}", :value => "#{m.HTTPMethod}"} + .clearfix + %label{:for => "URI#{method_count}"} URI + .input + %input{:name => "URI#{method_count}", :id => "URI#{method_count}", :value => "#{m.URI}"} + .clearfix + %label{:for => "RequiresOAuth#{method_count}"} Requires OAuth? (Y or N) + .input + %input{:name => "RequiresOAuth#{method_count}", :id => "RequiresOAuth#{method_count}", :value => "#{m.RequiresOAuth}"} + + -# and yet another subview here for all the method params + + -param_count = 0 + - m.parameters.each do |p| + -param_count=param_count+1 + %legend + Parameter: #{p.Name} + %br/ + .clearfix + %label{:for => "ParameterName#{param_count}"} Parameter Name + .input + %input{:name => "ParameterName#{param_count}", :id => "ParameterName#{param_count}", :value => "#{p.Name}"} + .clearfix + -#make this a textarea + %label{:for => "Description#{param_count}"} Description + .input + %input{:name => "Description#{param_count}", :id => "Description#{param_count}", :value => "#{p.Description}"} + .clearfix + %label{:for => "Required#{param_count}"} Required? (Y or N) + .input + %input{:name => "Required#{param_count}", :id => "Required#{param_count}", :value => "#{p.Required}"} + .clearfix + %label{:for => "Default#{param_count}"} Default value + .input + %input{:name => "Default#{param_count}", :id => "Default#{param_count}", :value => "#{p.Default}"} + + -#this is where logic is needed to hide/display fields based on type + .clearfix + %label{:for => "Type#{param_count}"} Data type + -#should be a dropdown + .input + %input{:name => "Type#{param_count}", :id => "Type#{param_count}", :value => "#{p.Type}"} + \ No newline at end of file diff --git a/views/index.haml b/views/index.haml deleted file mode 100644 index cc287f0..0000000 --- a/views/index.haml +++ /dev/null @@ -1,18 +0,0 @@ -%html - %head - %title I/O Doctor - GUI for I/O Docs configurations - %link{:href => "/css/bootstrap.min.css", :rel => "stylesheet"} - %link{:href => "/css/default.css", :rel => "stylesheet"} - %body - .topbar - .fill - .container - %a.brand{:href => "#"} I/O Doctor - %ul.nav - %li.active - %a{:href => "#"} Home - %li - %a{:href => "#about"} About - - .container - .content diff --git a/views/methods.haml b/views/methods.haml new file mode 100644 index 0000000..e69de29 diff --git a/views/parameters.haml b/views/parameters.haml new file mode 100644 index 0000000..e69de29