summary refs log tree commit diff
path: root/lib/ballet.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ballet.pm')
-rw-r--r--lib/ballet.pm18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/ballet.pm b/lib/ballet.pm
index d48a3b7..4be1acc 100644
--- a/lib/ballet.pm
+++ b/lib/ballet.pm
@@ -3,13 +3,23 @@ package ballet;
 use 5.010;
 
 use Dancer ':syntax';
+#use Dancer::Plugin::Auth::Twitter;
 
 use ballet::Git;
 
 our $VERSION = '0.1';
 
+#auth_twitter_init();
+
 my $git = ballet::Git->new( wiki_path => setting('wiki_path') );
 
+# before sub {
+#     return if request->path =~ m{/auth/twitter/callback};
+#     if (not session('twitter_user')) {
+#         redirect auth_twitter_authenticate_url;
+#     }
+# };
+
 get '/' => sub { wiki_page('Home'); };
 
 get '/history/*' => sub {
@@ -17,7 +27,8 @@ get '/history/*' => sub {
 
     debug("looking history for $page_name");
 
-    my $history = $git->find_history($page_name, 'master');
+    my $versions = $git->find_history( $page_name, 'master' );
+    template 'history', {versions => $versions, title => 'Home'};
 };
 
 get '/edit/*' => sub {
@@ -49,14 +60,15 @@ sub wiki_page {
     my $page_name = shift;
 
     my $content = $git->find_page( $page_name, 'master' );
-    $content = $git->convert('textile', $content);
+    $content = $git->convert( 'textile', $content );
 
     template 'page',
       {
         title   => $page_name,
         author  => 'franck',
         date    => '10/10/10',
-        content => $content
+        content => $content,
+#        user    => session('twitter_user')->{'screen_name'},
       };
 }