Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Basic stuff works
Browse files Browse the repository at this point in the history
  • Loading branch information
myfreeweb committed Feb 20, 2011
1 parent fea526a commit 0fa81ea
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
.bundle
test.db
10 changes: 9 additions & 1 deletion Gemfile
Expand Up @@ -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
19 changes: 19 additions & 0 deletions Gemfile.lock
@@ -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
Expand All @@ -25,4 +39,9 @@ PLATFORMS
DEPENDENCIES
dropbox
haml
pg
rack-flash
ruby-debug
sequel
sinatra
sqlite3-ruby
3 changes: 3 additions & 0 deletions config.ru
@@ -1,2 +1,5 @@
require 'rubygems'
require 'bundler'
Bundler.require
require 'app'
run Sinatra::Application
15 changes: 15 additions & 0 deletions data/001_Base.rb
@@ -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
12 changes: 0 additions & 12 deletions migration.rb

This file was deleted.

1 change: 1 addition & 0 deletions views/head.haml
@@ -0,0 +1 @@
%meta{:charset => "utf-8"}/
6 changes: 6 additions & 0 deletions views/header.haml
@@ -0,0 +1,6 @@
%header
%h1 Wikibox
= if flash[:error]
%div.error= flash[:error]
= if flash[:info]
%div.info= flash[:info]
4 changes: 2 additions & 2 deletions views/landing.haml
@@ -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
20 changes: 20 additions & 0 deletions views/pages.haml
@@ -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
12 changes: 12 additions & 0 deletions views/settings.haml
@@ -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.