diff options
author | franck cuny <franck@lumberjaph.net> | 2011-03-13 17:38:50 +0100 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2011-03-13 17:38:50 +0100 |
commit | 8eb25326f448a2139baf4bf1e1a0786de367f3c3 (patch) | |
tree | 731377bf3612dd55aa05f1979d2e7c1129401412 /lib | |
parent | format + history (diff) | |
download | ballet-8eb25326f448a2139baf4bf1e1a0786de367f3c3.tar.gz |
history
Signed-off-by: franck cuny <franck@lumberjaph.net>
Diffstat (limited to '')
-rw-r--r-- | lib/ballet.pm | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/ballet.pm b/lib/ballet.pm index aa2836b..d48a3b7 100644 --- a/lib/ballet.pm +++ b/lib/ballet.pm @@ -3,14 +3,21 @@ package ballet; use 5.010; use Dancer ':syntax'; + use ballet::Git; our $VERSION = '0.1'; my $git = ballet::Git->new( wiki_path => setting('wiki_path') ); -get '/' => sub { - wiki_page('Home'); +get '/' => sub { wiki_page('Home'); }; + +get '/history/*' => sub { + my ($page_name) = splat; + + debug("looking history for $page_name"); + + my $history = $git->find_history($page_name, 'master'); }; get '/edit/*' => sub { @@ -22,6 +29,14 @@ get '/edit/*' => sub { template 'edit', {content => $content, title => 'Home'}; }; +get '/*' => sub { + my ($page_name) = splat; + + debug("looking for page $page_name"); + + wiki_page($page_name); +}; + post '/edit/*' => sub { my ($page_name) = splat; @@ -32,7 +47,9 @@ post '/edit/*' => sub { sub wiki_page { my $page_name = shift; + my $content = $git->find_page( $page_name, 'master' ); + $content = $git->convert('textile', $content); template 'page', { |