<?php
/**
 * Funkcnost zaobstarava js v app.js
 * Do formu sa nastavuju classy podla toho co sa prave deje:
 *  - loading - ked prebieha request
 *  - success - ked uspesne prebehol
 *  - fail - ked to padlo tak sa prida class fail. po 5s sa automaticky odstrani
 */

// prettier-ignore
$gdpr_label = __("Súhlasim so", "rootcommerce") . " <a class='link gdpr-link privacy-policy-link' href='" . get_privacy_policy_url() . "'>" . __("spracovaním osobných údajov", "rootcommerce") . "</a> " . __("na marketingové účely.", "rootcommerce");
$title = __("Prihlásiť sa na odber", "inoby");
$subscribe_label = __("Prihlásiť", "inoby");
$form_id = uniqid("newsletter_form");
?>
<h2 class="underlined"><?= $title ?></h2>
<form id="<?= $form_id ?>" class="newsletter-form">
  <div class="overlay"></div>
  <input type="text" class="input-text fname" name="fname" placeholder="Meno" autocomplete="fname" />
  <input type="text" class="input-text lname" name="lname" placeholder="Priezvisko" autocomplete="lname" />
  <input type="email" class="input-text email" name="email" placeholder="E-mailová adresa *" autocomplete="email"
    required />
  <input id="gdpr" type="checkbox" class="input-checkbox gdpr" name="gdpr" required />
  <label for="gdpr"><span><?= $gdpr_label ?></span></label>
  <button type="submit" class="button submit" name="subscribe_newsletter"
    value="<?= $subscribe_label ?>"><?= $subscribe_label ?></button>
  <p class="message error-message">Vyskytla sa chyba, pri pokuse o prihlásenie. Skúste neskôr prosím.</p>
  <p class="message success-message">Ďakujeme ti za prihlásenie</p>
</form>