Lots of fixes to pagination, l10n, tutorial, css ...
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index aea95f5..d5fb248 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -36,7 +36,6 @@
'Search', # Abstract Search framework
'CHI', # Global caching mechanism
'TagHelpers::Pagination', # Pagination widget
- 'Number::Commify', # Localize numbers
'KalamarHelpers' # Specific Helpers for Kalamar
) {
@@ -74,3 +73,11 @@
__END__
+
+=pod
+
+To get started, you'll need npm. Then you can install and run grunt:
+
+sudo npm install -g grunt-cli
+npm install
+grunt
diff --git a/lib/Kalamar/Controller/Search.pm b/lib/Kalamar/Controller/Search.pm
index 09ab580..13af8c5 100644
--- a/lib/Kalamar/Controller/Search.pm
+++ b/lib/Kalamar/Controller/Search.pm
@@ -10,7 +10,7 @@
# No query
unless ($query) {
- return $c->render(template => 'intro');
+ return $c->render(template => $c->loc('template_intro', 'intro'));
};
# Base parameters for remote access
diff --git a/lib/Kalamar/Plugin/KalamarHelpers.pm b/lib/Kalamar/Plugin/KalamarHelpers.pm
index 5434cd1..be86f56 100644
--- a/lib/Kalamar/Plugin/KalamarHelpers.pm
+++ b/lib/Kalamar/Plugin/KalamarHelpers.pm
@@ -32,6 +32,8 @@
);
# Documentation link
+ # TODO: Support opener mechanism, so the link will open the embedded
+ # documentation in case it's not there.
$mojo->helper(
doc_link_to => sub {
my $c = shift;
@@ -53,6 +55,24 @@
}
);
+ $mojo->helper(
+ doc_opener => sub {
+ my $c = shift;
+ my $cb = pop;
+ my $page = pop;
+ my $scope = shift;
+ my $url;
+ if ($page) {
+ $url = $c->url_for('doc', page => $page, scope => $scope);
+ $url->path->canonicalize;
+ }
+ else {
+ $url = $c->url_for('doc_start');
+ };
+ return $c->link_to($cb->($c), $url);
+ }
+ );
+
# Documentation navigation helper
$mojo->helper(
@@ -180,6 +200,14 @@
$c->stash('kalamar.test_port' => 0);
return 0;
});
+
+ # Create links in the tutorial that make sure the current position is preserved,
+ # in case the tutorial was opened embedded
+ $mojo->helper(
+ kalamar_tut_link_to => sub {
+ return '[TODO]';
+ }
+ );
};