aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Static.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-06-02 10:27:15 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-06-02 10:27:15 +0100
commit60da5d1d852f3cf06b04110a17ba8c0e62d62c2b (patch)
tree596eec69401942a162e6d09eb0c1e1ee48e04402 /perllib/FixMyStreet/App/Controller/Static.pm
parent41b86381605f1cf4451e51b80b42a8a2e6046687 (diff)
Bring static pages together in Static.pm, and add posters static page.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Static.pm')
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Static.pm52
1 files changed, 52 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Static.pm b/perllib/FixMyStreet/App/Controller/Static.pm
new file mode 100755
index 000000000..b58b55852
--- /dev/null
+++ b/perllib/FixMyStreet/App/Controller/Static.pm
@@ -0,0 +1,52 @@
+package FixMyStreet::App::Controller::Static;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller'; }
+
+=head1 NAME
+
+FixMyStreet::App::Controller::Static - Catalyst Controller
+
+=head1 DESCRIPTION
+
+Static pages Catalyst Controller. FAQ does some smarts to choose the correct
+template depending on language, will need extending at some point.
+
+=head1 METHODS
+
+=cut
+
+sub about : Global : Args(0) {
+ my ( $self, $c ) = @_;
+ # don't need to do anything here - should just pass through.
+}
+
+sub faq : Global : 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;
+}
+
+sub fun : Global : Args(0) {
+ my ( $self, $c ) = @_;
+ # don't need to do anything here - should just pass through.
+}
+
+sub posters : Global : Args(0) {
+ my ( $self, $c ) = @_;
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
+