Sha256: e5d526392e0ef23b86dbdb867d8730203eba8a23c28cb02f797f7f7eb7ebef97

Contents?: true

Size: 544 Bytes

Versions: 1

Compression:

Stored size: 544 Bytes

Contents

class Hazel < Sinatra::Base
  get '/' do
    haml :index, :locals => { :body_class => 'home' }
  end
  
  get '/manage' do
    haml :manage, :locals => { :body_class => 'manage' }
  end
  
  helpers do
    def base_url
      @base_url ||= "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}"
    end
    
    def bookmarklet
      haml(:bookmarklet, :locals => {
        :url => "#{base_url}/manage", 
        :window_name => 'hazel-bookmarklet',
        :width => 500, :height => 600
      }).to_s.gsub('\n', '')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hazel-0.0.1 app/hazel.rb