Skip to content

Commit

Permalink
Merge 5323665 into 19cbd23
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Pikesley committed Dec 2, 2013
2 parents 19cbd23 + 5323665 commit 1c9ac28
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
39 changes: 21 additions & 18 deletions lib/uncle_clive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,25 @@
class Spectrum < Sinatra::Base
use Rack::GoogleAnalytics, :tracker => 'UA-20895204-11'

@@layout_locals = {
:bootstrap_theme => '../lavish-bootstrap.css',
:additional_styles => [
'../sinclair.css'
],
:github => {
:user => 'pikesley',
:project => 'uncle-clive',
:ribbon => 'right_darkblue_121621'
}
}

get '/' do
haml :readme, :locals => {
:bootstrap_theme => '../lavish-bootstrap.css',
:title => '© 1982 Sinclair Research Ltd.',
:text => markdown(File.read('README.md')),
:github => {
:user => 'pikesley',
:project => 'uncle-clive',
:ribbon => 'right_darkblue_121621'
}
l = {
:title => '© 1982 Sinclair Research Ltd.',
:text => markdown(File.read('README.md'))
}

haml :readme, :locals => @@layout_locals.merge(l)
end

get '/:text' do
Expand Down Expand Up @@ -64,16 +72,11 @@ def respond text, gitfiti = false

when 'text/html'
cs.formatter = UncleClive::Formatters::HTMLTableFormatter.new
halt haml :tabliser, :locals => {
:bootstrap_theme => '../lavish-bootstrap.css',
:title => params[:text],
:table => cs[params[:text]],
:github => {
:user => 'pikesley',
:project => 'uncle-clive',
:ribbon => 'right_darkblue_121621'
}
l = {
:title => params[:text],
:table => cs[params[:text]]
}
halt haml :tabliser, :locals => @@layout_locals.merge(l)

when 'text/plain'
cs.formatter = UncleClive::Formatters::TextFormatter.new
Expand Down
4 changes: 4 additions & 0 deletions lib/views/layout.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
%head
%title= title
%link{:rel => 'stylesheet', :href => '//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css', :type => "text/css"}
-if defined? additional_styles
-additional_styles.each do |style|
%link{:rel => 'stylesheet', :href => style, :type => "text/css"}

-if defined? bootstrap_theme
%link{:rel => 'stylesheet', :href => bootstrap_theme, :type => "text/css"}

Expand Down

0 comments on commit 1c9ac28

Please sign in to comment.