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) {
return template 'register' => {
error => 1,
params,
%errs,
};
}
@ -132,7 +131,6 @@ post '/register' => sub {
template 'login' => {
account_created => 1,
params,
};
};
@ -167,7 +165,6 @@ post '/login' => sub {
return template 'login' => {
error => 1,
%errs,
params,
};
}

View File

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

View File

@ -11,10 +11,10 @@
You did not specify a domain to register.
<% END %>
<% 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 %>
<% 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 %>
</div>
<br /><br />

View File

@ -5,7 +5,7 @@
<% IF account_created %>
<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>
<br /><br />
<% END %>
@ -13,13 +13,13 @@
<% IF error %>
<div class="msgBox">
<% IF e_no_user %>
The email address <% email | html_entity %> is not registered.
The email address <% params.email | html_entity %> is not registered.
<% END %>
<% IF e_pass %>
Your password was incorrect, sorry.
<% END %>
<% 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 %>
</div>
<br /><br />

View File

@ -39,7 +39,7 @@
<label for="email">Email address:</label>
</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>
</tr>
<tr>
@ -47,7 +47,7 @@
<label for="password">Password:</label>
</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>
</tr>
<tr>
@ -55,7 +55,7 @@
<label for="password2">Confirm password:</label>
</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>
</tr>
</table>