Make the tree fragment work as expected so that you can browse trees again
[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     return join('%2F', shift->flatten, @_);
22 };
23
24 __PACKAGE__->meta->make_immutable(inline_constructor => 0);
25
26 __END__
27
28 =head1 NAME
29
30 Gitalist::View::Default - HTML View
31
32 =head1 DESCRIPTION
33
34 HTML View.
35
36 =head1 AUTHORS
37
38 See L<Gitalist> for authors.
39
40 =head1 LICENSE
41
42 See L<Gitalist> for the license.
43
44 =cut