Skip to content

Commit

Permalink
Merge remote branch 'dhoss/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kieren Diment committed Mar 17, 2010
2 parents 429b802 + ef36bb4 commit 67ce793
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
Binary file modified Survey-Perl/db/answers.db
Binary file not shown.
2 changes: 1 addition & 1 deletion Survey-Perl/lib/Survey/Perl/Answers/Schema.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use warnings;


use base 'DBIx::Class::Schema'; use base 'DBIx::Class::Schema';


__PACKAGE__->load_classes; __PACKAGE__->load_namespaces;




# Created by DBIx::Class::Schema::Loader v0.04006 @ 2009-09-11 17:06:47 # Created by DBIx::Class::Schema::Loader v0.04006 @ 2009-09-11 17:06:47
Expand Down
10 changes: 8 additions & 2 deletions Survey-Perl/lib/Survey/Perl/Controller/Survey.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package Survey::Perl::Controller::Survey;
use Moose; use Moose;
use Config::Any; use Config::Any;
BEGIN { extends 'Catalyst::Controller' } BEGIN { extends 'Catalyst::Controller' }

use Data::Dumper;
sub survey_base :Chained("/") :PathPart("survey") :CaptureArgs(0) { sub survey_base :Chained("/") :PathPart("survey") :CaptureArgs(0) {
my ($self, $c) = @_; my ($self, $c) = @_;
# if (! $c->user) { # if (! $c->user) {
Expand Down Expand Up @@ -31,7 +31,13 @@ sub finish_survey :Chained("survey_base") :PathPart("finish") :Args(0) {


sub finish_survey : Chained("survey_base") PathPart("finish") Args(0) { sub finish_survey : Chained("survey_base") PathPart("finish") Args(0) {
my ($self, $c) = @_; my ($self, $c) = @_;

my $answers = $c->req->params;
$c->log->debug("Params: " . Dumper $answers);
delete $answers->{'submit'};
my $rs = $c->model('Answers')->txn_do(sub{
$c->model('Answers::Survey')->create($answers)
or die "Could not submit survey answers: $!";
});


} }


Expand Down
6 changes: 5 additions & 1 deletion Survey-Perl/root/static/css/local.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ pre {
white-space: -pre-wrap; /* Opera 4-6 */ white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */ white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */ word-wrap: break-word; /* Internet Explorer 5.5+ */
} }

h2 {
color: #eeeeee;
}
3 changes: 3 additions & 0 deletions Survey-Perl/root/survey/finish_survey.tt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,3 @@
[% IF c.req.params %]
<h2>Thank you for completing the survey.</h2>
[% END %]
2 changes: 1 addition & 1 deletion Survey-Perl/root/survey/index.tt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ $(document).ready(function(){


<div class="formContainer"> <div class="formContainer">


<form name="" action = "[% c.uri_for_action('/survey/finish') %]" method="POST"> <form name="" action = "[% c.uri_for_action('/survey/finish_survey') %]" method="POST">
<ul class="form"> <ul class="form">
[% FOREACH s IN sections %] [% FOREACH s IN sections %]


Expand Down

0 comments on commit 67ce793

Please sign in to comment.