vendor/uvdesk/core-framework/Resources/views/resetPassword.html.twig line 1

Open in your IDE?
  1. {% extends "@UVDeskCoreFramework//Templates//layout.html.twig" %}
  2. {% block title %}Reset Password{% endblock %}
  3. {% block templateCSS %}
  4. <style>
  5.     #loginForm h1 {
  6.         font-size: 28px;
  7.         color: #6F6F6F;
  8.         font-weight: 600;
  9.         margin: 0px 0px 10px 0px;
  10.     }
  11.     .forgot-password-cta {
  12.         position: absolute;
  13.         font-size: 15px !important;
  14.         right: 0px;
  15.         top: 0px;
  16.     }
  17. </style>
  18. {% endblock %}
  19. {% block pageWrapper %}
  20.     <div class="uv-large-box-plank">
  21.         <div class="uv-large-box-rt">
  22.             <div class="uv-center-box uv-text-center">
  23.                 <form action="" method="post" id="resetPasswordForm">
  24.                     <div class="uv-adjacent-center">
  25.                         <h1>{{ "Reset Password" |trans}}</h1>
  26.                         <p>{{ "Enter your new password below to update your login credentials" |trans}}</p>
  27.                         <div class="uv-adjacent-form">
  28.                             <div class="uv-adjacent-element-block">
  29.                                 <label>{{ "Password" |trans}}</label>
  30.                                 <div class="uv-max-field">
  31.                                     <input class="uv-field" type="password" name="password">
  32.                                 </div>
  33.                             </div>
  34.                             <div class="uv-adjacent-element-block">
  35.                                 <label>{{ "Confirm Password" |trans}}</label>
  36.                                 <div class="uv-max-field">
  37.                                     <input class="uv-field" type="password" name="confirmPassword">
  38.                                 </div>
  39.                             </div>
  40.                             <button class="uv-btn">{{ 'Save Password'|trans }}</button>
  41.                         </div>
  42.                     </div>
  43.                 </div>
  44.             </form>
  45.         </div>
  46.         <div class="uv-large-box-lt">
  47.             <div class="uv-center-box uv-text-center">
  48.                 <a href="https://www.uvdesk.com">
  49.                     <img alt="UVdesk" title="UVdesk" src="{{ asset('bundles/uvdeskcoreframework/images/uvdesk-logo-symbol.svg') }}">
  50.                 </a>
  51.             </div>
  52.         </div>
  53.     </div>
  54. {% endblock %}
  55. {% block footer %}
  56.     {{ parent() }}
  57.     <script type="text/javascript">
  58.         $(function () {
  59.             _.extend(Backbone.Validation.callbacks, {
  60.                 valid : function (view, attr, selector) {
  61.                     var $el = view.$('[name="' + attr + '"]');
  62.                     $el.removeClass('uv-field-error');
  63.                     $el.parents('.uv-adjacent-element-block').find('.uv-field-message').remove();
  64.                 },
  65.                 invalid : function (view, attr, error, selector) {
  66.                     var $el = view.$('[name="' + attr + '"]');
  67.                     $el.addClass('uv-field-error');
  68.                     $el.parents('.uv-adjacent-element-block').find('.uv-field-message').remove();
  69.                     $el.parents('.uv-adjacent-element-block').append("<span class='uv-field-message'>" + error + "</span>");
  70.                 }
  71.             });
  72.             var ResetPasswordModel = Backbone.Model.extend({
  73.                 validation: {
  74.                     'password': [{
  75.                         required: true,
  76.                         msg: '{{ "This field is mandatory"|trans }}'
  77.                         },{
  78.                         pattern: /^(?=(.*[a-zA-Z].*){2,})(?=.*\d.*)(?=.*\W.*)[a-zA-Z0-9\S]{8,}$/,
  79.                         msg: '{{ "Password must contain minimum 8 character length, at least two letters (not case sensitive), one number, one special character(space is not allowed)."|trans }}'
  80.                     }],
  81.                     'confirmPassword': [{
  82.                         required: true,
  83.                         msg: '{{"This field is mandatory"|trans }}'
  84.                     },{
  85.                         equalTo: 'password',
  86.                         msg: '{{ "The passwords does not match"|trans }}'
  87.                     }]
  88.                 }
  89.             });
  90.             var ResetPasswordForm = Backbone.View.extend({
  91.                 events: {
  92.                     'blur input': 'formChanegd',
  93.                     'click .uv-btn': 'submit'
  94.                 },
  95.                 initialize: function () {
  96.                     Backbone.Validation.bind(this);
  97.                     {% if error.messageKey is defined %}
  98.                         app.appView.renderResponseAlert({'alertClass': 'danger', 'alertMessage': "{{ error.messageKey }}"})
  99.                     {% endif %}
  100.                 },
  101.                 formChanegd: function(e) {
  102.                     this.model.set(Backbone.$(e.currentTarget).attr('name'), Backbone.$(e.currentTarget).val())
  103.                     this.model.isValid([Backbone.$(e.currentTarget).attr('name')])
  104.                 },
  105.                 submit: function (e) {
  106.                     e.preventDefault();
  107.                     var data = this.$el.serializeObject();
  108.                     this.model.set(data);
  109.                     if(this.model.isValid(true)){
  110.                         this.$el.submit();
  111.                     }
  112.                 }
  113.             });
  114.             var view = new ResetPasswordForm({
  115.                 el: '#resetPasswordForm',
  116.                 model: new ResetPasswordModel()
  117.             });
  118.         });
  119.     </script>
  120. {% endblock %}