vendor/uvdesk/support-center-bundle/Resources/views/Knowledgebase/login.html.twig line 1

Open in your IDE?
  1. {% extends "@UVDeskSupportCenter/Templates/layout.html.twig" %}
  2. {% block title %}{{ 'Customer Login'|trans }}{% endblock %}
  3. {% block ogtitle %}{{ 'Customer Login'|trans }}{% endblock %}
  4. {% block twtitle %}{{ 'Customer Login'|trans }}{% endblock %}
  5. {% block metaDescription %}{% trans %}customer.login.metaDescription{% endtrans %}{% endblock %}
  6. {% block metaKeywords %}{% trans %}customer.login.metaKeywords{% endtrans %}{% endblock %}
  7. {% set recaptchaDetail = recaptcha_service.getRecaptchaDetails() %}
  8. {% block body %}
  9.     <div class="uv-paper-article uv-paper-form">
  10.         <div class="uv-paper-section">
  11.             <form action="{{ path('helpdesk_customer_login') }}" method="post" id="loginForm">
  12.                 <section>
  13.                     <h1>{{ 'Sign In to %websitename%'|trans({ '%websitename%': '<span class="uv-brand">' ~ websiteDetails.name|e ~ '</span>' })|raw }}</h1>
  14.                     <div class="uv-element-block">
  15.                         <p>{{ 'If you have ever contacted our support previously, your account would have already been created.'|trans }}</p>
  16.                     </div>
  17.                     <div class="uv-form">
  18.                         <div class="uv-element-block">
  19.                             <label class="uv-field-label">{{ 'Email'|trans }}</label>
  20.                             <div class="uv-field-block">
  21.                                 <input class="uv-field" type="email" name="_username">
  22.                             </div>
  23.                         </div>
  24.                         <div class="uv-element-block">
  25.                             <label class="uv-field-label">{{ 'Password'|trans }}</label>
  26.                             <div class="uv-field-block uv-relative">
  27.                                 <a class="uv-forgot-pwd" href="{{ path('helpdesk_forgot_account_password') }}" tabIndex="-1">{{ 'Forgot Password?'|trans }}</a>
  28.                                 <input class="uv-field" type="password" name="_password">
  29.                             </div>
  30.                         </div>
  31.                         {% if recaptchaDetail and recaptchaDetail.isActive == true %}
  32.                             <div class="clearfix"></div>
  33.                             <div class="g-recaptcha" data-sitekey="{{ recaptchaDetail.siteKey }}"></div>
  34.                             <div class="clearfix"></div>
  35.                         {% else %}
  36.                             <!-- Recaptcha will not support -->
  37.                         {% endif %}
  38.                         <button class="uv-btn">{{ 'Sign In'|trans }}</button>
  39.                     </div>
  40.                 </section>
  41.             </form>
  42.         </div>
  43.     </div>
  44. {% endblock %}
  45. {% block footer %}
  46.     {{ parent() }}
  47.     {% if recaptchaDetail and recaptchaDetail.isActive == true %}
  48.         <script src='https://www.google.com/recaptcha/api.js'></script>
  49.     {% endif %}
  50.     <script type="text/javascript">
  51.         $(function () {
  52.             var LoginModel = Backbone.Model.extend({
  53.                 validation: {
  54.                     '_username': [{
  55.                         required: true,
  56.                         msg: '{{ "This field is mandatory"|trans }}'
  57.                     },{
  58.                         pattern: 'email',
  59.                         msg: '{{ "This is not a valid email address"|trans }}'
  60.                     }],
  61.                     '_password': [{
  62.                         required: true,
  63.                         msg: '{{ "This field is mandatory"|trans }}'
  64.                     },{
  65.                         minLength: 8,
  66.                         msg: '{{ "Password must contains 8 Characters"|trans }}'
  67.                     }],
  68.                     {% if recaptchaDetail and recaptchaDetail.isActive == true %}
  69.                         'g-recaptcha-response' : {
  70.                             fn: function(value) {
  71.                                 if(grecaptcha.getResponse().length > 0)
  72.                                     return false;
  73.                                 else
  74.                                     return true;
  75.                             },
  76.                             msg : '{{ "Please select CAPTCHA"|trans }}'
  77.                         }
  78.                     {% endif %}
  79.                 }
  80.             });
  81.             var LoginForm = Backbone.View.extend({
  82.                 events: {
  83.                     'click .uv-btn': 'submit',
  84.                     'blur input': 'formChanegd'
  85.                 },
  86.                 initialize: function () {
  87.                     Backbone.Validation.bind(this);
  88.                     {% if error.messageKey is defined %}
  89.                         app.appView.renderResponseAlert({'alertClass': 'danger', 'alertMessage': '{{ error.messageKey|trans}}'})
  90.                     {% endif %}
  91.                 },
  92.                 formChanegd: function(e) {
  93.                     this.model.set(Backbone.$(e.currentTarget).attr('name'), Backbone.$(e.currentTarget).val())
  94.                     this.model.isValid([Backbone.$(e.currentTarget).attr('name')])
  95.                 },
  96.                 submit: function (e) {
  97.                     e.preventDefault();
  98.                     var data = this.$el.serializeObject();
  99.                     this.model.set(data);
  100.                     if(this.model.isValid(true)){
  101.                         this.$el.submit();
  102.                     }
  103.                 }
  104.             });
  105.             var Login = new LoginForm({
  106.                 el: $('#loginForm'),
  107.                 model: new LoginModel()
  108.             });
  109.         });
  110.     </script>
  111. {% endblock %}