Commit 5bc3ac65 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

serve sample report from sinatra

parent 573f0fc8
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -8,8 +8,9 @@ class FnordQuery::Web::App < Sinatra::Base

  enable :session

  #set :haml, :format => :html5
  #set :views, ::File.expand_path('../../../../haml', __FILE__)
  set :haml, :format => :html5
  set :views, ::File.expand_path('../../../../web/haml', __FILE__)
  set :public_folder, ::File.expand_path('../../../../web', __FILE__)

  def initialize(opts)
    @opts = opts
@@ -26,7 +27,7 @@ class FnordQuery::Web::App < Sinatra::Base
  end

  get '/' do
  	'hello'
  	render :haml, :app
  end

end
+5 −3
Original line number Diff line number Diff line
@@ -3,9 +3,11 @@ class FnordQuery::Web
  def initialize(opts)
    @opts = opts

    @opts[:server] ||= "thin"
    @opts[:host]   ||= "0.0.0.0"
    @opts[:port]   ||= "4242"
    listen = @opts[:listen]

    @opts[:server] ||= @opts[:web_server] || "thin"
    @opts[:host]   ||= (listen ? listen[0] : nil) || "0.0.0.0"
    @opts[:port]   ||= (listen ? listen[1] : nil) || "4242"
  end

  def execute(runner, backend)

web/haml/app.haml

0 → 100644
+12 −0
Original line number Diff line number Diff line
#sidebar
#viewport{:style => "width: 1700px; "}
  .viewport_inner.clearfix
    .navbar{:style => "margin-bottom:24px;"}
      %a.button Dropdown: Range selector / cached ranges
      %a.button Configure
      %a.button.back «
      %h1
        %a.current Gross Search Volume
        \ 
        %a (07.05.12-15.05.12)
    %iframe{:frameborder => "none", :height => "1500", :scrolling => "no", :src => "report.html", :width => "100%"}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -11,4 +11,4 @@
      %script{:src => "src/fnordquery.timeseries_widget.js", :type => "text/javascript"}
      %link{:href => "fnordquery.css", :rel => "stylesheet", :type => "text/css"}
  %body.inner
    =@render_inner
 No newline at end of file
    =@render_inner || yield
 No newline at end of file