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. {% if recaptchaDetail and recaptchaDetail.isActive == true %}
  64. <script src='https://www.google.com/recaptcha/api.js'></script>
  65. {% endif %}
  66. <script type="text/javascript">
  67. $(function () {
  68. _.extend(Backbone.Validation.callbacks, {
  69. valid : function (view, attr, selector) {
  70. var $el = view.$('[name="' + attr + '"]');
  71. $el.removeClass('uv-field-error');
  72. $el.parents('.uv-adjacent-element-block').find('.uv-field-message').remove();
  73. },
  74. invalid : function (view, attr, error, selector) {
  75. var $el = view.$('[name="' + attr + '"]');
  76. $el.addClass('uv-field-error');
  77. $el.parents('.uv-adjacent-element-block').find('.uv-field-message').remove();
  78. $el.parents('.uv-adjacent-element-block').append("<span class='uv-field-message'>" + error + "</span>");
  79. }
  80. });
  81. var LoginModel = Backbone.Model.extend({
  82. validation: {
  83. 'forgot_password_form[email]': [{
  84. required: true,
  85. msg: '{{ "This field is mandatory"|trans }}'
  86. },{
  87. pattern: 'email',
  88. msg: '{{ "This is not a valid email address"|trans }}'
  89. }],
  90. {% if recaptchaDetail and recaptchaDetail.isActive == true %}
  91. 'g-recaptcha-response' : {
  92. fn: function(value) {
  93. if(grecaptcha.getResponse().length > 0)
  94. return false;
  95. else
  96. return true;
  97. },
  98. msg : '{{ "Please select CAPTCHA"|trans }}'
  99. }
  100. {% endif %}
  101. }
  102. });
  103. var LoginForm = Backbone.View.extend({
  104. el: 'form',
  105. events: {
  106. 'blur input': 'formChanged',
  107. 'click .uv-btn': 'submit'
  108. },
  109. initialize: function () {
  110. this.model = new LoginModel();
  111. Backbone.Validation.bind(this);
  112. },
  113. formChanged: function(e) {
  114. this.model.set(Backbone.$(e.currentTarget).attr('name'), Backbone.$(e.currentTarget).val())
  115. this.model.isValid([Backbone.$(e.currentTarget).attr('name')])
  116. },
  117. submit: function (e) {
  118. e.preventDefault();
  119. var data = this.$el.serializeObject();
  120. this.model.set(data);
  121. if(this.model.isValid(true)){
  122. this.$el.submit();
  123. }
  124. }
  125. });
  126. new LoginForm();
  127. });
  128. </script>
  129. {% endblock %}