vendor\uvdesk\core-framework\Resources\views\forgotPassword.html.twig line 1

Open in your IDE?
  1. {% extends "@UVDeskCoreFramework//Templates//layout.html.twig" %}
  2. {% block title %}Forgot Password{% endblock %}
  3. {% set recaptchaDetail = recaptcha_service.getRecaptchaDetails() %}
  4. {% block templateCSS %}
  5.     <style>
  6.         #loginForm h1 {
  7.             font-size: 28px;
  8.             color: #6F6F6F;
  9.             font-weight: 600;
  10.             margin: 0px 0px 10px 0px;
  11.         }
  12.         .forgot-password-cta {
  13.             position: absolute;
  14.             font-size: 15px !important;
  15.             right: 0px;
  16.             top: 0px;
  17.         }
  18.     </style>
  19. {% endblock %}
  20. {% block pageWrapper %}
  21.     <div class="uv-large-box-plank">
  22.         <div class="uv-large-box-rt">
  23.             <div class="uv-center-box uv-text-center">
  24.                 <form action="" method="post" id="loginForm">
  25.                     <div class="uv-adjacent-center">
  26.                         <h1>{{ "Forgot Password" |trans}}</h1>
  27.                         <div class="uv-element-block">
  28.                             <p>{{ "Enter your email address and we will send you an email with instructions to update your login credentials." |trans}}</p>
  29.                         </div>
  30.                         <div class="uv-adjacent-form">
  31.                             <div class="uv-adjacent-element-block">
  32.                                 <label>{{ "Email" |trans}}</label>
  33.                                 <div class="uv-max-field">
  34.                                     <input class="uv-field" type="email" name="forgot_password_form[email]">
  35.                                 </div>
  36.                             </div>
  37.                             <div class="uv-adjacent-element-block">
  38.                                 {% if recaptchaDetail and recaptchaDetail.isActive == true %}
  39.                                     <div class="clearfix"></div>
  40.                                     <div class="g-recaptcha" data-sitekey="{{ recaptchaDetail.siteKey }}"></div>
  41.                                     <div class="clearfix"></div>
  42.                                 {% else %}
  43.                                     <!-- Recaptcha will not support -->
  44.                                 {% endif %}
  45.                             </div>
  46.                             <button class="uv-btn">{{ 'Send Mail'|trans }}</button>
  47.                         </div>
  48.                     </div>
  49.                 </div>
  50.             </form>
  51.         </div>
  52.         <div class="uv-large-box-lt">
  53.             <div class="uv-center-box uv-text-center">
  54.                 <a href="https://www.uvdesk.com">
  55.                     <img alt="UVdesk" title="UVdesk" src="{{ asset('bundles/uvdeskcoreframework/images/uvdesk-logo-symbol.svg') }}">
  56.                 </a>
  57.             </div>
  58.         </div>
  59.     </div>
  60. {% endblock %}
  61. {% block footer %}
  62.     {{ parent() }}
  63.     
  64.     {% if recaptchaDetail and recaptchaDetail.isActive == true %}
  65.         <script src='https://www.google.com/recaptcha/api.js'></script>
  66.     {% endif %}
  67.     <script type="text/javascript">
  68.         $(function () {
  69.              _.extend(Backbone.Validation.callbacks, {
  70.                 valid : function (view, attr, selector) {
  71.                     var $el = view.$('[name="' + attr + '"]');
  72.                     $el.removeClass('uv-field-error');
  73.                     $el.parents('.uv-adjacent-element-block').find('.uv-field-message').remove();
  74.                 },
  75.                 invalid : function (view, attr, error, selector) {
  76.                     var $el = view.$('[name="' + attr + '"]');
  77.                     $el.addClass('uv-field-error');
  78.                     $el.parents('.uv-adjacent-element-block').find('.uv-field-message').remove();
  79.                     $el.parents('.uv-adjacent-element-block').append("<span class='uv-field-message'>" + error + "</span>");
  80.                 }
  81.             });
  82.             
  83.             var LoginModel = Backbone.Model.extend({
  84.                 validation: {
  85.                     'forgot_password_form[email]': [{
  86.                         required: true,
  87.                         msg: '{{ "This field is mandatory"|trans }}'
  88.                     },{
  89.                         pattern: 'email',
  90.                         msg: '{{ "This is not a valid email address"|trans }}'
  91.                     }],
  92.                     {% if recaptchaDetail and recaptchaDetail.isActive == true %}
  93.                         'g-recaptcha-response' : {
  94.                             fn: function(value) {
  95.                                 if(grecaptcha.getResponse().length > 0)
  96.                                     return false;
  97.                                 else
  98.                                     return true;
  99.                             },
  100.                             msg : '{{ "Please select CAPTCHA"|trans }}'
  101.                         }
  102.                     {% endif %}
  103.                 }
  104.             });
  105.             var LoginForm = Backbone.View.extend({
  106.                 el: 'form',
  107.                 events: {
  108.                     'blur input': 'formChanged',
  109.                     'click .uv-btn': 'submit'
  110.                 },
  111.                 initialize: function () {
  112.                     this.model = new LoginModel();
  113.                     Backbone.Validation.bind(this);
  114.                 },
  115.                 formChanged: function(e) {
  116.                     this.model.set(Backbone.$(e.currentTarget).attr('name'), Backbone.$(e.currentTarget).val())
  117.                     this.model.isValid([Backbone.$(e.currentTarget).attr('name')])
  118.                 },
  119.                 submit: function (e) {
  120.                     e.preventDefault();
  121.                     var data = this.$el.serializeObject();
  122.                     this.model.set(data);
  123.                     if(this.model.isValid(true)){
  124.                         this.$el.submit();
  125.                     }
  126.                 }
  127.             });
  128.             new LoginForm();
  129.         });
  130.     </script>
  131. {% endblock %}