aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/FAQ.pm
blob: 6b8fb11919ff1d9be6c66ec5ff6fe805414ea8d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package FixMyStreet::App::Controller::FAQ;
use Moose;
use namespace::autoclean;

BEGIN { extends 'Catalyst::Controller'; }

=head1 NAME

FixMyStreet::App::Controller::FAQ - Catalyst Controller

=head1 DESCRIPTION

Show the FAQ page - does some smarts to choose the correct template depending on
language.

=cut

sub faq : Path : Args(0) {
    my ( $self, $c ) = @_;

    # There should be a faq template for each language in a cobrand or default.
    # This is because putting the FAQ translations into the PO files is
    # overkill.
    
    # We rely on the list of languages for the site being restricted so that there
    # will be a faq template for that language/cobrand combo.
        
    my $lang_code = $c->stash->{lang_code};
    my $template  = "faq/faq-$lang_code.html";
    $c->stash->{template} = $template;
}

__PACKAGE__->meta->make_immutable;

1;