Skip to content

Commit

Permalink
. upgraded to padrino 0.11.1 / sinatra-simple-navigation 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andi committed Apr 10, 2013
1 parent e263464 commit 03a42db
Show file tree
Hide file tree
Showing 15 changed files with 204 additions and 102 deletions.
9 changes: 9 additions & 0 deletions padrino/.components
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
:orm: none
:test: none
:mock: none
:script: none
:renderer: haml
:stylesheet: none
:namespace: Padrino2
:migration_format: number
10 changes: 8 additions & 2 deletions padrino/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
.sass-cache
.components
.DS_Store
log/**/*
tmp/**/*
bin/*
vendor/gems/*
!vendor/gems/cache/
.sass-cache/*
db/*.db
29 changes: 24 additions & 5 deletions padrino/Gemfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
source :rubygems
source 'https://rubygems.org'

# Distribute your app as a gem
# gemspec

# Server requirements
# gem 'thin' # or mongrel
# gem 'trinidad', :platform => 'jruby'

# Optional JSON codec (faster performance)
# gem 'oj'

# Project requirements
gem 'rake'
gem 'rack-flash'
gem 'thin' # or mongrel

# Component requirements
gem 'haml'
gem 'sass'

# Test requirements

# Padrino
gem 'padrino', '0.9.29'
# Padrino Stable Gem
gem 'padrino', '0.11.1'

# Or Padrino Edge
# gem 'padrino', :github => 'padrino/padrino-framework'

# Or Individual Gems
# %w(core gen helpers cache mailer admin).each do |g|
# gem 'padrino-' + g, '0.11.1'
# end


gem 'sinatra-simple-navigation', "3.3.4", :require => 'sinatra/simple-navigation'
gem 'sinatra-simple-navigation', '3.6.0', :require => 'sinatra/simple-navigation'
gem 'i18n'
4 changes: 4 additions & 0 deletions padrino/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require 'bundler/setup'
require 'padrino-core/cli/rake'

PadrinoTasks.init
44 changes: 34 additions & 10 deletions padrino/app/app.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
class SimpleNavigationApp < Padrino::Application
register Padrino::Rendering
register Padrino::Mailer
register Padrino::Helpers
register SassInitializer

register Sinatra::SimpleNavigation

enable :sessions

##
# Caching support
#
# register Padrino::Cache
# enable :caching
#
# You can customize caching store engines:
#
# set :cache, Padrino::Cache::Store::Memcache.new(::Memcached.new('127.0.0.1:11211', :exception_retry_limit => 1))
# set :cache, Padrino::Cache::Store::Memcache.new(::Dalli::Client.new('127.0.0.1:11211', :exception_retry_limit => 1))
# set :cache, Padrino::Cache::Store::Redis.new(::Redis.new(:host => '127.0.0.1', :port => 6379, :db => 0))
# set :cache, Padrino::Cache::Store::Memory.new(50)
# set :cache, Padrino::Cache::Store::File.new(Padrino.root('tmp', app_name.to_s, 'cache')) # default choice
#

##
# Application configuration options
#
# set :raise_errors, true # Show exceptions (default for development)
# set :public, "foo/bar" # Location for static assets (default root/public)
# set :reload, false # Reload application files (default in development)
# set :default_builder, "foo" # Set a custom form builder (default 'StandardFormBuilder')
# set :locale_path, "bar" # Set path for I18n translations (defaults to app/locale/)
enable :sessions # Disabled by default
disable :flash # Disables rack-flash (enabled by default if sessions)
# layout :my_layout # Layout can be in views/layouts/foo.ext or views/foo.ext (default :application)
# set :raise_errors, true # Raise exceptions (will stop application) (default for test)
# set :dump_errors, true # Exception backtraces are written to STDERR (default for production/development)
# set :show_exceptions, true # Shows a stack trace in browser (default for development)
# set :logging, true # Logging in STDOUT for development and file for production (default only for development)
# set :public_folder, 'foo/bar' # Location for static assets (default root/public)
# set :reload, false # Reload application files (default in development)
# set :default_builder, 'foo' # Set a custom form builder (default 'StandardFormBuilder')
# set :locale_path, 'bar' # Set path for I18n translations (default your_app/locales)
# disable :sessions # Disabled sessions by default (enable if needed)
# disable :flash # Disables sinatra-flash (enabled by default if Sinatra::Flash is defined)
# layout :my_layout # Layout can be in views/layouts/foo.ext or views/foo.ext (default :application)
#

##
Expand All @@ -35,4 +55,8 @@ class SimpleNavigationApp < Padrino::Application
# render 'errors/404'
# end
#
end
# error 505 do
# render 'errors/505'
# end
#
end
6 changes: 1 addition & 5 deletions padrino/app/controllers/main.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
SimpleNavigationApp.controller do

get '/' do
render 'index'
end

get '/:all' do
get '/*' do
render 'index'
end

Expand Down
8 changes: 4 additions & 4 deletions padrino/app/stylesheets/example_1.sass
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!normal_link_color = #7F7669
!active_link_color = #4C4338
$normal_link_color: #7F7669
$active_link_color: #4C4338

#example_1.example_content
border: 10px solid #D6D1B9
Expand All @@ -18,7 +18,7 @@

a
text-decoration: none
:color = !normal_link_color
color: $normal_link_color
&:hover, &:active
text-decoration: underline

Expand All @@ -30,7 +30,7 @@


a.selected
:color = !active_link_color
color: $active_link_color
text-decoration: underline

li
Expand Down
32 changes: 16 additions & 16 deletions padrino/app/stylesheets/example_2.sass
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
!header_background = #F4FCF2
!header_color = #F4EFB7
!tabs_background = #66533F
!tabs_color = #FFFFFF
!tabs_hover_background = #8C7A6E
!tabs_active_background = #AFC0A4
$header_background: #F4FCF2
$header_color: #F4EFB7
$tabs_background: #66533F
$tabs_color: #FFFFFF
$tabs_hover_background: #8C7A6E
$tabs_active_background: #AFC0A4

#example_2.example_content

border: 10px solid
:border-color = !header_background
border-color: $header_background
padding: 0px

.content
padding: 10px
:background-color = !tabs_active_background
background-color: $tabs_active_background
min-height: 100px

#top_navigation
float: left
width: 100%
:background-color = !header_background
background-color: $header_background

ul
height: 25px
Expand All @@ -38,18 +38,18 @@
font-weight: normal
margin: 0
padding: 4px 8px 6px
:background-color = !tabs_background
:border-color = !header_background
background-color: $tabs_background
border-color: $header_background
border-style: solid
border-width: 1px
:color = !tabs_color
color: $tabs_color
text-decoration: none
&:hover
:background-color = !tabs_hover_background
background-color: $tabs_hover_background

a.selected
:background-color = !tabs_active_background
background-color: $tabs_active_background
border: 1px solid
:border-color = !tabs_active_background
:color = #2F3C4C
border-color: $tabs_active_background
color: #2F3C4C
font-weight: bold
56 changes: 28 additions & 28 deletions padrino/app/stylesheets/example_3.sass
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
!header_background = #F4FCF2
!header_color = #F4EFB7
!tabs_background = #66533F
!tabs_color = #FFFFFF
!tabs_hover_background = #8C7A6E
!tabs_active_background = #2F3C4C
$header_background: #F4FCF2
$header_color: #F4EFB7
$tabs_background: #66533F
$tabs_color: #FFFFFF
$tabs_hover_background: #8C7A6E
$tabs_active_background: #2F3C4C


!subnav_background = #AFC0A4
!subnav_color = #66533F
!subnav_hover_background = #CCE0CC
!subnav_active_background = #FFFAD9
$subnav_background: #AFC0A4
$subnav_color: #66533F
$subnav_hover_background: #CCE0CC
$subnav_active_background: #FFFAD9

#example_3.example_content

border: 10px solid
:border-color = !header_background
border-color: $header_background
padding: 0px

.content_wrapper
:background-color = !tabs_active_background
background-color: $tabs_active_background

.content
float: left
padding: 10px
:background-color = !subnav_active_background
background-color: $subnav_active_background
min-height: 100px
margin: 10px 10px 10px 0px
width: 540px

#top_navigation
float: left
width: 100%
:background-color = !header_background
background-color: $header_background

ul
height: 25px
Expand All @@ -50,25 +50,25 @@
font-weight: normal
margin: 0
padding: 4px 8px 6px
:background-color = !tabs_background
:border-color = !header_background
background-color: $tabs_background
border-color: $header_background
border-style: solid
border-width: 1px
:color = !tabs_color
color: $tabs_color
text-decoration: none
&:hover
:background-color = !tabs_hover_background
background-color: $tabs_hover_background

a.selected
:background-color = !tabs_active_background
background-color: $tabs_active_background
border: 1px solid
:border-color = !tabs_active_background
:color = #F4EFB7
border-color: $tabs_active_background
color: #F4EFB7
font-weight: bold

#sub_navigation
float: left
:background-color = !tabs_active_background
background-color: $tabs_active_background
min-height: 100px
width: 100px
padding-left: 10px
Expand All @@ -85,11 +85,11 @@
margin: 0
padding: 2px 8px 4px
margin: 2px 0px 2px
:background-color = !subnav_background
:border-color = !header_background
background-color: $subnav_background
border-color: $header_background
border-style: solid
border-width: 0px
:color = !subnav_color
color: $subnav_color
text-decoration: none
-moz-border-radius-topleft: 5px
-webkit-border-top-left-radius: 5px
Expand All @@ -99,9 +99,9 @@
text-align: right

&:hover
:background-color = !subnav_hover_background
background-color: $subnav_hover_background

a.selected
:background-color = !subnav_active_background
:color = !subnav_color
background-color: $subnav_active_background
color: $subnav_color
font-weight: bold
8 changes: 4 additions & 4 deletions padrino/app/stylesheets/example_4.sass
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!normal_link_color = #7F7669
!active_link_color = #4C4338
$normal_link_color: #7F7669
$active_link_color: #4C4338

#example_4.example_content
border: 10px solid #D6D1B9
Expand All @@ -18,7 +18,7 @@

a
text-decoration: none
:color = !normal_link_color
color: $normal_link_color
&:hover, &:active
text-decoration: underline

Expand All @@ -30,7 +30,7 @@


a.selected
:color = !active_link_color
color: $active_link_color
text-decoration: underline

li
Expand Down
11 changes: 9 additions & 2 deletions padrino/config.ru
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
require ::File.dirname(__FILE__) + '/config/boot.rb'
run Padrino.application
#!/usr/bin/env rackup
# encoding: utf-8

# This file can be used to start Padrino,
# just execute it from the command line.

require File.expand_path("../config/boot.rb", __FILE__)

run Padrino.application
Loading

0 comments on commit 03a42db

Please sign in to comment.