Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Feat: Add Hide/show toggle feature for all password fields #1136

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions vms/authentication/templates/authentication/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ <h2 class="header">{% trans "Please sign in" %}</h2>
{% trans "Password" %}<span class="asteriskField">*</span>
</label>
<div class="control">
<i id="toggle_icon" class="fa fa-eye" style="position: relative; cursor: pointer; left:92%; top: 30px; z-index: 2;"></i>
<input class="textinput textInput form-control" id="id_password" name="password" placeholder="{% blocktrans %}Password{% endblocktrans %}" type="password">
</div>
<p class="help-block">
Expand All @@ -57,10 +58,11 @@ <h2 class="header">{% trans "Please sign in" %}</h2>
<label for="id_password" class="control-label" requiredField>
{% trans "Password" %}<span class="asteriskField">*</span>
</label>
<div class="control">
<input class="textinput textInput form-control" id="id_password" name="password" placeholder="{% blocktrans %}Password{% endblocktrans %}" type="password">
<div class="control"><i id="toggle_icon" class="fa fa-eye" style="position: relative; cursor: pointer; left:92%; top: 10px; z-index: 2;"></i>
<input class="textinput textInput form-control" id="id_password" name="password" placeholder="{% blocktrans %}Password{% endblocktrans %}" type="password" style="margin-top: -19.9px;">
</div>
</div>

{% endif %}
{% if form.errors %}
<div class="alert alert-danger">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ <h2 class="header">{% trans "Sign Up" %}</h2>
{% endif %}
{% if user_form.password.errors %}
<div id="div_id_password" class="form-group has-error">
<label class="control-label requiredField" for="id_password">
<label class="control-label requiredField" style="margin-top: -20px;" for="id_password" >
{% trans "Password" %}<span class="asteriskField">*</span>
</label>
<div class="controls">
<input id="id_password" class="textinput textInput form-control" type="password" placeholder="{% blocktrans %}Password{% endblocktrans %}" name="usr-password">
<i id="toggle_icon" class="fa fa-eye" style="position: relative; cursor: pointer; left:92%; top: 10px; z-index: 2;"></i>
<input id="id_password" class="textinput textInput form-control" type="password" placeholder="{% blocktrans %}Password{% endblocktrans %}" name="usr-password" style="margin-top: -20px;">
<p class="help-block">
<strong>
{% for error in user_form.password.errors %}
Expand All @@ -58,9 +59,11 @@ <h2 class="header">{% trans "Sign Up" %}</h2>
{% trans "Password" %}<span class="asteriskField">*</span>
</label>
<div class="controls">
<input id="id_password" class="textinput textInput form-control" type="password" placeholder="{% blocktrans %}Password{% endblocktrans %}" name="usr-password">
<i id="toggle_icon" class="fa fa-eye" style="position: relative; cursor: pointer; left:92%; top:10px; z-index: 2;"></i>
<input id="id_password" class="textinput textInput form-control" type="password" placeholder="{% blocktrans %}Password{% endblocktrans %}" name="usr-password" style="margin-top: -20px;">
</div>
</div>

{% endif %}
{% if user_form.confirm_password.errors %}
<div id="div_id_confirm_password" class="form-group has-error">
Expand Down
9 changes: 6 additions & 3 deletions vms/registration/templates/registration/signup_volunteer.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ <h2 class="header">{% trans "Sign Up" %}</h2>
{% trans "Password" %}<span class="asteriskField">*</span>
</label>
<div class="controls">
<input id="id_password" class="textinput textInput form-control" type="password" placeholder="{% blocktrans %}Password{% endblocktrans %}" name="usr-password" required>
<p class="help-block">
<i id="toggle_icon" class="fa fa-eye" style="position: relative; cursor: pointer; left:92%; top:10px; z-index: 2;"></i>
<input id="id_password" class="textinput textInput form-control" type="password" placeholder="{% blocktrans %}Password{% endblocktrans %}" name="usr-password" required style="margin-top: -20px;">
<p class="help-block">
<strong>
{% for error in user_form.password.errors %}
{{ error }}
Expand All @@ -58,9 +59,11 @@ <h2 class="header">{% trans "Sign Up" %}</h2>
{% trans "Password" %}<span class="asteriskField">*</span>
</label>
<div class="controls">
<input id="id_password" class="textinput textInput form-control" type="password" placeholder="{% blocktrans %}Password{% endblocktrans %}" name="usr-password" required>
<i id="toggle_icon" class="fa fa-eye" style="position: relative; cursor: pointer; left:92%; top:10px; z-index: 2;"></i>
<input id="id_password" class="textinput textInput form-control" type="password" placeholder="{% blocktrans %}Password{% endblocktrans %}" name="usr-password" required style="margin-top: -20px;">
</div>
</div>

{% endif %}
{% if user_form.confirm_password.errors %}
<div id="div_id_confirm_password" class="form-group has-error">
Expand Down
3 changes: 3 additions & 0 deletions vms/vms/static/vms/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -397,4 +397,7 @@ p.comment-alert {



.fa.active{
color:dodgerblue;
}

9 changes: 9 additions & 0 deletions vms/vms/static/vms/js/passwordtoggle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$(document).on('click', '#toggle_icon', function() {

$(this).toggleClass("active");

var input = $("#id_password");

input.attr('type') === 'password' ? input.attr('type','text') : input.attr('type','password')

});
9 changes: 7 additions & 2 deletions vms/vms/templates/vms/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,28 @@
<link href="{% static "vms/bootstrap-lumen-theme/css/bootstrap.min.css" %}" rel="stylesheet">
<!-- Custom styling taken from Systers Portal -->
<link href="{% static "vms/css/style.css" %}" rel="stylesheet">

<link href="{% static "vms/jquery-ui-1.11.4.custom/jquery-ui.min.css" %}" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css">
<link href="{% static "vms/jquery-ui-1.11.4.custom/jquery-ui.structure.min.css" %}" rel="stylesheet">
<link href="{% static "vms/jquery-ui-1.11.4.custom/jquery-ui.theme.min.css" %}" rel="stylesheet">
<link href="{% static "vms/datetimepicker/bootstrap-datetimepicker.min.css" %}" rel="stylesheet">
<link rel="icon" href="{% static 'vms/images/favicon.ico' %}">
<link rel="icon" href="{% static 'vms/images/favicon.ico' %}">

<script src="{% static "vms/jquery/jquery-1.11.1.min.js" %}"></script>
<script src="{% static "vms/bootstrap-3.2.0-dist/js/bootstrap.min.js" %}"></script>
<script src="{% static "vms/jquery-ui-1.11.4.custom/jquery-ui.min.js" %}"></script>
<script src="{% static "vms/jquery-custom/activate-datepicker.js" %}"></script>
<script src="{% static "vms/datetimepicker/bootstrap-datetimepicker.min.js" %}"></script>

<script src="{% static "vms/datetimepicker/bootstrap-datetimepicker.min.js" %}"></script>
<script>
var CityUrl = "{% url 'registration:load_cities' %}"
var StateUrl = "{% url 'registration:load_states' %}"
var CheckState = "{% url 'registration:check_states' %}"
</script>
<script src="{% static "vms/js/load_city.js" %}"></script>
{% load static %}
<script src="{% static "vms/js/passwordtoggle.js" %}" type="text/javascript"></script>
<script src="{% static "vms/js/load_state.js" %}"></script>
<script src="{% static "vms/js/hide_resume_textbox.js" %}"></script>
</head>
Expand Down