diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Contact.pm | 45 | ||||
-rw-r--r-- | t/app/controller/contact.t | 14 | ||||
-rw-r--r-- | templates/web/default/contact/index.html | 58 |
3 files changed, 117 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Contact.pm b/perllib/FixMyStreet/App/Controller/Contact.pm new file mode 100644 index 000000000..6054dd326 --- /dev/null +++ b/perllib/FixMyStreet/App/Controller/Contact.pm @@ -0,0 +1,45 @@ +package FixMyStreet::App::Controller::Contact; +use Moose; +use namespace::autoclean; + +BEGIN {extends 'Catalyst::Controller'; } + +=head1 NAME + +FixMyStreet::App::Controller::Contact - Catalyst Controller + +=head1 DESCRIPTION + +Contact us page + +=head1 METHODS + +=cut + + +=head2 index + +=cut + +sub index :Path :Args(0) { + my ( $self, $c ) = @_; + + $c->stash->{contact_email} = $c->cobrand->contact_email; + $c->stash->{contact_email} =~ s/\@/@/; +} + + +=head1 AUTHOR + +Struan Donald + +=head1 LICENSE + +This library is free software. You can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +__PACKAGE__->meta->make_immutable; + +1; diff --git a/t/app/controller/contact.t b/t/app/controller/contact.t new file mode 100644 index 000000000..a15f08118 --- /dev/null +++ b/t/app/controller/contact.t @@ -0,0 +1,14 @@ +use strict; +use warnings; +use Test::More; + +use FixMyStreet::TestMech; + +my $mech = FixMyStreet::TestMech->new; + + + +$mech->get_ok( '/contact' ); +$mech->content_contains( "We'd love to hear what you think about this site" ); + +done_testing(); diff --git a/templates/web/default/contact/index.html b/templates/web/default/contact/index.html new file mode 100644 index 000000000..0d7cf2e9c --- /dev/null +++ b/templates/web/default/contact/index.html @@ -0,0 +1,58 @@ +[% INCLUDE 'header.html', title => loc('Create a report') %] + +<h1>[% loc('Contact the team') %]</h1> + +<form method="post" action="/contact/submit"> + +<input type="hidden" name="submit_form" value="1"> + +[% INCLUDE 'errors.html' %] + +<p> +[% loc('Please do <strong>not</strong> report problems through this form; messages go to +the team behind FixMyStreet, not a council. To report a problem, +please <a href="/">go to the front page</a> and follow the instructions.') %] +</p> + +<p> +[% tprintf( loc("We'd love to hear what you think about this site. Just fill in the form, or send an email to <a href='mailto:%s'>%s</a>:"), contact_email, contact_email) %] +</p> + + +<div class="form-field"> +<label for="form_name">Your name:</label> + +<input type="text" name="name" id="form_name" value="[% form_name %]" size="30"></div> + + +<div class="form-field"> +<label for="form_email">Your email:</label> +<input type="text" name="em" id="form_email" value="[% email %]" size="30"></div> + +<div class="form-field"> +<label for="form_subject">Subject:</label> +<input type="text" name="subject" id="form_subject" value="[% subject %]" size="30"></div> + +<div class="form-field"> +<label for="form_message">Message:</label> + +<textarea name="message" id="form_message" rows="7" cols="50">[% message %]</textarea></div> +<div class="checkbox"><input type="submit" value="Post"></div> + +</form> + +<div class="contact-details"> +<p>FixMyStreet is a service provided by mySociety, which is the project of a +registered charity. The charity is called UK Citizens Online Democracy and is charity number 1076346.</p> +<p>mySociety can be contacted by email at <a href="mailto:hello@mysociety.org">hello@mysociety.org</a>, +or by post at:</p> +<p>mySociety<br> +483 Green Lanes<br> + +London<br> +N13 4BS<br> +UK</p> +</div> + + +[% INCLUDE 'footer.html' %] |