Permalink
Browse files

Get November wiki itself working on rakudo master

All the links in the user interface seem to work now.
  • Loading branch information...
1 parent 932b4b3 commit 368e5e20818dd641545484a3ba8a2bdc5df15d1c @softmoth softmoth committed Jul 8, 2011
Showing with 13 additions and 11 deletions.
  1. +10 −8 lib/November.pm
  2. +1 −1 lib/November/Utils.pm
  3. +1 −1 lib/Text/Markup/Wiki/MediaWiki.pm
  4. +1 −1 wiki
View
@@ -42,7 +42,7 @@ class November does November::Session does November::Cache {
['out'], { self.log_out },
['register'], { self.register },
['recent'], { self.list_recent_changes },
- ['history'], { self.view_page_history(~$^page) },
+ ['history', /^ <-[?/]>+ $/], { self.view_page_history(~$^page) },
['all'], { self.list_all_pages },
];
@@ -96,7 +96,7 @@ class November does November::Session does November::Cache {
}
- method edit_page($page is rw) {
+ method edit_page($page is copy) {
$page .= subst('%20', '_', :g);
my $sessions = self.read_sessions();
@@ -191,7 +191,9 @@ class November does November::Session does November::Cache {
}
method read_users {
- return {} unless $.config.userfile_path ~~ :e;
+ # RAKUDO: NYI ~~ :X file
+ #return {} unless $.config.userfile_path ~~ :e;
+ return {} unless $.config.userfile_path.IO.e;
return eval( slurp( $.config.userfile_path ) );
}
@@ -285,7 +287,7 @@ class November does November::Session does November::Cache {
}
method error_page($message = "An internal error occurred. Apologies.") {
- self.response( 'error.tmpl', { MESSAGE => $message } );
+ self.response( 'error.tmpl', { MESSAGE => $message ~ "<pre>{self.perl}</pre>" } );
}
method list_recent_changes {
@@ -296,7 +298,7 @@ class November does November::Session does November::Cache {
);
}
- method view_page_history($page is rw = 'Main_Page') {
+ method view_page_history($page is copy = 'Main_Page') {
$page .= subst('%20', '_', :g);
unless $.storage.wiki_page_exists($page) {
@@ -309,7 +311,7 @@ class November does November::Session does November::Cache {
self.response('page_history.tmpl',
{
'TITLE' => $title,
- 'CHANGES' => self.get_changes($page, limit => 50),
+ 'CHANGES' => self.get_changes(:$page, limit => 50),
}
);
}
@@ -394,9 +396,9 @@ class November does November::Session does November::Cache {
my $root = $!config.web_root;
if $title {
if $page ~~ m/':'/ {
- return qq|<a href="{ $root ~ $page }">$title</a>|;
+ return qq|<a href="{ $root ~ $page }">{$title}</a>|;
} else {
- return qq|<a href="$root/view/$page">$title</a>|;
+ return qq|<a href="$root/view/$page">{$title}</a>|;
}
} else {
return sprintf('<a href="%s/%s/%s" %s >%s</a>',
View
@@ -38,7 +38,7 @@ sub get_period ($modif_time, $time_now?) is export {
return ($days, $hours, $mins)
}
-sub time_to_period_str ($time) {
+sub time_to_period_str ($time) is export {
return False unless $time;
my $t = get_period($time);
my $str = '~';
@@ -131,7 +131,7 @@ class Text::Markup::Wiki::MediaWiki {
}
elsif $token<wikilink> {
take defined $link_maker
- ?? $link_maker(~$token<wikilink><page>, Mu)
+ ?? $link_maker(~$token<wikilink><page>, Any)
!! ~$token<wikilink>;
}
elsif $token<extlink> {
View
2 wiki
@@ -1,8 +1,8 @@
#!perl6
use v6;
-use November::CGI;
use November;
+use November::CGI;
use November::Config;
use Text::Markup::Wiki::MediaWiki;

0 comments on commit 368e5e2

Please sign in to comment.