Permalink
Browse files

Basic stuff works

  • Loading branch information...
1 parent fea526a commit 0fa81ea2fa51c911e4cfacc04f4b03d9c2bff99e myfreeweb committed Feb 20, 2011
Showing with 89 additions and 15 deletions.
  1. +2 −0 .gitignore
  2. +9 −1 Gemfile
  3. +19 −0 Gemfile.lock
  4. +3 −0 config.ru
  5. +15 −0 data/001_Base.rb
  6. +0 −12 migration.rb
  7. +1 −0 views/head.haml
  8. +6 −0 views/header.haml
  9. +2 −2 views/landing.haml
  10. +20 −0 views/pages.haml
  11. +12 −0 views/settings.haml
View
@@ -0,0 +1,2 @@
+.bundle
+test.db
View
@@ -2,4 +2,12 @@ source :rubygems
gem 'sinatra'
gem 'haml'
gem 'dropbox'
-gem 'sequel'
+gem 'sequel'
+gem 'rack-flash'
+group :development do
+ gem 'sqlite3-ruby'
+ gem 'ruby-debug'
+end
+group :production do
+ gem 'pg'
+end
View
@@ -1,22 +1,36 @@
GEM
remote: http://rubygems.org/
specs:
+ columnize (0.3.2)
dropbox (1.2.3)
json (>= 1.2.0)
mechanize (>= 1.0.0)
multipart-post (>= 1.0)
oauth (>= 0.3.6)
haml (3.0.25)
json (1.5.1)
+ linecache (0.43)
mechanize (1.0.0)
nokogiri (>= 1.2.1)
multipart-post (1.1.0)
nokogiri (1.4.4)
oauth (0.4.4)
+ pg (0.10.1)
rack (1.2.1)
+ rack-flash (0.1.1)
+ rack
+ ruby-debug (0.10.4)
+ columnize (>= 0.1)
+ ruby-debug-base (~> 0.10.4.0)
+ ruby-debug-base (0.10.4)
+ linecache (>= 0.3)
+ sequel (3.20.0)
sinatra (1.1.2)
rack (~> 1.1)
tilt (~> 1.2)
+ sqlite3 (1.3.3)
+ sqlite3-ruby (1.3.3)
+ sqlite3 (>= 1.3.3)
tilt (1.2.2)
PLATFORMS
@@ -25,4 +39,9 @@ PLATFORMS
DEPENDENCIES
dropbox
haml
+ pg
+ rack-flash
+ ruby-debug
+ sequel
sinatra
+ sqlite3-ruby
View
@@ -1,2 +1,5 @@
+require 'rubygems'
+require 'bundler'
+Bundler.require
require 'app'
run Sinatra::Application
View
@@ -0,0 +1,15 @@
+require 'rubygems'
+require 'sequel'
+
+class Base < Sequel::Migration
+ def up
+ create_table! :users do
+ primary_key :id
+ String :email
+ String :folder
+ end
+ end
+ def down
+ drop_table :users
+ end
+end
View
@@ -1,12 +0,0 @@
-Sequel.migration do
- up do
- create_table(:users) do
- primary_key :id
- String :email
- String :folder
- end
- end
- down do
- drop_table(:users)
- end
-end
View
@@ -0,0 +1 @@
+%meta{:charset => "utf-8"}/
View
@@ -0,0 +1,6 @@
+%header
+ %h1 Wikibox
+ = if flash[:error]
+ %div.error= flash[:error]
+ = if flash[:info]
+ %div.info= flash[:info]
View
@@ -1,8 +1,8 @@
!!! 5
%html{:lang => "en"}
%head
- %meta{:charset => "utf-8"}/
%title Wikibox
+ = haml :head
%body
%h1 Wikibox alpha
- %a{:href => "/auth"} Login with Dropbox
+ %a{:href => "/auth"} Login with Dropbox
View
@@ -0,0 +1,20 @@
+!!! 5
+%html{:lang => "en"}
+ %head
+ %title Wikibox
+ = haml :head
+ %body
+ = haml :header
+ %nav
+ %ul
+ = for page in @pages
+ %li
+ %a{:href => "/pages/#{page}"}= page
+ %article
+ %header
+ %h1= page
+ %a{:href => "/pages/#{@cur_page['name']}/delete"} delete
+ = @cur_page['text'] or "This page doesn't exist yet."
+ %form{:method => "post", :action => ""}
+ %textarea{:name => "text"}= @cur_page['text']
+ %button{:type => "submit"} Save
View
@@ -0,0 +1,12 @@
+!!! 5
+%html{:lang => "en"}
+ %head
+ %title Settings / Wikibox
+ = haml :head
+ %body
+ = haml :header
+ %h1 Settings
+ %form{:method => "post", :action => ""}
+ %label{:for => "folder"} Folder:
+ %input{:name => "folder", :type => "text", value => @folder}
+ %button{:type => "submit"} Save

0 comments on commit 0fa81ea

Please sign in to comment.