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. {% 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="loginForm">
  24.                     <div class="uv-adjacent-center">
  25.                         <h1>{{ "Forgot Password" |trans}}</h1>
  26.                         <div class="uv-element-block">
  27.                             <p>{{ "Enter your email address and we will send you an email with instructions to update your login credentials." |trans}}</p>
  28.                         </div>
  29.                         <div class="uv-adjacent-form">
  30.                             <div class="uv-adjacent-element-block">
  31.                                 <label>{{ "Email" |trans}}</label>
  32.                                 <div class="uv-max-field">
  33.                                     <input class="uv-field" type="email" name="forgot_password_form[email]">
  34.                                 </div>
  35.                             </div>
  36.                             <button class="uv-btn">{{ 'Send Mail'|trans }}</button>
  37.                         </div>
  38.                     </div>
  39.                 </div>
  40.             </form>
  41.         </div>
  42.         <div class="uv-large-box-lt">
  43.             <div class="uv-center-box uv-text-center">
  44.                 <a href="https://www.uvdesk.com">
  45.                     <img alt="UVdesk" title="UVdesk" src="{{ asset('bundles/uvdeskcoreframework/images/uvdesk-logo-symbol.svg') }}">
  46.                 </a>
  47.             </div>
  48.         </div>
  49.     </div>
  50. {% endblock %}
  51. {% block footer %}
  52.     {{ parent() }}
  53.     <script type="text/javascript">
  54.         $(function () {
  55.              _.extend(Backbone.Validation.callbacks, {
  56.                 valid : function (view, attr, selector) {
  57.                     var $el = view.$('[name="' + attr + '"]');
  58.                     $el.removeClass('uv-field-error');
  59.                     $el.parents('.uv-adjacent-element-block').find('.uv-field-message').remove();
  60.                 },
  61.                 invalid : function (view, attr, error, selector) {
  62.                     var $el = view.$('[name="' + attr + '"]');
  63.                     $el.addClass('uv-field-error');
  64.                     $el.parents('.uv-adjacent-element-block').find('.uv-field-message').remove();
  65.                     $el.parents('.uv-adjacent-element-block').append("<span class='uv-field-message'>" + error + "</span>");
  66.                 }
  67.             });
  68.             
  69.             var LoginModel = Backbone.Model.extend({
  70.                 validation: {
  71.                     'forgot_password_form[email]': [{
  72.                         required: true,
  73.                         msg: '{{ "This field is mandatory"|trans }}'
  74.                     },{
  75.                         pattern: 'email',
  76.                         msg: '{{ "This is not a valid email address"|trans }}'
  77.                     }]
  78.                 }
  79.             });
  80.             var LoginForm = Backbone.View.extend({
  81.                 el: 'form',
  82.                 events: {
  83.                     'blur input': 'formChanged',
  84.                     'click .uv-btn': 'submit'
  85.                 },
  86.                 initialize: function () {
  87.                     this.model = new LoginModel();
  88.                     Backbone.Validation.bind(this);
  89.                 },
  90.                 formChanged: function(e) {
  91.                     this.model.set(Backbone.$(e.currentTarget).attr('name'), Backbone.$(e.currentTarget).val())
  92.                     this.model.isValid([Backbone.$(e.currentTarget).attr('name')])
  93.                 },
  94.                 submit: function (e) {
  95.                     e.preventDefault();
  96.                     var data = this.$el.serializeObject();
  97.                     this.model.set(data);
  98.                     if(this.model.isValid(true)){
  99.                         this.$el.submit();
  100.                     }
  101.                 }
  102.             });
  103.             new LoginForm();
  104.         });
  105.     </script>
  106. {% endblock %}