File tree 1 file changed +11
-10
lines changed
1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -62,13 +62,6 @@ sub index_handler {
62
62
63
63
my $u = $poll -> journal;
64
64
65
- my $vars = {
66
- remote => $remote ,
67
- poll => $poll ,
68
- pollid => $pollid ,
69
- u => $u
70
- };
71
-
72
65
my $mode = " " ;
73
66
$mode = $form -> {' mode' }
74
67
if ( defined $form -> {' mode' } && $form -> {' mode' } =~ / (enter|results|ans|clear)/ );
@@ -90,6 +83,17 @@ sub index_handler {
90
83
91
84
return error_ml(' /poll/index.tt.error.cantview' ) unless ( $entry -> visible_to($remote ) );
92
85
86
+ # bundle variables to be passed to the template
87
+ my $vars = {
88
+ remote => $remote ,
89
+ u => $u ,
90
+ poll => $poll ,
91
+ pollid => $pollid ,
92
+ poll_form => $form ,
93
+ mode => $mode ,
94
+ entry => $entry ,
95
+ };
96
+
93
97
if ( defined $form -> {' poll-submit' } && $r -> did_post ) {
94
98
my $error ;
95
99
my $error_code = LJ::Poll-> process_submission( $form , \$error );
@@ -102,9 +106,6 @@ sub index_handler {
102
106
}
103
107
}
104
108
105
- $vars -> {poll } = $poll ;
106
- $vars -> {mode } = $mode ;
107
- $vars -> {poll_form } = $form ;
108
109
return DW::Template-> render_template( ' poll/index.tt' , $vars );
109
110
}
110
111
You can’t perform that action at this time.
0 commit comments