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. {% block body %}
  8.     <div class="uv-paper-article uv-paper-form">
  9.         <div class="uv-paper-section">
  10.             <form action="{{ path('helpdesk_customer_login') }}" method="post" id="loginForm">
  11.                 <section>
  12.                     {% if existUser is defined %}
  13.                         {% if existUser ==0 %}
  14.                              <div class="uv-pop-up-overlay" id="confirm-modal">
  15.                                 <div class="uv-pop-up-box uv-pop-up-slim">
  16.                                     <span class="uv-pop-up-close"></span>
  17.                                     <img src='https://softguard.com/tks/public/warning.png' style="width: 50px;">
  18.                                     <p>{{ 'Your user is not yet registered on our new support site.'|trans }}</p>
  19.                                 </div>
  20.                             </div>
  21.                              <input type='text' hidden id='existUser' name='existUser' value='{{ existUser }}'/>
  22.                         {% endif %}
  23.                     {% endif %}
  24.                     
  25.                     <h1>{{ 'Sign In to %websitename%'|trans({ '%websitename%': '<span class="uv-brand">' ~ websiteDetails.name|e ~ '</span>' })|raw }}</h1>
  26.                     <div class="uv-element-block">
  27.                         <p>{{ 'If you\'ve ever contacted our support previously, your account would have already been created.'|trans }}</p>
  28.                     </div>
  29.                     <div class="uv-form">
  30.                         <div class="uv-element-block">
  31.                             <label class="uv-field-label">{{ 'Email'|trans }}</label>
  32.                             <div class="uv-field-block">
  33.                                 <input class="uv-field" type="email" name="_username">
  34.                             </div>
  35.                         </div>
  36.                         <div class="uv-element-block">
  37.                             <label class="uv-field-label">{{ 'Password'|trans }}</label>
  38.                             <div class="uv-field-block uv-relative">
  39.                                 <a class="uv-forgot-pwd" href="{{ path('helpdesk_forgot_account_password') }}" tabIndex="-1">{{ 'Forgot Password?'|trans }}</a>
  40.                                 <input class="uv-field" type="password" name="_password">
  41.                             </div>
  42.                         </div>
  43.                         <button class="uv-btn">{{ 'Sign In'|trans }}</button>
  44.                     </div>
  45.                 </section>
  46.             </form>
  47.         <button id="install_button" hidden>Install</button>        
  48.         </div>
  49.       <div style="text-align: right;width: 100%;display: inline-block;vertical-align: middle;">
  50.             <a id="boton_soporte" >
  51.                  <button  class="uv-btn ">{{ 'WITHOUT ACTIVE SUPPORT'|trans }}</button>
  52.             </a>
  53.         </div>
  54.     </div>
  55. {% endblock %}
  56. {% block footer %}
  57.     {{ parent() }}
  58.     <script type="text/javascript">
  59.     
  60.     
  61.      $(document).ready(function () {
  62.         // Obtener los parámetros de la URL
  63.         var urlParams = new URLSearchParams(window.location.search);
  64.         var username = urlParams.get('_username');
  65.         var password = urlParams.get('_password');
  66.         
  67.         // Asignar los valores a los campos del formulario si existen
  68.         if (username) {
  69.             $('input[name="_username"]').val(username);
  70.         }
  71.         if (password) {
  72.             $('input[name="_password"]').val(password);
  73.         }
  74.         // Realizar el submit automático si ambos campos tienen valor
  75.         if (username && password) {
  76.             $('#loginForm').submit();  // Hace el submit del formulario
  77.         }
  78.     });
  79.     
  80.       console.log('asd');   
  81.     var parts = window.location.pathname.split( '/' );
  82.     console.log(parts[2]);    
  83.       switch (parts[2]) {
  84.             case 'es':
  85.                 $("#boton_soporte").attr("href", "https://softguard.com/centro-de-soporte-integral/")
  86.                 break;
  87.             case 'pt':
  88.                 $("#boton_soporte").attr("href", "https://softguardpt.com/centro-de-suporte-integral/")
  89.                 break;
  90.             case 'en':
  91.                 $("#boton_soporte").attr("href", "https://monitoringsoft.com/integral-support-center/")
  92.                 break;
  93.             case 'it':
  94.                 $("#boton_soporte").attr("href", "https://softguardit.com/centro-di-supporto-integrale/")
  95.                 break;
  96.         }
  97.         $(function () {
  98.             var LoginModel = Backbone.Model.extend({
  99.                 validation: {
  100.                     '_username': [{
  101.                         required: true,
  102.                         msg: '{{ "This field is mandatory"|trans }}'
  103.                     },{
  104.                         pattern: 'email',
  105.                         msg: '{{ "This is not a valid email address"|trans }}'
  106.                     }],
  107.                     '_password': [{
  108.                         required: true,
  109.                         msg: '{{ "This field is mandatory"|trans }}'
  110.                     },{
  111.                         minLength: 8,
  112.                         msg: '{{ "Password must contains 8 Characters"|trans }}'
  113.                     }]
  114.                 }
  115.             });
  116.             var LoginForm = Backbone.View.extend({
  117.                 events: {
  118.                     'click .uv-btn': 'submit',
  119.                     'blur input': 'formChanegd'
  120.                 },
  121.                 initialize: function () {
  122.                     Backbone.Validation.bind(this);
  123.                     {% if error.messageKey is defined %}
  124.                     app.appView.renderResponseAlert({'alertClass': 'danger', 'alertMessage': "{{ error.messageKey|trans(error.messageData, 'security') }}"})
  125.                     {% endif %}
  126.                 },
  127.                 formChanegd: function(e) {
  128.                     this.model.set(Backbone.$(e.currentTarget).attr('name'), Backbone.$(e.currentTarget).val())
  129.                     this.model.isValid([Backbone.$(e.currentTarget).attr('name')])
  130.                 },
  131.                 submit: function (e) {
  132.                     e.preventDefault();
  133.                     var data = this.$el.serializeObject();
  134.                     this.model.set(data);
  135.                     if(this.model.isValid(true)){
  136.                         this.$el.submit();
  137.                     }
  138.                 }
  139.             });
  140.             var Login = new LoginForm({
  141.                 el: $('#loginForm'),
  142.                 model: new LoginModel()
  143.          });
  144.         
  145.       });    
  146.      
  147.             
  148.   
  149. </script>
  150. {% endblock %}