var/cache/dev/twig/b9/b93722bdabbb617b66c6513b0474ab11.php line 56

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* @UVDeskCoreFramework//login.html.twig */
  16. class __TwigTemplate_a7ddc261950306e77d773125b021762a extends Template
  17. {
  18. private Source $source;
  19. /**
  20. * @var array<string, Template>
  21. */
  22. private array $macros = [];
  23. public function __construct(Environment $env)
  24. {
  25. parent::__construct($env);
  26. $this->source = $this->getSourceContext();
  27. $this->blocks = [
  28. 'title' => [$this, 'block_title'],
  29. 'templateCSS' => [$this, 'block_templateCSS'],
  30. 'pageWrapper' => [$this, 'block_pageWrapper'],
  31. 'footer' => [$this, 'block_footer'],
  32. ];
  33. }
  34. protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  35. {
  36. // line 1
  37. return "@UVDeskCoreFramework//Templates//layout.html.twig";
  38. }
  39. protected function doDisplay(array $context, array $blocks = [])
  40. {
  41. $macros = $this->macros;
  42. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  43. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@UVDeskCoreFramework//login.html.twig"));
  44. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  45. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@UVDeskCoreFramework//login.html.twig"));
  46. // line 5
  47. $context["recaptchaDetail"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["recaptcha_service"]) || array_key_exists("recaptcha_service", $context) ? $context["recaptcha_service"] : (function () { throw new RuntimeError('Variable "recaptcha_service" does not exist.', 5, $this->source); })()), "getRecaptchaDetails", [], "method", false, false, false, 5);
  48. // line 1
  49. $this->parent = $this->loadTemplate("@UVDeskCoreFramework//Templates//layout.html.twig", "@UVDeskCoreFramework//login.html.twig", 1);
  50. yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
  51. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  52. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  53. }
  54. // line 3
  55. public function block_title($context, array $blocks = [])
  56. {
  57. $macros = $this->macros;
  58. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  59. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
  60. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  61. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
  62. yield "Login";
  63. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  64. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  65. return; yield '';
  66. }
  67. // line 7
  68. public function block_templateCSS($context, array $blocks = [])
  69. {
  70. $macros = $this->macros;
  71. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  72. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "templateCSS"));
  73. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  74. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "templateCSS"));
  75. // line 8
  76. yield "<style>
  77. #loginForm h1 {
  78. font-size: 28px;
  79. color: #6F6F6F;
  80. font-weight: 600;
  81. margin: 0px 0px 10px 0px;
  82. }
  83. .forgot-password-cta {
  84. position: absolute;
  85. font-size: 15px !important;
  86. right: 0px;
  87. top: 0px;
  88. }
  89. </style>
  90. ";
  91. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  92. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  93. return; yield '';
  94. }
  95. // line 25
  96. public function block_pageWrapper($context, array $blocks = [])
  97. {
  98. $macros = $this->macros;
  99. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  100. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "pageWrapper"));
  101. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  102. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "pageWrapper"));
  103. // line 26
  104. yield " <div class=\"uv-large-box-plank\">
  105. \t\t<div class=\"uv-large-box-rt\">
  106. \t\t\t<div class=\"uv-center-box uv-text-center\">
  107. <form action=\"\" method=\"post\" id=\"loginForm\">
  108. <div class=\"uv-adjacent-center\">
  109. <h1>";
  110. // line 31
  111. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Log in to your"), "html", null, true);
  112. yield " <span class=\"uv-brand\">";
  113. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["website"]) || array_key_exists("website", $context) ? $context["website"] : (function () { throw new RuntimeError('Variable "website" does not exist.', 31, $this->source); })()), "name", [], "any", false, false, false, 31), "html", null, true);
  114. yield "</span></h1>
  115. <p>";
  116. // line 32
  117. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Enter your credentials below to gain access to your helpdesk account."), "html", null, true);
  118. yield "</p>
  119. <div class=\"uv-adjacent-form\">
  120. <div class=\"uv-adjacent-element-block\">
  121. <label>";
  122. // line 35
  123. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Email"), "html", null, true);
  124. yield "</label>
  125. <div class=\"uv-max-field\">
  126. <input type=\"email\" name=\"_username\">
  127. </div>
  128. </div>
  129. <div class=\"uv-adjacent-element-block\" style=\"position: relative;\">
  130. <label>";
  131. // line 41
  132. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Password"), "html", null, true);
  133. yield "</label>
  134. <div class=\"uv-max-field\">
  135. <a class=\"forgot-password-cta\" href=\"";
  136. // line 43
  137. yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("helpdesk_forgot_account_password");
  138. yield "\" tabindex=\"-1\">";
  139. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Forgot Password?"), "html", null, true);
  140. yield "</a>
  141. <input type=\"password\" name=\"_password\">
  142. </div>
  143. </div>
  144. <div class=\"uv-adjacent-element-block\">
  145. <label>
  146. <div class=\"uv-checkbox\">
  147. <input type=\"checkbox\" name=\"_remember_me\" checked>
  148. <span class=\"uv-checkbox-view\"></span>
  149. </div>
  150. <span class=\"uv-checkbox-label\">";
  151. // line 54
  152. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Keep me logged in"), "html", null, true);
  153. yield "</span>
  154. </label>
  155. </div>
  156. <div class=\"uv-adjacent-element-block\">
  157. ";
  158. // line 58
  159. if (((isset($context["recaptchaDetail"]) || array_key_exists("recaptchaDetail", $context) ? $context["recaptchaDetail"] : (function () { throw new RuntimeError('Variable "recaptchaDetail" does not exist.', 58, $this->source); })()) && (CoreExtension::getAttribute($this->env, $this->source, (isset($context["recaptchaDetail"]) || array_key_exists("recaptchaDetail", $context) ? $context["recaptchaDetail"] : (function () { throw new RuntimeError('Variable "recaptchaDetail" does not exist.', 58, $this->source); })()), "isActive", [], "any", false, false, false, 58) == true))) {
  160. // line 59
  161. yield " <div class=\"clearfix\"></div>
  162. <div class=\"g-recaptcha\" data-sitekey=\"";
  163. // line 60
  164. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["recaptchaDetail"]) || array_key_exists("recaptchaDetail", $context) ? $context["recaptchaDetail"] : (function () { throw new RuntimeError('Variable "recaptchaDetail" does not exist.', 60, $this->source); })()), "siteKey", [], "any", false, false, false, 60), "html", null, true);
  165. yield "\"></div>
  166. <div class=\"clearfix\"></div>
  167. ";
  168. } else {
  169. // line 63
  170. yield " <!-- Recaptcha will not support -->
  171. ";
  172. }
  173. // line 65
  174. yield " </div>
  175. <button class=\"uv-btn\">";
  176. // line 66
  177. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Sign In"), "html", null, true);
  178. yield "</button>
  179. </div>
  180. </div>
  181. </div>
  182. </form>
  183. \t\t</div>
  184. \t\t<div class=\"uv-large-box-lt\">
  185. \t\t\t<div class=\"uv-center-box uv-text-center\">
  186. \t\t\t\t<a href=\"https://www.uvdesk.com\">
  187. <img alt=\"UVdesk\" title=\"UVdesk\" src=\"";
  188. // line 76
  189. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("bundles/uvdeskcoreframework/images/uvdesk-logo-symbol.svg"), "html", null, true);
  190. yield "\">
  191. \t\t\t\t</a>
  192. </div>
  193. \t\t</div>
  194. \t</div>
  195. ";
  196. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  197. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  198. return; yield '';
  199. }
  200. // line 83
  201. public function block_footer($context, array $blocks = [])
  202. {
  203. $macros = $this->macros;
  204. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  205. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "footer"));
  206. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  207. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "footer"));
  208. // line 84
  209. yield " ";
  210. yield from $this->yieldParentBlock("footer", $context, $blocks);
  211. yield "
  212. ";
  213. // line 86
  214. if (((isset($context["recaptchaDetail"]) || array_key_exists("recaptchaDetail", $context) ? $context["recaptchaDetail"] : (function () { throw new RuntimeError('Variable "recaptchaDetail" does not exist.', 86, $this->source); })()) && (CoreExtension::getAttribute($this->env, $this->source, (isset($context["recaptchaDetail"]) || array_key_exists("recaptchaDetail", $context) ? $context["recaptchaDetail"] : (function () { throw new RuntimeError('Variable "recaptchaDetail" does not exist.', 86, $this->source); })()), "isActive", [], "any", false, false, false, 86) == true))) {
  215. // line 87
  216. yield " <script src='https://www.google.com/recaptcha/api.js'></script>
  217. ";
  218. }
  219. // line 89
  220. yield "
  221. <script type=\"text/javascript\">
  222. \$(function () {
  223. _.extend(Backbone.Validation.callbacks, {
  224. valid : function (view, attr, selector) {
  225. var \$el = view.\$('[name=\"' + attr + '\"]');
  226. \$el.removeClass('uv-field-error');
  227. \$el.parents('.uv-adjacent-element-block').find('.uv-field-message').remove();
  228. },
  229. invalid : function (view, attr, error, selector) {
  230. var \$el = view.\$('[name=\"' + attr + '\"]');
  231. \$el.addClass('uv-field-error');
  232. \$el.parents('.uv-adjacent-element-block').find('.uv-field-message').remove();
  233. \$el.parents('.uv-adjacent-element-block').append(\"<span class='uv-field-message'>\" + error + \"</span>\");
  234. }
  235. });
  236. var LoginModel = Backbone.Model.extend({
  237. validation: {
  238. '_username': [{
  239. required: true,
  240. msg: '";
  241. // line 110
  242. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html", null, true);
  243. yield "'
  244. },{
  245. pattern: 'email',
  246. msg: '";
  247. // line 113
  248. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This is not a valid email address"), "html", null, true);
  249. yield "'
  250. }],
  251. '_password': [{
  252. required: true,
  253. msg: '";
  254. // line 117
  255. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html", null, true);
  256. yield "'
  257. },{
  258. minLength: 8,
  259. msg: '";
  260. // line 120
  261. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Password must contains 8 Characters"), "html", null, true);
  262. yield "'
  263. }],
  264. ";
  265. // line 122
  266. if (((isset($context["recaptchaDetail"]) || array_key_exists("recaptchaDetail", $context) ? $context["recaptchaDetail"] : (function () { throw new RuntimeError('Variable "recaptchaDetail" does not exist.', 122, $this->source); })()) && (CoreExtension::getAttribute($this->env, $this->source, (isset($context["recaptchaDetail"]) || array_key_exists("recaptchaDetail", $context) ? $context["recaptchaDetail"] : (function () { throw new RuntimeError('Variable "recaptchaDetail" does not exist.', 122, $this->source); })()), "isActive", [], "any", false, false, false, 122) == true))) {
  267. // line 123
  268. yield " 'g-recaptcha-response' : {
  269. fn: function(value) {
  270. if(grecaptcha.getResponse().length > 0)
  271. return false;
  272. else
  273. return true;
  274. },
  275. msg : '";
  276. // line 130
  277. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Please select CAPTCHA"), "html", null, true);
  278. yield "'
  279. }
  280. \t\t\t\t ";
  281. }
  282. // line 133
  283. yield " }
  284. });
  285. var LoginForm = Backbone.View.extend({
  286. events: {
  287. 'click .uv-btn': 'submit',
  288. 'blur input': 'formChanegd'
  289. },
  290. initialize: function () {
  291. Backbone.Validation.bind(this);
  292. ";
  293. // line 143
  294. if (CoreExtension::getAttribute($this->env, $this->source, ($context["error"] ?? null), "messageKey", [], "any", true, true, false, 143)) {
  295. // line 144
  296. yield " app.appView.renderResponseAlert({'alertClass': 'danger', 'alertMessage': '";
  297. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(CoreExtension::getAttribute($this->env, $this->source, (isset($context["error"]) || array_key_exists("error", $context) ? $context["error"] : (function () { throw new RuntimeError('Variable "error" does not exist.', 144, $this->source); })()), "messageKey", [], "any", false, false, false, 144)), "html", null, true);
  298. yield "'})
  299. ";
  300. }
  301. // line 146
  302. yield " },
  303. formChanegd: function(e) {
  304. \t\t\t \tthis.model.set(Backbone.\$(e.currentTarget).attr('name'), Backbone.\$(e.currentTarget).val())
  305. \t\t\t \tthis.model.isValid([Backbone.\$(e.currentTarget).attr('name')])
  306. \t\t\t },
  307. submit: function (e) {
  308. e.preventDefault();
  309. var data = this.\$el.serializeObject();
  310. this.model.set(data);
  311. if(this.model.isValid(true)){
  312. this.\$el.submit();
  313. }
  314. }
  315. });
  316. var Login = new LoginForm({
  317. \t\t el: \$('#loginForm'),
  318. \t\t model: new LoginModel()
  319. \t\t });
  320. });
  321. </script>
  322. ";
  323. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  324. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  325. return; yield '';
  326. }
  327. /**
  328. * @codeCoverageIgnore
  329. */
  330. public function getTemplateName(): string
  331. {
  332. return "@UVDeskCoreFramework//login.html.twig";
  333. }
  334. /**
  335. * @codeCoverageIgnore
  336. */
  337. public function isTraitable(): bool
  338. {
  339. return false;
  340. }
  341. /**
  342. * @codeCoverageIgnore
  343. */
  344. public function getDebugInfo(): array
  345. {
  346. return array ( 345 => 146, 339 => 144, 337 => 143, 325 => 133, 319 => 130, 310 => 123, 308 => 122, 303 => 120, 297 => 117, 290 => 113, 284 => 110, 261 => 89, 257 => 87, 255 => 86, 249 => 84, 239 => 83, 222 => 76, 209 => 66, 206 => 65, 202 => 63, 196 => 60, 193 => 59, 191 => 58, 184 => 54, 168 => 43, 163 => 41, 154 => 35, 148 => 32, 142 => 31, 135 => 26, 125 => 25, 99 => 8, 89 => 7, 69 => 3, 58 => 1, 56 => 5, 43 => 1,);
  347. }
  348. public function getSourceContext(): Source
  349. {
  350. return new Source("{% extends \"@UVDeskCoreFramework//Templates//layout.html.twig\" %}
  351. {% block title %}Login{% endblock %}
  352. {% set recaptchaDetail = recaptcha_service.getRecaptchaDetails() %}
  353. {% block templateCSS %}
  354. <style>
  355. #loginForm h1 {
  356. font-size: 28px;
  357. color: #6F6F6F;
  358. font-weight: 600;
  359. margin: 0px 0px 10px 0px;
  360. }
  361. .forgot-password-cta {
  362. position: absolute;
  363. font-size: 15px !important;
  364. right: 0px;
  365. top: 0px;
  366. }
  367. </style>
  368. {% endblock %}
  369. {% block pageWrapper %}
  370. <div class=\"uv-large-box-plank\">
  371. \t\t<div class=\"uv-large-box-rt\">
  372. \t\t\t<div class=\"uv-center-box uv-text-center\">
  373. <form action=\"\" method=\"post\" id=\"loginForm\">
  374. <div class=\"uv-adjacent-center\">
  375. <h1>{{ \"Log in to your\"|trans }} <span class=\"uv-brand\">{{ website.name }}</span></h1>
  376. <p>{{ \"Enter your credentials below to gain access to your helpdesk account.\"|trans }}</p>
  377. <div class=\"uv-adjacent-form\">
  378. <div class=\"uv-adjacent-element-block\">
  379. <label>{{ \"Email\" |trans}}</label>
  380. <div class=\"uv-max-field\">
  381. <input type=\"email\" name=\"_username\">
  382. </div>
  383. </div>
  384. <div class=\"uv-adjacent-element-block\" style=\"position: relative;\">
  385. <label>{{ \"Password\" |trans}}</label>
  386. <div class=\"uv-max-field\">
  387. <a class=\"forgot-password-cta\" href=\"{{ path('helpdesk_forgot_account_password') }}\" tabindex=\"-1\">{{ \"Forgot Password?\" |trans}}</a>
  388. <input type=\"password\" name=\"_password\">
  389. </div>
  390. </div>
  391. <div class=\"uv-adjacent-element-block\">
  392. <label>
  393. <div class=\"uv-checkbox\">
  394. <input type=\"checkbox\" name=\"_remember_me\" checked>
  395. <span class=\"uv-checkbox-view\"></span>
  396. </div>
  397. <span class=\"uv-checkbox-label\">{{ \"Keep me logged in\" |trans}}</span>
  398. </label>
  399. </div>
  400. <div class=\"uv-adjacent-element-block\">
  401. {% if recaptchaDetail and recaptchaDetail.isActive == true %}
  402. <div class=\"clearfix\"></div>
  403. <div class=\"g-recaptcha\" data-sitekey=\"{{ recaptchaDetail.siteKey }}\"></div>
  404. <div class=\"clearfix\"></div>
  405. {% else %}
  406. <!-- Recaptcha will not support -->
  407. {% endif %}
  408. </div>
  409. <button class=\"uv-btn\">{{ 'Sign In'|trans }}</button>
  410. </div>
  411. </div>
  412. </div>
  413. </form>
  414. \t\t</div>
  415. \t\t<div class=\"uv-large-box-lt\">
  416. \t\t\t<div class=\"uv-center-box uv-text-center\">
  417. \t\t\t\t<a href=\"https://www.uvdesk.com\">
  418. <img alt=\"UVdesk\" title=\"UVdesk\" src=\"{{ asset('bundles/uvdeskcoreframework/images/uvdesk-logo-symbol.svg') }}\">
  419. \t\t\t\t</a>
  420. </div>
  421. \t\t</div>
  422. \t</div>
  423. {% endblock %}
  424. {% block footer %}
  425. {{ parent() }}
  426. {% if recaptchaDetail and recaptchaDetail.isActive == true %}
  427. <script src='https://www.google.com/recaptcha/api.js'></script>
  428. {% endif %}
  429. <script type=\"text/javascript\">
  430. \$(function () {
  431. _.extend(Backbone.Validation.callbacks, {
  432. valid : function (view, attr, selector) {
  433. var \$el = view.\$('[name=\"' + attr + '\"]');
  434. \$el.removeClass('uv-field-error');
  435. \$el.parents('.uv-adjacent-element-block').find('.uv-field-message').remove();
  436. },
  437. invalid : function (view, attr, error, selector) {
  438. var \$el = view.\$('[name=\"' + attr + '\"]');
  439. \$el.addClass('uv-field-error');
  440. \$el.parents('.uv-adjacent-element-block').find('.uv-field-message').remove();
  441. \$el.parents('.uv-adjacent-element-block').append(\"<span class='uv-field-message'>\" + error + \"</span>\");
  442. }
  443. });
  444. var LoginModel = Backbone.Model.extend({
  445. validation: {
  446. '_username': [{
  447. required: true,
  448. msg: '{{ \"This field is mandatory\"|trans }}'
  449. },{
  450. pattern: 'email',
  451. msg: '{{ \"This is not a valid email address\"|trans }}'
  452. }],
  453. '_password': [{
  454. required: true,
  455. msg: '{{\"This field is mandatory\"|trans }}'
  456. },{
  457. minLength: 8,
  458. msg: '{{\"Password must contains 8 Characters\"|trans }}'
  459. }],
  460. {% if recaptchaDetail and recaptchaDetail.isActive == true %}
  461. 'g-recaptcha-response' : {
  462. fn: function(value) {
  463. if(grecaptcha.getResponse().length > 0)
  464. return false;
  465. else
  466. return true;
  467. },
  468. msg : '{{ \"Please select CAPTCHA\"|trans }}'
  469. }
  470. \t\t\t\t {% endif %}
  471. }
  472. });
  473. var LoginForm = Backbone.View.extend({
  474. events: {
  475. 'click .uv-btn': 'submit',
  476. 'blur input': 'formChanegd'
  477. },
  478. initialize: function () {
  479. Backbone.Validation.bind(this);
  480. {% if error.messageKey is defined %}
  481. app.appView.renderResponseAlert({'alertClass': 'danger', 'alertMessage': '{{ error.messageKey|trans}}'})
  482. {% endif %}
  483. },
  484. formChanegd: function(e) {
  485. \t\t\t \tthis.model.set(Backbone.\$(e.currentTarget).attr('name'), Backbone.\$(e.currentTarget).val())
  486. \t\t\t \tthis.model.isValid([Backbone.\$(e.currentTarget).attr('name')])
  487. \t\t\t },
  488. submit: function (e) {
  489. e.preventDefault();
  490. var data = this.\$el.serializeObject();
  491. this.model.set(data);
  492. if(this.model.isValid(true)){
  493. this.\$el.submit();
  494. }
  495. }
  496. });
  497. var Login = new LoginForm({
  498. \t\t el: \$('#loginForm'),
  499. \t\t model: new LoginModel()
  500. \t\t });
  501. });
  502. </script>
  503. {% endblock %}
  504. ", "@UVDeskCoreFramework//login.html.twig", "/srv/hosting/uvdesk/vendor/uvdesk/core-framework/Resources/views/login.html.twig");
  505. }
  506. }