Revert "Change to visit"
[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   render_die => 1,
16 );
17
18 use Template::Stash;
19
20 # define list method to flatten arrayrefs
21 $Template::Stash::LIST_OPS->{ to_path } = sub {
22     my $path = join('%2F', shift->flatten, @_);
23     $path =~ s{/}{%2F}g;
24     return $path;
25 };
26
27 __PACKAGE__->meta->make_immutable(inline_constructor => 0);
28
29 __END__
30
31 =head1 NAME
32
33 Gitalist::View::Default - HTML View
34
35 =head1 DESCRIPTION
36
37 HTML View.
38
39 =head1 AUTHORS
40
41 See L<Gitalist> for authors.
42
43 =head1 LICENSE
44
45 See L<Gitalist> for the license.
46
47 =cut