Skip to content

Commit

Permalink
Merge pull request #22 from opendatazurich/ogdzh-206
Browse files Browse the repository at this point in the history
Set autocomplete off in login and new user forms.
  • Loading branch information
metaodi committed Feb 12, 2015
2 parents bc91b7e + a16eeb9 commit 1ed719b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ckanext/stadtzhtheme/templates/user/new_user_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% import "macros/form.html" as form %}

<form class="form-horizontal" action="" method="post" autocomplete="off">
{{ form.errors(error_summary) }}
{{ form.input("name", id="field-username", label=_("Username"), placeholder="username", value=data.name, error=errors.name, classes=["control-medium"]) }}
{{ form.input("fullname", id="field-fullname", label=_("Full Name"), placeholder="Joe Bloggs", value=data.fullname, error=errors.fullname, classes=["control-medium"]) }}
{{ form.input("email", id="field-email", label=_("Email"), type="email", placeholder="[email protected]", value=data.email, error=errors.email, classes=["control-medium"]) }}
{{ form.input("password1", id="field-password", label=_("Password"), type="password", placeholder="••••••••", value=data.password1, error=errors.password1, classes=["control-medium"]) }}
{{ form.input("password2", id="field-confirm-password", label=_("Confirm"), type="password", placeholder="••••••••", value=data.password2, error=errors.password1, classes=["control-medium"]) }}
<div class="form-actions">
<button class="btn btn-primary" type="submit" name="save">{{ _("Create Account") }}</button>
</div>
</form>
29 changes: 29 additions & 0 deletions ckanext/stadtzhtheme/templates/user/snippets/login_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{#
Renders the login form.

action - The url that the form should be submitted to.
error_summary - A tuple/list of form errors.

Example:

{% snippet "user/snippets/login_form.html", action=c.login_handler, error_summary=error_summary %}

#}
{% import 'macros/form.html' as form %}

{% set username_error = true if error_summary %}
{% set password_error = true if error_summary %}

<form action="{{ action }}" method="post" class="form-horizontal" autocomplete="off">
{{ form.errors(errors=error_summary) }}

{{ form.input('login', label=_("Username"), id='field-login', value="", error=username_error, classes=["control-medium"]) }}

{{ form.input('password', label=_("Password"), id='field-password', type="password", value="", error=password_error, classes=["control-medium"]) }}

{{ form.checkbox('remember', label=_("Remember me"), id='field-remember', checked=true, value="63072000") }}

<div class="form-actions">
<button class="btn btn-primary" type="submit">{{ _('Log in') }}</button>
</div>
</form>

0 comments on commit 1ed719b

Please sign in to comment.