Commit d61ee83bd9397ee44008d93ab21352985db13d28
- Date: Fri Apr 04 09:49:26 +0000 2008
- Committer: Aslak Hellesøy (aslak.hellesoy@gmail.com)
- Author: Aslak Hellesøy (aslak.hellesoy@gmail.com)
- Commit SHA1: d61ee83bd9397ee44008d93ab21352985db13d28
- Tree SHA1: da7263f910aaf1ad1db2f83a2d0811b19dff67c5
- presentation.key/thumbs/st5.tiff 0
- presentation.key/home.tiff 0
- presentation.key/thumbs/st7-5.tiff 0
- presentation.key/thumbs/st4.tiff 0
- camping/events.rb 32 -+++++++++++++++++++++++++++++++
- waves/events/public/css/stylesheet.css 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- waves/events/templates/event/list.mab 41 +++++++++++++++++++++++++++++++++++++++++
- presentation.key/waves-architecture.tiff 0
- waves/events/templates/layouts/default.mab 13 -------++++++
- waves/events/schema/migrations/001_initial_schema.rb 16 ++++++++++++++++
- presentation.key/camping-1.tiff 0
- presentation.key/Camping.tiff 0
- presentation.key/thumbs/st5-1.tiff 0
- presentation.key/sdbr_downloadback.tiff 0
- presentation.key/index.apxl.gz 0
- steps.txt 20 ++++++++++++++++++++
- sinatra/events.rb 5 --+++
- presentation.key/thumbs/st7.tiff 0
- presentation.key/thumbs/st7-4.tiff 0
- presentation.key/logo.tiff 0
- waves/events/lib/tasks/schema.rb 2 -+
- presentation.key/thumbs/st7-3.tiff 0
- presentation.key/thumbs/st10.tiff 0
- presentation.key/hamllogo.tiff 0
Commit diff
- Diff rendering mode:
- inline
- side by side
camping/events.rb
|   | ||
| 24 | 24 | end |
| 25 | 25 | |
| 26 | 26 | module Events::Controllers |
| 27 | class Foo < R '/add/(\d+)/(\d+)' | |
| 28 | def get(a, b) | |
| 29 | a + b | |
| 30 | end | |
| 31 | end | |
| 32 | ||
| 27 | 33 | class Events < R '/events' |
| 28 | 34 | def get |
| 29 | 35 | @events = Event.find(:all) |
| 30 | 36 | render :events |
| 31 | 37 | end |
| 38 | ||
| 39 | def post | |
| 40 | Event.create(:name => input.name, :url => input.url, :description => input.description) | |
| 41 | redirect Events | |
| 42 | end | |
| 32 | 43 | end |
| 33 | 44 | |
| 34 | 45 | class Stylesheet < R '/stylesheet.css' |
| … | … | |
| 53 | 53 | def layout |
| 54 | 54 | html do |
| 55 | 55 | head do |
| 56 | ||
| 56 | title 'Events' | |
| 57 | 57 | link :rel => 'stylesheet', :type => 'text/css', |
| 58 | 58 | :href => '/stylesheet.css', :media => 'screen' |
| 59 | 59 | end |
| … | … | |
| 85 | 85 | end |
| 86 | 86 | end |
| 87 | 87 | end |
| 88 | form :action => '/events', :method => 'POST' do | |
| 89 | fieldset do | |
| 90 | legend 'New Event' | |
| 91 | ||
| 92 | label 'Name', :for => 'name' | |
| 93 | input :type => 'text', :name => 'name', :id => 'name', :size => 30 | |
| 94 | br | |
| 95 | ||
| 96 | label 'Homepage', :for => 'url' | |
| 97 | input :type => 'text', :name => 'url', :id => 'url', :size => 30 | |
| 98 | br | |
| 99 | ||
| 100 | label 'Description', :for => 'description' | |
| 101 | textarea :name => 'description', :id => 'description', :cols => 30, :rows => 4 | |
| 102 | br | |
| 103 | ||
| 104 | input :type => 'submit', :class => 'submit', :value => 'Create' | |
| 105 | end | |
| 106 | end | |
| 88 | 107 | end |
| 89 | 108 | end |
| 90 | 109 | |
| toggle raw diff | ||
presentation.key/Camping.tiff
|   | ||
| toggle raw diff | ||
presentation.key/camping-1.tiff
|   | ||
| toggle raw diff | ||
presentation.key/hamllogo.tiff
|   | ||
| toggle raw diff | ||
presentation.key/home.tiff
|   | ||
| toggle raw diff | ||
presentation.key/index.apxl.gz
|   | ||
| toggle raw diff | ||
presentation.key/logo.tiff
|   | ||
| toggle raw diff | ||
presentation.key/sdbr_downloadback.tiff
|   | ||
| toggle raw diff | ||
presentation.key/thumbs/st10.tiff
|   | ||
| toggle raw diff | ||
presentation.key/thumbs/st4.tiff
|   | ||
| toggle raw diff | ||
presentation.key/thumbs/st5-1.tiff
|   | ||
| toggle raw diff | ||
presentation.key/thumbs/st5.tiff
|   | ||
| toggle raw diff | ||
presentation.key/thumbs/st7-3.tiff
|   | ||
| toggle raw diff | ||
presentation.key/thumbs/st7-4.tiff
|   | ||
| toggle raw diff | ||
presentation.key/thumbs/st7-5.tiff
|   | ||
| toggle raw diff | ||
presentation.key/thumbs/st7.tiff
|   | ||
| toggle raw diff | ||
presentation.key/waves-architecture.tiff
|   | ||
| toggle raw diff | ||
sinatra/events.rb
|   | ||
| 43 | 43 | %form{:action => '/events', :method => 'POST'} |
| 44 | 44 | %fieldset |
| 45 | 45 | %legend New Event |
| 46 | ||
| 46 | 47 | %label{:for => 'name'} Name |
| 47 | 48 | %input{:type => 'text', :name => 'name', :id => 'name', :size => 30} |
| 48 | 49 | %br |
| … | … | |
| 53 | 53 | %br |
| 54 | 54 | |
| 55 | 55 | %label{:for => 'description'} Description |
| 56 | ||
| 56 | %textarea{:name => 'description', :id => 'description', :cols => 30, :rows => 4} | |
| 57 | 57 | %br |
| 58 | 58 | |
| 59 | ||
| 59 | %input{:type => 'submit', :class => 'submit', :value => 'Create'} | |
| 60 | 60 | |
| 61 | 61 | })) |
| 62 | 62 | end |
| toggle raw diff | ||
steps.txt
|   | ||
| 1 | waves events | |
| 2 | rake schema:migration name=initial_schema | |
| 3 | # mysqladmin --user root create events | |
| 4 | # Fix Blog constants in schema.rb | |
| 5 | ||
| 6 | # Edit 001_... *wct *wdt | |
| 7 | rake schema:migrate | |
| 8 | script/generate controller main | |
| 9 | ||
| 10 | waves-server | |
| 11 | ||
| 12 | # Create templates/event/list.mab | |
| 13 | # *mle | |
| 14 | # *mlf FIXME | |
| 15 | ||
| 16 | # Edit templates/layouts/default.mab | |
| 17 | # *mla | |
| 18 | # Edit: self << yield => layout_content | |
| 19 | ||
| 20 | # Add stylesheet | |
| toggle raw diff | ||
waves/events/lib/tasks/schema.rb
|   | ||
| 5 | 5 | task :migration do |task| |
| 6 | 6 | |
| 7 | 7 | version = ( ENV['version'].nil? ? |
| 8 | ||
| 8 | Sequel::Migrator.get_current_migration_version( Events.database ) : | |
| 9 | 9 | ENV['version'].to_i ) + 1 |
| 10 | 10 | |
| 11 | 11 | name = ENV['name'] || 'migration' |
| toggle raw diff | ||
waves/events/public/css/stylesheet.css
|   | ||
| 1 | body { | |
| 2 | background:#B5B5B5 none repeat scroll 0%; | |
| 3 | font-family:Verdana,Arial,"Bitstream Vera Sans",Helvetica,sans-serif; | |
| 4 | line-height:160%; | |
| 5 | margin:0pt; | |
| 6 | padding:30px; | |
| 7 | } | |
| 8 | h1 { | |
| 9 | display:block; | |
| 10 | padding-bottom:5px; | |
| 11 | } | |
| 12 | a { | |
| 13 | color:black; | |
| 14 | } | |
| 15 | form label { | |
| 16 | float:left; | |
| 17 | font-weight:bold; | |
| 18 | width:120px; | |
| 19 | } | |
| 20 | form input, form textarea { | |
| 21 | margin-bottom:5px; | |
| 22 | width:180px; | |
| 23 | } | |
| 24 | form input.submit { | |
| 25 | margin-left:120px; | |
| 26 | margin-top:5px; | |
| 27 | width:90px; | |
| 28 | } | |
| 29 | form br { | |
| 30 | clear:left; | |
| 31 | } | |
| 32 | table { | |
| 33 | background:#FFFFFF none repeat scroll 0%; | |
| 34 | border:1px solid #000000; | |
| 35 | border-collapse:collapse; | |
| 36 | width:100%; | |
| 37 | } | |
| 38 | table caption { | |
| 39 | background:#FFFFFF none repeat scroll 0%; | |
| 40 | border-color:#000000 rgb(0, 0, 0) -moz-use-text-color; | |
| 41 | border-style:solid solid none; | |
| 42 | border-width:1px 1px medium; | |
| 43 | margin:0pt; | |
| 44 | padding:8px 20px; | |
| 45 | text-align:left; | |
| 46 | } | |
| 47 | table th, table td { | |
| 48 | border-bottom:1px solid #B5B5B5; | |
| 49 | margin:0pt; | |
| 50 | padding:8px 20px; | |
| 51 | text-align:center; | |
| 52 | } | |
| 53 | table th.name, table td.name { | |
| 54 | text-align:left; | |
| 55 | } | |
| 56 | table th { | |
| 57 | color:#999999; | |
| 58 | } | |
| 59 | table tr.odd { | |
| 60 | background:#E6E6E6 none repeat scroll 0%; | |
| 61 | } | |
| 62 | table tr.even { | |
| 63 | background:#F1F1F1 none repeat scroll 0%; | |
| 64 | } | |
| 65 | table td a { | |
| 66 | display:block; | |
| 67 | font-weight:bold; | |
| 68 | } | |
| toggle raw diff | ||
waves/events/schema/migrations/001_initial_schema.rb
|   | ||
| 1 | class InitialSchema < Sequel::Migration | |
| 2 | ||
| 3 | def up | |
| 4 | create_table :events do | |
| 5 | primary_key :id | |
| 6 | varchar :name, :size => 100 | |
| 7 | varchar :url, :size => 100 | |
| 8 | text :description | |
| 9 | end | |
| 10 | end | |
| 11 | ||
| 12 | def down | |
| 13 | execute "DROP TABLE events" | |
| 14 | end | |
| 15 | ||
| 16 | end | |
| toggle raw diff | ||
waves/events/templates/event/list.mab
|   | ||
| 1 | layout :default, :title => 'Blog Entries' do | |
| 2 | if @events.empty? | |
| 3 | p 'No events found' | |
| 4 | else | |
| 5 | table do | |
| 6 | caption 'Events' | |
| 7 | tr :class => 'odd' do | |
| 8 | th 'Name', :class => 'name', :scope => 'col' | |
| 9 | end | |
| 10 | c = 'odd' | |
| 11 | @events.each do |e| | |
| 12 | tr(:class => (c == 'even' ? c = 'odd' : c = 'even')) do | |
| 13 | td :class => 'name' do | |
| 14 | a e.name, :href => e.url | |
| 15 | e.description | |
| 16 | end | |
| 17 | end | |
| 18 | end | |
| 19 | end | |
| 20 | end | |
| 21 | ||
| 22 | form :action => '/events', :method => 'POST' do | |
| 23 | fieldset do | |
| 24 | legend 'New Event' | |
| 25 | ||
| 26 | label 'Name', :for => 'name' | |
| 27 | input :type => 'text', :name => 'name', :id => 'name', :size => 30 | |
| 28 | br | |
| 29 | ||
| 30 | label 'Homepage', :for => 'url' | |
| 31 | input :type => 'text', :name => 'url', :id => 'url', :size => 30 | |
| 32 | br | |
| 33 | ||
| 34 | label 'Description', :for => 'description' | |
| 35 | textarea :name => 'description', :id => 'description', :cols => 30, :rows => 4 | |
| 36 | br | |
| 37 | ||
| 38 | input :type => 'submit', :class => 'submit', :value => 'Create' | |
| 39 | end | |
| 40 | end | |
| 41 | end | |
| toggle raw diff | ||
waves/events/templates/layouts/default.mab
|   | ||
| 1 | 1 | doctype :html4_strict |
| 2 | ||
| 3 | 2 | html do |
| 4 | ||
| 5 | 3 | head do |
| 6 | ||
| 4 | title 'Events' | |
| 5 | link :rel => 'stylesheet', :type => 'text/css', | |
| 6 | :href => '/css/stylesheet.css', :media => 'screen' | |
| 7 | 7 | end |
| 8 | ||
| 9 | 8 | body do |
| 10 | ||
| 9 | div.content do | |
| 10 | layout_content | |
| 11 | end | |
| 11 | 12 | end |
| 12 | ||
| 13 | 13 | end |
| 14 | ||
| toggle raw diff | ||
