Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial commit

  • Loading branch information...
commit 4d57ec86fbb709e951f6939380531475d1374ec5 0 parents
Filip Kostovski authored
1  .gitignore
... ... @@ -0,0 +1 @@
  1 +.DS_Store
17 Gemfile
... ... @@ -0,0 +1,17 @@
  1 +source 'http://rubygems.org'
  2 +
  3 +gem 'sinatra', :require => 'sinatra/base'
  4 +
  5 +gem 'haml'
  6 +
  7 +gem 'webrat'
  8 +gem 'rspec'
  9 +
  10 +gem 'dm-core'
  11 +gem 'dm-timestamps'
  12 +gem 'dm-validations'
  13 +gem 'dm-migrations'
  14 +gem 'dm-sqlite-adapter'
  15 +
  16 +gem 'paginate-simple'
  17 +gem 'pagination_render_logic', :require => 'pagination_render_logic/digg'
64 Gemfile.lock
... ... @@ -0,0 +1,64 @@
  1 +GEM
  2 + remote: http://rubygems.org/
  3 + specs:
  4 + addressable (2.2.4)
  5 + data_objects (0.10.3)
  6 + addressable (~> 2.1)
  7 + diff-lcs (1.1.2)
  8 + dm-core (1.0.2)
  9 + addressable (~> 2.2)
  10 + extlib (~> 0.9.15)
  11 + dm-do-adapter (1.0.2)
  12 + data_objects (~> 0.10.2)
  13 + dm-core (~> 1.0.2)
  14 + dm-migrations (1.0.2)
  15 + dm-core (~> 1.0.2)
  16 + dm-sqlite-adapter (1.0.2)
  17 + dm-do-adapter (~> 1.0.2)
  18 + do_sqlite3 (~> 0.10.2)
  19 + dm-timestamps (1.0.2)
  20 + dm-core (~> 1.0.2)
  21 + dm-validations (1.0.2)
  22 + dm-core (~> 1.0.2)
  23 + do_sqlite3 (0.10.3)
  24 + data_objects (= 0.10.3)
  25 + extlib (0.9.15)
  26 + haml (3.0.25)
  27 + nokogiri (1.4.4)
  28 + paginate-simple (0.1.2)
  29 + pagination_render_logic (0.0.2)
  30 + rack (1.2.1)
  31 + rack-test (0.5.7)
  32 + rack (>= 1.0)
  33 + rspec (2.5.0)
  34 + rspec-core (~> 2.5.0)
  35 + rspec-expectations (~> 2.5.0)
  36 + rspec-mocks (~> 2.5.0)
  37 + rspec-core (2.5.1)
  38 + rspec-expectations (2.5.0)
  39 + diff-lcs (~> 1.1.2)
  40 + rspec-mocks (2.5.0)
  41 + sinatra (1.2.0)
  42 + rack (~> 1.1)
  43 + tilt (< 2.0, >= 1.2.2)
  44 + tilt (1.2.2)
  45 + webrat (0.7.3)
  46 + nokogiri (>= 1.2.0)
  47 + rack (>= 1.0)
  48 + rack-test (>= 0.5.3)
  49 +
  50 +PLATFORMS
  51 + ruby
  52 +
  53 +DEPENDENCIES
  54 + dm-core
  55 + dm-migrations
  56 + dm-sqlite-adapter
  57 + dm-timestamps
  58 + dm-validations
  59 + haml
  60 + paginate-simple
  61 + pagination_render_logic
  62 + rspec
  63 + sinatra
  64 + webrat
1  README
... ... @@ -0,0 +1 @@
  1 +This is a simple sinatra project.
16 README.txt
... ... @@ -0,0 +1,16 @@
  1 +Bare bone folder structure for mvc development with Sinatra framework.
  2 +
  3 +Usage:
  4 +Create controllers in the controllers folder and map them in the config.ru.
  5 +Create models in the models folder and use them in the controllers.
  6 +Create helpers in the helpers folder and use them in your views.
  7 +Create general purpose classes and modules in the lib folder.
  8 +
  9 +All of the classes will be autoladed.
  10 +The naming convention should be followed:
  11 + Snakes for the names of the ruby files, cammel case for the names of the classes and modules.
  12 +All of the gems will be placed in the Gemfile and will be installed with bundle install command.
  13 +For running init tasks place ruby file in the initializers folder. Every file in the initializers
  14 +will be runned on startup.
  15 +
  16 +Hapy coding!
14 Rakefile
... ... @@ -0,0 +1,14 @@
  1 +require './bootloader'
  2 +
  3 +namespace :db do
  4 + task :seed do
  5 + require 'faker'
  6 + require 'dm-core'
  7 +
  8 + DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/development.db")
  9 +
  10 + 10000.times do
  11 + Post.create({:name => Faker::Lorem.sentence, :content => Faker::Lorem.paragraphs.join})
  12 + end
  13 + end
  14 +end
38 bootloader.rb
... ... @@ -0,0 +1,38 @@
  1 +require 'rubygems'
  2 +require 'bundler/setup'
  3 +
  4 +sinatra_root = File.dirname(__FILE__)
  5 +
  6 +Bundler.require(:default)
  7 +
  8 +class String
  9 + def underscore_to_camelcase
  10 + words = split('_').map!{|w| w.capitalize}
  11 + words.join
  12 + end
  13 +end
  14 +
  15 +# initialize autoloaders
  16 +autoload_folders = %w[lib controllers models]
  17 +
  18 +autoload_folders.each do |folder|
  19 + files = Dir.entries(File.join(sinatra_root, folder)).reject! {|file| file.start_with?('.') }
  20 + files.each do |f|
  21 + basename = File.basename(File.join(sinatra_root, folder, f), '.rb')
  22 + Object.autoload basename.underscore_to_camelcase.to_sym, File.join(sinatra_root, folder, f)
  23 + end
  24 +end
  25 +
  26 +# autolad the helpers
  27 +files = Dir.entries(File.join(sinatra_root, 'helpers')).reject! {|file| file.start_with?('.') }
  28 +files.each do |f|
  29 + basename = File.basename(File.join(sinatra_root, 'helpers', f), '.rb')
  30 + Sinatra.autoload basename.underscore_to_camelcase.to_sym, File.join(sinatra_root, 'helpers', f)
  31 +end
  32 +
  33 +# load the initializers
  34 +initializers = Dir.entries(File.join(sinatra_root, 'initializers')).reject {|file| file.start_with?('.')}
  35 +initializers.each do |f|
  36 + basename = File.basename(File.join(sinatra_root, 'initializers', f), '.rb')
  37 + require File.join(sinatra_root, 'initializers', basename)
  38 +end
12 config.ru
... ... @@ -0,0 +1,12 @@
  1 +require './bootloader'
  2 +
  3 +DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/development.db")
  4 +
  5 +map "/public" do
  6 + run Rack::Directory.new("./public")
  7 +end
  8 +
  9 +# map sinatr apps here
  10 +# map '/posts' do
  11 +# run PostsApp.new
  12 +# end
10 controllers/sinatra_app.rb
... ... @@ -0,0 +1,10 @@
  1 +class SinatraApp < Sinatra::Base
  2 + # use Rack::Auth::Basic do |username, password|
  3 + # username == 'filip' && password == 'pass'
  4 + # end
  5 +
  6 + enable :sessions, :logging
  7 + set :environment, :development
  8 + set :method_override, true
  9 +
  10 +end
BIN  development.db
Binary file not shown
38 helpers/pagination_helper.rb
... ... @@ -0,0 +1,38 @@
  1 +module Sinatra
  2 + module PaginationHelper
  3 + def paginate(resource)
  4 + data = []
  5 + PaginationRenderer.config! :total_pages => Paginator.num_of_pages,
  6 + :current_page => Paginator.current_page,
  7 + :after_first_page => 3,
  8 + :arround_current_page => 5
  9 +
  10 + if PaginationRenderer.has_links?
  11 + data << '<div class="pagination">'
  12 + data << "<a href =\"/#{resource}/?page=#{PaginationRenderer.first_page}\">First</a>" if PaginationRenderer.has_first_page?
  13 + data << "<a href =\"/#{resource}/?page=#{PaginationRenderer.previous_page}\">Previous</a>" if PaginationRenderer.has_previous_page?
  14 + if PaginationRenderer.has_first_page_section?
  15 + PaginationRenderer.first_page_section.each do |page|
  16 + data << (PaginationRenderer.current_page == page ? "<span>#{page}</span>" : "<a href =\"/#{resource}/?page=#{page}\">#{page}</a>")
  17 + end
  18 + data << "<span>. . .</span>"
  19 + end
  20 + PaginationRenderer.middle_section.each do |page|
  21 + data << (PaginationRenderer.current_page == page ? "<span>#{page}</span>" : "<a href =\"/#{resource}/?page=#{page}\">#{page}</a>")
  22 + end
  23 + if PaginationRenderer.has_last_page_section?
  24 + data << "<span>. . .</span>"
  25 + PaginationRenderer.last_page_section.each do |page|
  26 + data << (PaginationRenderer.current_page == page ? "<span>#{page}</span>" : "<a href =\"/#{resource}/?page=#{page}\">#{page}</a>")
  27 + end
  28 + end
  29 + data << "<a href =\"/#{resource}/?page=#{PaginationRenderer.next_page}\">Next</a>" if PaginationRenderer.has_next_page?
  30 + data << "<a href =\"/#{resource}/?page=#{PaginationRenderer.last_page}\">Last</a>" if PaginationRenderer.has_last_page?
  31 + data << '</div>'
  32 + end
  33 + data.join(' ')
  34 + end
  35 + end
  36 +
  37 + # helpers PaginationHelper
  38 +end
1  initializers/joker.rb
... ... @@ -0,0 +1 @@
  1 +puts "It should be awesome!"
3  lib/pagination_renderer.rb
... ... @@ -0,0 +1,3 @@
  1 +class PaginationRenderer
  2 + extend PaginationRenderLogic::Digg
  3 +end
3  lib/paginator.rb
... ... @@ -0,0 +1,3 @@
  1 +class Paginator
  2 + extend PaginateSimple
  3 +end
3  models/sandbox.rb
... ... @@ -0,0 +1,3 @@
  1 +module Sandbox
  2 +
  3 +end
643 public/css/960.css
... ... @@ -0,0 +1,643 @@
  1 +/*
  2 + 960 Grid System ~ Core CSS.
  3 + Learn more ~ http://960.gs/
  4 +
  5 + Licensed under GPL and MIT.
  6 +*/
  7 +
  8 +/*
  9 + Forces backgrounds to span full width,
  10 + even if there is horizontal scrolling.
  11 + Increase this if your layout is wider.
  12 +
  13 + Note: IE6 works fine without this fix.
  14 +*/
  15 +
  16 +body {
  17 + min-width: 960px;
  18 +}
  19 +
  20 +/* `Containers
  21 +----------------------------------------------------------------------------------------------------*/
  22 +
  23 +.container_12,
  24 +.container_16 {
  25 + margin-left: auto;
  26 + margin-right: auto;
  27 + width: 960px;
  28 +}
  29 +
  30 +/* `Grid >> Global
  31 +----------------------------------------------------------------------------------------------------*/
  32 +
  33 +.grid_1,
  34 +.grid_2,
  35 +.grid_3,
  36 +.grid_4,
  37 +.grid_5,
  38 +.grid_6,
  39 +.grid_7,
  40 +.grid_8,
  41 +.grid_9,
  42 +.grid_10,
  43 +.grid_11,
  44 +.grid_12,
  45 +.grid_13,
  46 +.grid_14,
  47 +.grid_15,
  48 +.grid_16 {
  49 + display: inline;
  50 + float: left;
  51 + margin-left: 10px;
  52 + margin-right: 10px;
  53 +}
  54 +
  55 +.push_1, .pull_1,
  56 +.push_2, .pull_2,
  57 +.push_3, .pull_3,
  58 +.push_4, .pull_4,
  59 +.push_5, .pull_5,
  60 +.push_6, .pull_6,
  61 +.push_7, .pull_7,
  62 +.push_8, .pull_8,
  63 +.push_9, .pull_9,
  64 +.push_10, .pull_10,
  65 +.push_11, .pull_11,
  66 +.push_12, .pull_12,
  67 +.push_13, .pull_13,
  68 +.push_14, .pull_14,
  69 +.push_15, .pull_15 {
  70 + position: relative;
  71 +}
  72 +
  73 +.container_12 .grid_3,
  74 +.container_16 .grid_4 {
  75 + width: 220px;
  76 +}
  77 +
  78 +.container_12 .grid_6,
  79 +.container_16 .grid_8 {
  80 + width: 460px;
  81 +}
  82 +
  83 +.container_12 .grid_9,
  84 +.container_16 .grid_12 {
  85 + width: 700px;
  86 +}
  87 +
  88 +.container_12 .grid_12,
  89 +.container_16 .grid_16 {
  90 + width: 940px;
  91 +}
  92 +
  93 +/* `Grid >> Children (Alpha ~ First, Omega ~ Last)
  94 +----------------------------------------------------------------------------------------------------*/
  95 +
  96 +.alpha {
  97 + margin-left: 0;
  98 +}
  99 +
  100 +.omega {
  101 + margin-right: 0;
  102 +}
  103 +
  104 +/* `Grid >> 12 Columns
  105 +----------------------------------------------------------------------------------------------------*/
  106 +
  107 +.container_12 .grid_1 {
  108 + width: 60px;
  109 +}
  110 +
  111 +.container_12 .grid_2 {
  112 + width: 140px;
  113 +}
  114 +
  115 +.container_12 .grid_4 {
  116 + width: 300px;
  117 +}
  118 +
  119 +.container_12 .grid_5 {
  120 + width: 380px;
  121 +}
  122 +
  123 +.container_12 .grid_7 {
  124 + width: 540px;
  125 +}
  126 +
  127 +.container_12 .grid_8 {
  128 + width: 620px;
  129 +}
  130 +
  131 +.container_12 .grid_10 {
  132 + width: 780px;
  133 +}
  134 +
  135 +.container_12 .grid_11 {
  136 + width: 860px;
  137 +}
  138 +
  139 +/* `Grid >> 16 Columns
  140 +----------------------------------------------------------------------------------------------------*/
  141 +
  142 +.container_16 .grid_1 {
  143 + width: 40px;
  144 +}
  145 +
  146 +.container_16 .grid_2 {
  147 + width: 100px;
  148 +}
  149 +
  150 +.container_16 .grid_3 {
  151 + width: 160px;
  152 +}
  153 +
  154 +.container_16 .grid_5 {
  155 + width: 280px;
  156 +}
  157 +
  158 +.container_16 .grid_6 {
  159 + width: 340px;
  160 +}
  161 +
  162 +.container_16 .grid_7 {
  163 + width: 400px;
  164 +}
  165 +
  166 +.container_16 .grid_9 {
  167 + width: 520px;
  168 +}
  169 +
  170 +.container_16 .grid_10 {
  171 + width: 580px;
  172 +}
  173 +
  174 +.container_16 .grid_11 {
  175 + width: 640px;
  176 +}
  177 +
  178 +.container_16 .grid_13 {
  179 + width: 760px;
  180 +}
  181 +
  182 +.container_16 .grid_14 {
  183 + width: 820px;
  184 +}
  185 +
  186 +.container_16 .grid_15 {
  187 + width: 880px;
  188 +}
  189 +
  190 +/* `Prefix Extra Space >> Global
  191 +----------------------------------------------------------------------------------------------------*/
  192 +
  193 +.container_12 .prefix_3,
  194 +.container_16 .prefix_4 {
  195 + padding-left: 240px;
  196 +}
  197 +
  198 +.container_12 .prefix_6,
  199 +.container_16 .prefix_8 {
  200 + padding-left: 480px;
  201 +}
  202 +
  203 +.container_12 .prefix_9,
  204 +.container_16 .prefix_12 {
  205 + padding-left: 720px;
  206 +}
  207 +
  208 +/* `Prefix Extra Space >> 12 Columns
  209 +----------------------------------------------------------------------------------------------------*/
  210 +
  211 +.container_12 .prefix_1 {
  212 + padding-left: 80px;
  213 +}
  214 +
  215 +.container_12 .prefix_2 {
  216 + padding-left: 160px;
  217 +}
  218 +
  219 +.container_12 .prefix_4 {
  220 + padding-left: 320px;
  221 +}
  222 +
  223 +.container_12 .prefix_5 {
  224 + padding-left: 400px;
  225 +}
  226 +
  227 +.container_12 .prefix_7 {
  228 + padding-left: 560px;
  229 +}
  230 +
  231 +.container_12 .prefix_8 {
  232 + padding-left: 640px;
  233 +}
  234 +
  235 +.container_12 .prefix_10 {
  236 + padding-left: 800px;
  237 +}
  238 +
  239 +.container_12 .prefix_11 {
  240 + padding-left: 880px;
  241 +}
  242 +
  243 +/* `Prefix Extra Space >> 16 Columns
  244 +----------------------------------------------------------------------------------------------------*/
  245 +
  246 +.container_16 .prefix_1 {
  247 + padding-left: 60px;
  248 +}
  249 +
  250 +.container_16 .prefix_2 {
  251 + padding-left: 120px;
  252 +}
  253 +
  254 +.container_16 .prefix_3 {
  255 + padding-left: 180px;
  256 +}
  257 +
  258 +.container_16 .prefix_5 {
  259 + padding-left: 300px;
  260 +}
  261 +
  262 +.container_16 .prefix_6 {
  263 + padding-left: 360px;
  264 +}
  265 +
  266 +.container_16 .prefix_7 {
  267 + padding-left: 420px;
  268 +}
  269 +
  270 +.container_16 .prefix_9 {
  271 + padding-left: 540px;
  272 +}
  273 +
  274 +.container_16 .prefix_10 {
  275 + padding-left: 600px;
  276 +}
  277 +
  278 +.container_16 .prefix_11 {
  279 + padding-left: 660px;
  280 +}
  281 +
  282 +.container_16 .prefix_13 {
  283 + padding-left: 780px;
  284 +}
  285 +
  286 +.container_16 .prefix_14 {
  287 + padding-left: 840px;
  288 +}
  289 +
  290 +.container_16 .prefix_15 {
  291 + padding-left: 900px;
  292 +}
  293 +
  294 +/* `Suffix Extra Space >> Global
  295 +----------------------------------------------------------------------------------------------------*/
  296 +
  297 +.container_12 .suffix_3,
  298 +.container_16 .suffix_4 {
  299 + padding-right: 240px;
  300 +}
  301 +
  302 +.container_12 .suffix_6,
  303 +.container_16 .suffix_8 {
  304 + padding-right: 480px;
  305 +}
  306 +
  307 +.container_12 .suffix_9,
  308 +.container_16 .suffix_12 {
  309 + padding-right: 720px;
  310 +}
  311 +
  312 +/* `Suffix Extra Space >> 12 Columns
  313 +----------------------------------------------------------------------------------------------------*/
  314 +
  315 +.container_12 .suffix_1 {
  316 + padding-right: 80px;
  317 +}
  318 +
  319 +.container_12 .suffix_2 {
  320 + padding-right: 160px;
  321 +}
  322 +
  323 +.container_12 .suffix_4 {
  324 + padding-right: 320px;
  325 +}
  326 +
  327 +.container_12 .suffix_5 {
  328 + padding-right: 400px;
  329 +}
  330 +
  331 +.container_12 .suffix_7 {
  332 + padding-right: 560px;
  333 +}
  334 +
  335 +.container_12 .suffix_8 {
  336 + padding-right: 640px;
  337 +}
  338 +
  339 +.container_12 .suffix_10 {
  340 + padding-right: 800px;
  341 +}
  342 +
  343 +.container_12 .suffix_11 {
  344 + padding-right: 880px;
  345 +}
  346 +
  347 +/* `Suffix Extra Space >> 16 Columns
  348 +----------------------------------------------------------------------------------------------------*/
  349 +
  350 +.container_16 .suffix_1 {
  351 + padding-right: 60px;
  352 +}
  353 +
  354 +.container_16 .suffix_2 {
  355 + padding-right: 120px;
  356 +}
  357 +
  358 +.container_16 .suffix_3 {
  359 + padding-right: 180px;
  360 +}
  361 +
  362 +.container_16 .suffix_5 {
  363 + padding-right: 300px;
  364 +}
  365 +
  366 +.container_16 .suffix_6 {
  367 + padding-right: 360px;
  368 +}
  369 +
  370 +.container_16 .suffix_7 {
  371 + padding-right: 420px;
  372 +}
  373 +
  374 +.container_16 .suffix_9 {
  375 + padding-right: 540px;
  376 +}
  377 +
  378 +.container_16 .suffix_10 {
  379 + padding-right: 600px;
  380 +}
  381 +
  382 +.container_16 .suffix_11 {
  383 + padding-right: 660px;
  384 +}
  385 +
  386 +.container_16 .suffix_13 {
  387 + padding-right: 780px;
  388 +}
  389 +
  390 +.container_16 .suffix_14 {
  391 + padding-right: 840px;
  392 +}
  393 +
  394 +.container_16 .suffix_15 {
  395 + padding-right: 900px;
  396 +}
  397 +
  398 +/* `Push Space >> Global
  399 +----------------------------------------------------------------------------------------------------*/
  400 +
  401 +.container_12 .push_3,
  402 +.container_16 .push_4 {
  403 + left: 240px;
  404 +}
  405 +
  406 +.container_12 .push_6,
  407 +.container_16 .push_8 {
  408 + left: 480px;
  409 +}
  410 +
  411 +.container_12 .push_9,
  412 +.container_16 .push_12 {
  413 + left: 720px;
  414 +}
  415 +
  416 +/* `Push Space >> 12 Columns
  417 +----------------------------------------------------------------------------------------------------*/
  418 +
  419 +.container_12 .push_1 {
  420 + left: 80px;
  421 +}
  422 +
  423 +.container_12 .push_2 {
  424 + left: 160px;
  425 +}
  426 +
  427 +.container_12 .push_4 {
  428 + left: 320px;
  429 +}
  430 +
  431 +.container_12 .push_5 {
  432 + left: 400px;
  433 +}
  434 +
  435 +.container_12 .push_7 {
  436 + left: 560px;
  437 +}
  438 +
  439 +.container_12 .push_8 {
  440 + left: 640px;
  441 +}
  442 +
  443 +.container_12 .push_10 {
  444 + left: 800px;
  445 +}
  446 +
  447 +.container_12 .push_11 {
  448 + left: 880px;
  449 +}
  450 +
  451 +/* `Push Space >> 16 Columns
  452 +----------------------------------------------------------------------------------------------------*/
  453 +
  454 +.container_16 .push_1 {
  455 + left: 60px;
  456 +}
  457 +
  458 +.container_16 .push_2 {
  459 + left: 120px;
  460 +}
  461 +
  462 +.container_16 .push_3 {
  463 + left: 180px;
  464 +}
  465 +
  466 +.container_16 .push_5 {
  467 + left: 300px;
  468 +}
  469 +
  470 +.container_16 .push_6 {
  471 + left: 360px;
  472 +}
  473 +
  474 +.container_16 .push_7 {
  475 + left: 420px;
  476 +}
  477 +
  478 +.container_16 .push_9 {
  479 + left: 540px;
  480 +}
  481 +
  482 +.container_16 .push_10 {
  483 + left: 600px;
  484 +}
  485 +
  486 +.container_16 .push_11 {
  487 + left: 660px;
  488 +}
  489 +
  490 +.container_16 .push_13 {
  491 + left: 780px;
  492 +}
  493 +
  494 +.container_16 .push_14 {
  495 + left: 840px;
  496 +}
  497 +
  498 +.container_16 .push_15 {
  499 + left: 900px;
  500 +}
  501 +
  502 +/* `Pull Space >> Global
  503 +----------------------------------------------------------------------------------------------------*/
  504 +
  505 +.container_12 .pull_3,
  506 +.container_16 .pull_4 {
  507 + left: -240px;
  508 +}
  509 +
  510 +.container_12 .pull_6,
  511 +.container_16 .pull_8 {
  512 + left: -480px;
  513 +}
  514 +
  515 +.container_12 .pull_9,
  516 +.container_16 .pull_12 {
  517 + left: -720px;
  518 +}
  519 +
  520 +/* `Pull Space >> 12 Columns
  521 +----------------------------------------------------------------------------------------------------*/
  522 +
  523 +.container_12 .pull_1 {
  524 + left: -80px;
  525 +}
  526 +
  527 +.container_12 .pull_2 {
  528 + left: -160px;
  529 +}
  530 +
  531 +.container_12 .pull_4 {
  532 + left: -320px;
  533 +}
  534 +
  535 +.container_12 .pull_5 {
  536 + left: -400px;
  537 +}
  538 +
  539 +.container_12 .pull_7 {
  540 + left: -560px;
  541 +}
  542 +
  543 +.container_12 .pull_8 {
  544 + left: -640px;
  545 +}
  546 +
  547 +.container_12 .pull_10 {
  548 + left: -800px;
  549 +}
  550 +
  551 +.container_12 .pull_11 {
  552 + left: -880px;
  553 +}
  554 +
  555 +/* `Pull Space >> 16 Columns
  556 +----------------------------------------------------------------------------------------------------*/
  557 +
  558 +.container_16 .pull_1 {
  559 + left: -60px;
  560 +}
  561 +
  562 +.container_16 .pull_2 {
  563 + left: -120px;
  564 +}
  565 +
  566 +.container_16 .pull_3 {
  567 + left: -180px;
  568 +}
  569 +
  570 +.container_16 .pull_5 {
  571 + left: -300px;
  572 +}
  573 +
  574 +.container_16 .pull_6 {
  575 + left: -360px;
  576 +}
  577 +
  578 +.container_16 .pull_7 {
  579 + left: -420px;
  580 +}
  581 +
  582 +.container_16 .pull_9 {
  583 + left: -540px;
  584 +}
  585 +
  586 +.container_16 .pull_10 {
  587 + left: -600px;
  588 +}
  589 +
  590 +.container_16 .pull_11 {
  591 + left: -660px;
  592 +}
  593 +
  594 +.container_16 .pull_13 {
  595 + left: -780px;
  596 +}
  597 +
  598 +.container_16 .pull_14 {
  599 + left: -840px;
  600 +}
  601 +
  602 +.container_16 .pull_15 {
  603 + left: -900px;
  604 +}
  605 +
  606 +/* `Clear Floated Elements
  607 +----------------------------------------------------------------------------------------------------*/
  608 +
  609 +/* http://sonspring.com/journal/clearing-floats */
  610 +
  611 +.clear {
  612 + clear: both;
  613 + display: block;
  614 + overflow: hidden;
  615 + visibility: hidden;
  616 + width: 0;
  617 + height: 0;
  618 +}
  619 +
  620 +/* http://www.yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified */
  621 +
  622 +.clearfix:before,
  623 +.clearfix:after {
  624 + content: '\0020';
  625 + display: block;
  626 + overflow: hidden;
  627 + visibility: hidden;
  628 + width: 0;
  629 + height: 0;
  630 +}
  631 +
  632 +.clearfix:after {
  633 + clear: both;
  634 +}
  635 +
  636 +/*
  637 + The following zoom:1 rule is specifically for IE6 + IE7.
  638 + Move to separate stylesheet if invalid CSS is a problem.
  639 +*/
  640 +
  641 +.clearfix {
  642 + zoom: 1;
  643 +}
22 public/css/app.css
... ... @@ -0,0 +1,22 @@
  1 +div.pagination a {
  2 + float: left;
  3 + padding: 5px;
  4 + border: 1px solid #ccc;
  5 + background: #eee;
  6 + color: #009;
  7 + text-decoration: none;
  8 + display: block;
  9 + margin-right: 1px;
  10 +}
  11 +
  12 +div.pagination span {
  13 + float: left;
  14 + padding: 5px;
  15 + display: block;
  16 + font-weight: bold;
  17 +}
  18 +
  19 +#footer {
  20 + text-align: center;
  21 + margin-top: 15px;
  22 +}
53 public/css/reset.css
... ... @@ -0,0 +1,53 @@
  1 +/* http://meyerweb.com/eric/tools/css/reset/ */
  2 +/* v1.0 | 20080212 */
  3 +
  4 +html, body, div, span, applet, object, iframe,
  5 +h1, h2, h3, h4, h5, h6, p, blockquote, pre,
  6 +a, abbr, acronym, address, big, cite, code,
  7 +del, dfn, em, font, img, ins, kbd, q, s, samp,
  8 +small, strike, strong, sub, sup, tt, var,
  9 +b, u, i, center,
  10 +dl, dt, dd, ol, ul, li,
  11 +fieldset, form, label, legend,
  12 +table, caption, tbody, tfoot, thead, tr, th, td {
  13 + margin: 0;
  14 + padding: 0;
  15 + border: 0;
  16 + outline: 0;
  17 + font-size: 100%;
  18 + vertical-align: baseline;
  19 + background: transparent;
  20 +}
  21 +body {
  22 + line-height: 1;
  23 +}
  24 +ol, ul {
  25 + list-style: none;
  26 +}
  27 +blockquote, q {
  28 + quotes: none;
  29 +}
  30 +blockquote:before, blockquote:after,
  31 +q:before, q:after {
  32 + content: '';
  33 + content: none;
  34 +}
  35 +
  36 +/* remember to define focus styles! */
  37 +:focus {
  38 + outline: 0;
  39 +}
  40 +
  41 +/* remember to highlight inserts somehow! */
  42 +ins {
  43 + text-decoration: none;
  44 +}
  45 +del {
  46 + text-decoration: line-through;
  47 +}
  48 +
  49 +/* tables still need 'cellspacing="0"' in the markup */
  50 +table {
  51 + border-collapse: collapse;
  52 + border-spacing: 0;
  53 +}
84 public/css/text.css
... ... @@ -0,0 +1,84 @@
  1 +/*
  2 + 960 Grid System ~ Text CSS.
  3 + Learn more ~ http://960.gs/
  4 +
  5 + Licensed under GPL and MIT.
  6 +*/
  7 +
  8 +/* `Basic HTML
  9 +----------------------------------------------------------------------------------------------------*/
  10 +
  11 +body {
  12 + font: 13px/1.5 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif;
  13 +}
  14 +
  15 +a:focus {
  16 + outline: 1px dotted;
  17 +}
  18 +
  19 +hr {
  20 + border: 0 #ccc solid;
  21 + border-top-width: 1px;
  22 + clear: both;
  23 + height: 0;
  24 +}
  25 +
  26 +/* `Headings
  27 +----------------------------------------------------------------------------------------------------*/
  28 +
  29 +h1 {
  30 + font-size: 25px;
  31 +}
  32 +
  33 +h2 {
  34 + font-size: 23px;
  35 +}
  36 +
  37 +h3 {
  38 + font-size: 21px;
  39 +}
  40 +
  41 +h4 {
  42 + font-size: 19px;
  43 +}
  44 +
  45 +h5 {
  46 + font-size: 17px;
  47 +}
  48 +
  49 +h6 {
  50 + font-size: 15px;
  51 +}
  52 +
  53 +/* `Spacing
  54 +----------------------------------------------------------------------------------------------------*/
  55 +
  56 +ol {
  57 + list-style: decimal;
  58 +}
  59 +
  60 +ul {
  61 + list-style: disc;
  62 +}
  63 +
  64 +li {
  65 + margin-left: 30px;
  66 +}
  67 +
  68 +p,
  69 +dl,
  70 +hr,
  71 +h1,
  72 +h2,
  73 +h3,
  74 +h4,
  75 +h5,
  76 +h6,
  77 +ol,
  78 +ul,
  79 +pre,
  80 +table,
  81 +address,
  82 +fieldset {
  83 + margin-bottom: 20px;
  84 +}
0  public/js/app.js
No changes.
3  script/server
... ... @@ -0,0 +1,3 @@
  1 +#! /bin/bash
  2 +
  3 +thin -R config.ru start
26 views/layout.haml
... ... @@ -0,0 +1,26 @@
  1 +!!! 5
  2 +%html
  3 + %head
  4 + %title
  5 + = @title || 'Undefined'
  6 + %link{:type => 'text/css', :rel => 'stylesheet', :href => '/public/css/reset.css'}
  7 + %link{:type => 'text/css', :rel => 'stylesheet', :href => '/public/css/text.css'}
  8 + %link{:type => 'text/css', :rel => 'stylesheet', :href => '/public/css/960.css'}
  9 + %link{:type => 'text/css', :rel => 'stylesheet', :href => '/public/css/app.css'}
  10 + %body
  11 + .container_12
  12 + #page
  13 + .grid_12
  14 + #header
  15 + #nav
  16 + .clear
  17 + .grid_10
  18 + #content
  19 + = yield
  20 + .grid_2
  21 + #sidebar
  22 + The sidebar
  23 + .clear
  24 + .grid_12
  25 + #footer
  26 + The footer

0 comments on commit 4d57ec8

Please sign in to comment.
Something went wrong with that request. Please try again.