Only 2 of the pages in the app test now generate invalid links.
[catagits/Gitalist.git] / lib / Gitalist / View / Default.pm
1 package Gitalist::View::Default;
2 use Moose;
3 use Moose::Autobox;
4 use namespace::autoclean;
5
6 extends 'Catalyst::View::TT';
7 with 'Catalyst::View::Component::SubInclude';
8
9 use Template::Plugin::Cycle;
10
11 __PACKAGE__->config(
12   TEMPLATE_EXTENSION => '.tt2',
13   WRAPPER            => 'wrapper.tt2',
14   subinclude_plugin => 'SubRequest',
15 );
16
17 use Template::Stash;
18
19 # define list method to flatten arrayrefs
20 $Template::Stash::LIST_OPS->{ to_path } = sub {
21     my $path = join('%2F', shift->flatten, @_);
22     $path =~ s{/}{%2F}g;
23     return $path;
24 };
25
26 __PACKAGE__->meta->make_immutable(inline_constructor => 0);
27
28 __END__
29
30 =head1 NAME
31
32 Gitalist::View::Default - HTML View
33
34 =head1 DESCRIPTION
35
36 HTML View.
37
38 =head1 AUTHORS
39
40 See L<Gitalist> for authors.
41
42 =head1 LICENSE
43
44 See L<Gitalist> for the license.
45
46 =cut