Don't pass `params` to templates

It's not necessary, a `params` hash is already passed anyway.
This commit is contained in:
Al Beano 2017-07-16 23:36:46 +01:00
parent c0ba0c5c7b
commit 561500bd57
5 changed files with 8 additions and 12 deletions

View File

@ -105,7 +105,6 @@ post '/register' => sub {
if (scalar(keys(%errs)) != 0) { if (scalar(keys(%errs)) != 0) {
return template 'register' => { return template 'register' => {
error => 1, error => 1,
params,
%errs, %errs,
}; };
} }
@ -132,7 +131,6 @@ post '/register' => sub {
template 'login' => { template 'login' => {
account_created => 1, account_created => 1,
params,
}; };
}; };
@ -167,7 +165,6 @@ post '/login' => sub {
return template 'login' => { return template 'login' => {
error => 1, error => 1,
%errs, %errs,
params,
}; };
} }

View File

@ -52,7 +52,6 @@ post '/domains/new' => sub {
if (scalar(keys(%errs)) != 0) { if (scalar(keys(%errs)) != 0) {
return template 'domains/new' => { return template 'domains/new' => {
params,
%errs, %errs,
error => 1, error => 1,
}; };

View File

@ -11,10 +11,10 @@
You did not specify a domain to register. You did not specify a domain to register.
<% END %> <% END %>
<% IF e_exists %> <% IF e_exists %>
The domain '<% name | html_entity %>.cyb' has already been registered. Please choose a different domain name. The domain '<% params.name | html_entity %>.cyb' has already been registered. Please choose a different domain name.
<% END %> <% END %>
<% IF e_chars %> <% IF e_chars %>
The domain '<% name | html_entity %>.cyb' contains invalid characters. Domains must match the regular expression `^[a-z0-9]([a-z0-9\-_]*[a-z0-9])?$`. The domain '<% params.name | html_entity %>.cyb' contains invalid characters. Domains must match the regular expression `^[a-z0-9]([a-z0-9\-_]*[a-z0-9])?$`.
<% END %> <% END %>
</div> </div>
<br /><br /> <br /><br />

View File

@ -5,7 +5,7 @@
<% IF account_created %> <% IF account_created %>
<div class="msgBox"> <div class="msgBox">
Your account has been created and a confirmation email sent to <% email | html_entity %>. Please confirm your email address, then log in here. Your account has been created and a confirmation email sent to <% params.email | html_entity %>. Please confirm your email address, then log in here.
</div> </div>
<br /><br /> <br /><br />
<% END %> <% END %>
@ -13,13 +13,13 @@
<% IF error %> <% IF error %>
<div class="msgBox"> <div class="msgBox">
<% IF e_no_user %> <% IF e_no_user %>
The email address <% email | html_entity %> is not registered. The email address <% params.email | html_entity %> is not registered.
<% END %> <% END %>
<% IF e_pass %> <% IF e_pass %>
Your password was incorrect, sorry. Your password was incorrect, sorry.
<% END %> <% END %>
<% IF e_not_confirmed %> <% IF e_not_confirmed %>
Please confirm your email address using the link sent to <% email | html_entity %>. Please confirm your email address using the link sent to <% params.email | html_entity %>.
<% END %> <% END %>
</div> </div>
<br /><br /> <br /><br />

View File

@ -39,7 +39,7 @@
<label for="email">Email address:</label> <label for="email">Email address:</label>
</td> </td>
<td> <td>
<input type="email" name="email" id="email" value="<% email | html_entity %>" /> <input type="email" name="email" id="email" value="<% params.email | html_entity %>" />
</td> </td>
</tr> </tr>
<tr> <tr>
@ -47,7 +47,7 @@
<label for="password">Password:</label> <label for="password">Password:</label>
</td> </td>
<td> <td>
<input type="password" name="password" id="password" value="<% password | html_entity %>" /> <input type="password" name="password" id="password" value="<% params.password | html_entity %>" />
</td> </td>
</tr> </tr>
<tr> <tr>
@ -55,7 +55,7 @@
<label for="password2">Confirm password:</label> <label for="password2">Confirm password:</label>
</td> </td>
<td> <td>
<input type="password" name="password2" id="password2" value="<% password2 | html_entity %>" /> <input type="password" name="password2" id="password2" value="<% params.password2 | html_entity %>" />
</td> </td>
</tr> </tr>
</table> </table>