added a checkbox to make the password visible

This commit is contained in:
Daniel Steglich 2015-02-28 15:30:10 +01:00
parent 76f9d087c9
commit f35ab6a3b4
2 changed files with 17 additions and 1 deletions

View File

@ -98,6 +98,11 @@ class ConfigureForm(forms.Form):
help_text=_('You should have been requested to select a password \
when you created the account.'))
showpw = forms.BooleanField(label=_('show password'),
required=False,
widget=forms.CheckboxInput
(attrs={'onclick': 'show_pass();'}))
dynamicdns_ipurl = TrimmedCharField(
label=_('IP check URL'),
required=False,

View File

@ -30,5 +30,16 @@
<input type="submit" class="btn btn-primary btn-md" value="Update setup"/>
</form>
{% endblock %}
{% block page_js %}
<script type="text/javascript">
function show_pass()
{
if(document.getElementById('id_dynamicdns-showpw').checked){
document.getElementById("id_dynamicdns-dynamicdns_secret").type='text';}
else
document.getElementById("id_dynamicdns-dynamicdns_secret").type='password';
}
</script>
{% endblock %}