Release preparation, documentation, fixing vc bugs
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index d05257e..d1d0049 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -5,6 +5,8 @@
our $VERSION;
+# TODO: The FAQ-Page has a contact form for new questions
+
# Start the application and register all routes and plugins
sub startup {
my $self = shift;
@@ -31,9 +33,9 @@
'Search', # Abstract Search framework
'CHI', # Global caching mechanism
'TagHelpers::Pagination', # Pagination widget
- 'DocNavi', # Navigation for documentation
- 'KalamarHelpers', # Specific Helpers for Kalamar
- 'KalamarTagHelpers' # Specific Taghelpers for Kalamar
+ 'Number::Commify', # Localize numbers
+ 'KalamarHelpers' # Specific Helpers for Kalamar
+
) {
$self->plugin($_);
};
@@ -42,8 +44,8 @@
$self->plugin('MailException' => $self->config('MailException'));
# Configure documentation navigation
- my $navi = b($self->home . '/templates/doc/_nav.json')->slurp;
- $self->config(navi => decode_json($navi));
+ my $navi = b($self->home . '/templates/doc/navigation.json')->slurp;
+ $self->config(navi => decode_json($navi)) if $navi;
# Establish routes
my $r = $self->routes;
@@ -52,109 +54,16 @@
$r->get('/')->to('search#query')->name('index');
# Documentation
- $r->get('/doc')->to('documentation#page', page => 'korap');
+ $r->get('/doc')->to('documentation#page', page => 'korap')->name('doc_start');
$r->get('/doc/:page')->to('documentation#page', scope => undef);
$r->get('/doc/*scope/:page')->to('documentation#page')->name('doc');
-};
-
-1;
-
-
-__END__
-
-
- # Set default totle
-# $self->defaults(
-# layout => 'main',
-# title => 'KorAP - Corpus Analysis Platform'
-# );
-
-
- $self->hook(
- before_dispatch => sub {
- my $c = shift;
- my $host = $c->req->headers->header('X-Forwarded-Host');
- if ($host && $host eq 'korap.ids-mannheim.de') {
- $c->req->url->base->path('/kalamar/');
- };
- }) if $self->mode eq 'production';
-
-
-
- # Load plugins
- foreach (qw/
- Number::Commify
- /) {
- $self->plugin($_);
- };
-
- # $self->plugin(AssetPack => { minify => 1 });
- $self->plugin('AssetPack');
- $self->plugin('AssetPack::LibSass');
-
- # Add assets for AssetPack
- $self->asset(
- 'kalamar.css' => (
-
- # Sass files
- '/sass/style.scss',
- '/sass/sidebar.scss',
- '/sass/tutorial.scss',
- '/sass/hint.scss',
- '/sass/query.scss',
- '/sass/matchinfo.scss',
- '/sass/pagination.scss',
- '/sass/kwic-4.0.scss',
- '/sass/alertify.scss',
-
- # CSS files
- '/css/font-awesome.min.css',
- '/css/media.css',
- '/css/highlight.css',
- $self->notifications->styles
- )
- );
-
- $self->asset(
- 'kalamar.js' => (
-# '/js/d3.v3.min.js',
-# '/js/dagre-d3.min.js',
-# '/js/dagre-d3.js',
-# '/js/translateTree.js',
- '/js/tutorialCookie.js',
- '/js/translateTable.js',
- '/js/hint.js',
- '/js/highlight.pack.js',
- '/js/ajax.js',
- $self->notifications->scripts
- )
- );
-
- $self->helper(
- date_format => sub {
- my ($c, $date) = @_;
- return $date;
- }
- );
-
-
- # Base search route
- $r->get('/')->to('search#query')->name('index');
-
- # Get match information
+ # Match route
my $corpus = $r->route('/corpus/:corpus_id');
- my $doc = $corpus->route('/#doc_id');
- my $match = $doc->route('/:match_id')
- ->to('search#match_info')
- ->name('match');
-
- # Tutorial data
- $r->get('/tutorial')->to('tutorial#page', tutorial => 'index');
- $r->get('/tutorial/(*tutorial)')->to('tutorial#page')->name('tutorial');
-
-
- # Todo: The FAQ-Page has a contact form for new questions
+ my $doc = $corpus->get('/:doc_id');
+ my $text = $doc->get('/:text_id');
+ my $match = $text->get('/:match_id');
+ $match->to('search#match_info')->name('match');
};