|
@@ -1,32 +1,39 @@ |
|
|
{% extends "templates/web.html" %} |
|
|
{% extends "templates/web.html" %} |
|
|
|
|
|
|
|
|
{% block title %} {{_("Reset Password")}} {% endblock %} |
|
|
{% block title %} {{_("Reset Password")}} {% endblock %} |
|
|
|
|
|
|
|
|
|
|
|
{% block head_include %} |
|
|
|
|
|
{{ include_style('login.bundle.css') }} |
|
|
|
|
|
{% endblock %} |
|
|
{% block page_content %} |
|
|
{% block page_content %} |
|
|
|
|
|
|
|
|
<div class="page-card"> |
|
|
|
|
|
<div class='page-card-head'> |
|
|
|
|
|
<span class='indicator blue password-box'>{{ _("Reset Password") if frappe.db.get_default('company') else _("Set Password")}}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<form id="reset-password"> |
|
|
|
|
|
<div class="form-group" style="display: none;"> |
|
|
|
|
|
<input id="old_password" type="password" |
|
|
|
|
|
class="form-control" placeholder="{{ _("Old Password") }}"> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="form-group"> |
|
|
|
|
|
<input id="new_password" type="password" |
|
|
|
|
|
class="form-control" placeholder="{{ _("New Password") }}"> |
|
|
|
|
|
<span class="password-strength-indicator indicator"></span> |
|
|
|
|
|
|
|
|
<div class="for-reset-password"> |
|
|
|
|
|
<div class="page-card"> |
|
|
|
|
|
<div class='page-card-head text-center'> |
|
|
|
|
|
<h4 class="reset-password-heading">{{ _("Reset Password") if frappe.db.get_default('company') else _("Set Password")}}</h4> |
|
|
</div> |
|
|
</div> |
|
|
<p class='password-strength-message text-muted small hidden'></p> |
|
|
|
|
|
<button type="submit" id="update" |
|
|
|
|
|
class="btn btn-primary">{{_("Update")}}</button> |
|
|
|
|
|
</form> |
|
|
|
|
|
|
|
|
<form id="reset-password"> |
|
|
|
|
|
<div class="form-group" style="display: none;"> |
|
|
|
|
|
<input id="old_password" type="password" |
|
|
|
|
|
class="form-control" placeholder="{{ _("Old Password") }}"> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="form-group"> |
|
|
|
|
|
<input id="new_password" type="password" |
|
|
|
|
|
class="form-control" placeholder="{{ _("New Password") }}"> |
|
|
|
|
|
<span class="password-strength-indicator indicator"></span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<p class='password-strength-message text-muted small hidden'></p> |
|
|
|
|
|
<button type="submit" id="update" |
|
|
|
|
|
class="btn btn-primary btn-block btn-update">{{_("Confirm")}}</button> |
|
|
|
|
|
</form> |
|
|
|
|
|
{%- if not disable_signup -%} |
|
|
|
|
|
<div class="text-center sign-up-message"> |
|
|
|
|
|
{{ _("Don't have an account?") }} |
|
|
|
|
|
<a href="/login#signup">{{ _("Sign up") }}</a> |
|
|
|
|
|
</div> |
|
|
|
|
|
{%- endif -%} |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<style> |
|
|
<style> |
|
|
.hero-and-content { |
|
|
|
|
|
background-color: #f5f7fa; |
|
|
|
|
|
} |
|
|
|
|
|
</style> |
|
|
</style> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
@@ -69,20 +76,19 @@ frappe.ready(function() { |
|
|
args: args, |
|
|
args: args, |
|
|
statusCode: { |
|
|
statusCode: { |
|
|
401: function() { |
|
|
401: function() { |
|
|
$(".page-card-head .indicator").removeClass().addClass("indicator red").text(__("Invalid Password")); |
|
|
|
|
|
|
|
|
$(".page-card-head .reset-password-heading").text(__("Invalid Password")); |
|
|
}, |
|
|
}, |
|
|
410: function({ responseJSON }) { |
|
|
410: function({ responseJSON }) { |
|
|
const title = __("Invalid Link"); |
|
|
const title = __("Invalid Link"); |
|
|
const message = responseJSON.message; |
|
|
const message = responseJSON.message; |
|
|
$(".page-card-head .indicator").removeClass().addClass("indicator grey").text(title); |
|
|
|
|
|
|
|
|
$(".page-card-head .reset-password-heading").text(title); |
|
|
frappe.msgprint({ title: title, message: message, clear: true }); |
|
|
frappe.msgprint({ title: title, message: message, clear: true }); |
|
|
}, |
|
|
}, |
|
|
200: function(r) { |
|
|
200: function(r) { |
|
|
$("input").val(""); |
|
|
$("input").val(""); |
|
|
strength_indicator.addClass("hidden"); |
|
|
strength_indicator.addClass("hidden"); |
|
|
strength_message.addClass("hidden"); |
|
|
strength_message.addClass("hidden"); |
|
|
$(".page-card-head .indicator") |
|
|
|
|
|
.removeClass().addClass("indicator blue") |
|
|
|
|
|
|
|
|
$(".page-card-head .reset-password-heading") |
|
|
.html(__("Status Updated")); |
|
|
.html(__("Status Updated")); |
|
|
if(r.message) { |
|
|
if(r.message) { |
|
|
frappe.msgprint({ |
|
|
frappe.msgprint({ |
|
@@ -132,7 +138,7 @@ frappe.ready(function() { |
|
|
}, |
|
|
}, |
|
|
statusCode: { |
|
|
statusCode: { |
|
|
401: function() { |
|
|
401: function() { |
|
|
$('.page-card-head .indicator').removeClass().addClass('indicator red') |
|
|
|
|
|
|
|
|
$('.page-card-head .reset-password-heading') |
|
|
.text("{{ _('Invalid Password') }}"); |
|
|
.text("{{ _('Invalid Password') }}"); |
|
|
}, |
|
|
}, |
|
|
200: function(r) { |
|
|
200: function(r) { |
|
@@ -175,7 +181,7 @@ frappe.ready(function() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
strength_indicator.removeClass().addClass('password-strength-indicator indicator ' + color); |
|
|
|
|
|
|
|
|
// strength_indicator.removeClass().addClass('password-strength-indicator indicator ' + color); |
|
|
strength_message.html(message.join(' ') || '').removeClass('hidden'); |
|
|
strength_message.html(message.join(' ') || '').removeClass('hidden'); |
|
|
// strength_indicator.attr('title', message.join(' ') || ''); |
|
|
// strength_indicator.attr('title', message.join(' ') || ''); |
|
|
} |
|
|
} |
|
|