Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ Pages expects to find FileBase datastores for each domain in a directory named "

$ mkdir db
$ cp -pr example_db/localhost db/

6 changes: 3 additions & 3 deletions configurations/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
module Pages
module Configurations
class Development < Default

reloadable [ Pages ]

#include Waves::Cache::RackCache
application.use Rack::Session::Cookie, :key => 'rack.session',
# :domain => 'foo.com',
:path => '/',
:expire_after => 2592000,
:secret => 'Change it'

application.run Waves::Dispatchers::Default.new

server Waves::Servers::Mongrel
Expand Down
10 changes: 5 additions & 5 deletions configurations/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
module Pages

module Configurations

class Production < Default

reloadable []
log :level => :info, :output => ( :log / 'log.out' )
host '0.0.0.0'
port 2020
debug false

include Waves::Cache::RackCache
application.use Rack::Session::Cookie, :key => 'rack.session',
# :domain => 'foo.com',
:path => '/',
:expire_after => 2592000,
:secret => 'Change it'

application.run Waves::Dispatchers::Default.new

server Waves::Servers::Mongrel
end
end
Expand Down
8 changes: 4 additions & 4 deletions controllers/blog.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module Pages

module Controllers

class Blog < Default

def update( name )
# Hack for supporting single story added to the blog
query[model_name].entries = query[model_name].entries.to_a if query[model_name].entries
super
end

end

end

end
8 changes: 4 additions & 4 deletions controllers/calendar.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module Pages

module Controllers

class Calendar < Default

def update( name )
# Hack for supporting single event added to the calendar
query[model_name].events = query[model_name].events.to_a if query[model_name].events
super
end

end

end

end
2 changes: 1 addition & 1 deletion controllers/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def update( name )
obj.save
end
def delete( name ) ; find( name ).delete ; end

def assign( assigns )
assigns[ :key ] ||= assigns['title'].downcase.gsub(/\s+/,'-').gsub(/[^\w\-]/,'')
assigns[ :published ] ||= Time.now
Expand Down
8 changes: 4 additions & 4 deletions controllers/gallery.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module Pages

module Controllers

class Gallery < Default

def update( name )
# Hack for supporting single image added to the gallery
query[model_name].images = query[model_name].images.to_a if query[model_name].images
super
end

end

end

end
6 changes: 3 additions & 3 deletions controllers/media.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module Pages
module Controllers
class Media < Default

def get( media, name )
data = [ :public / media / name,
:db / domain / :file / name,
data = [ :public / media / name,
:db / domain / :file / name,
:db / domain / :theme / name ].each do |path|
return File.read( path ) if File.exist?( path )
end
Expand Down
12 changes: 6 additions & 6 deletions controllers/payment.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
module Pages

module Controllers

class Payment < Default

def store( transaction )
model.create( transaction )
end

def notification( transaction )
model.find( transaction['key'] ).assign( info ).save
end

end

end

end
10 changes: 5 additions & 5 deletions controllers/site_old.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# module Pages
# module Controllers
# class Site < Default
#
#
#
#
#
#
# end
#
#
# end
#
#
# end
10 changes: 5 additions & 5 deletions controllers/story.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module Pages

module Controllers

class Story < Default



end

end

end
10 changes: 5 additions & 5 deletions controllers/user.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module Pages
module Controllers
class User < Default

def assign( assigns )
assigns[ :key ] ||= assigns['email'].downcase.gsub(/\s+/,'-').gsub(/[^\w\-]/,'-')
assigns[ :date_joined ] ||= Time.now
assigns
end

def authenticate
email_key = attributes[ :email ].gsub(/\s+/,'-').gsub(/[^\w\-]/,'-')
user = find( email_key )
auth = false
if(user && ( user['email'] == attributes[:email] ) &&
if(user && ( user['email'] == attributes[:email] ) &&
( user['password'] == attributes[:password] ))
auth = true
end
Expand All @@ -26,12 +26,12 @@ def authenticate
# redirect(paths.login)
end
end

def logout
session.clear
redirect('/')
end

end
end
end
10 changes: 5 additions & 5 deletions doc/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- field validation
- comment support for stories - in progress
- theme development / selection
- user registration
- user registration
- change password
- wiki support
- mailing list support
Expand All @@ -26,17 +26,17 @@ TODO - 3/5/2009 - above list is still valid

- model
- relation has_one :x, is not validate/enforced/respected (I can associate a story to different blogs, which brings to incongruence in the story model )

- published method (and the alias date) is sort of an hack for supporting old Date type and new Time type.

- controller
- deleting a story/image/event doesn't remove that from his container, causing the admin page to crash trying to render an entry not available anymore.

- view
- rethink the design of admin page. maybe is ok, but look to some alternative way to display categories. It doesn't seem to scale very well if we add lot of possible entries.

- replace the horrible javascript hack in base.js (for posting the drag&drop box) with ajax call.

- the checkbox in stories and images editor where you can choose one blog/gallery doesn't have much sense.. and
it complicates a lot the controller.update.

Expand Down
4 changes: 2 additions & 2 deletions example_db/localhost/blog/test-blog.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
---
title: test blog
tags: ""
published: Sun Apr 19 12:53:04 -0700 2009
author: Example
summary: my first blog.
entries:
entries:
- test-story-1
- test-story-2
key: test-blog
Expand Down
4 changes: 2 additions & 2 deletions example_db/localhost/image/banner.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
content_type: image/jpeg
title: banner
published: "2009-04-29"
Expand All @@ -8,4 +8,4 @@ filepath: files/banner
summary: ""
orig_name: banner.jpg
key: banner
file:
file:
8 changes: 4 additions & 4 deletions example_db/localhost/site.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
---
twitter_password: none
name: Pages.CMS
roles:
roles:
- Admin
- Member
twitter_account: none
title: hello world
domain: localhost
description: sample app.
Admin:
Admin:
- property
- story
- image
Expand All @@ -17,6 +17,6 @@ Admin:
Member:
- story
- image
authors:
authors:
- Example
key: site
2 changes: 1 addition & 1 deletion example_db/localhost/story/banner.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
format: mab
blog: ""
title: ""
Expand Down
2 changes: 1 addition & 1 deletion example_db/localhost/story/footer.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
format: textile
title: ""
blog: ""
Expand Down
2 changes: 1 addition & 1 deletion example_db/localhost/story/head.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
format: mab
blog: ""
title: ""
Expand Down
4 changes: 2 additions & 2 deletions example_db/localhost/story/home.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
format: mab
blog: ""
title: ""
Expand All @@ -8,6 +8,6 @@ author: Example
summary: ""
content: |-
p "Hello world."

p "This is my first app.. :)"
key: home
2 changes: 1 addition & 1 deletion example_db/localhost/story/menu.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
format: mab
blog: ""
title: ""
Expand Down
2 changes: 1 addition & 1 deletion example_db/localhost/story/sidebar.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
format: mab
title: ""
blog: ""
Expand Down
2 changes: 1 addition & 1 deletion example_db/localhost/story/test-story-1.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
format: wysiwyg
blog: ""
title: test story 1
Expand Down
6 changes: 3 additions & 3 deletions example_db/localhost/story/test-story-2.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
format: mab
blog: ""
title: test story 2
Expand All @@ -8,8 +8,8 @@ author: Example
summary: "i'm on the way"
content: |-
p "Well, using this think is easy after all.."
p "Remember, this is what you need:"

p "Remember, this is what you need:"
ul.rooms do
li {"#Waves"}
li {"#Filebase"}
Expand Down
Loading