<div class="registration-terms-and-condition registration_hide">
    <div class="title">
        <div class="registration-form-title">
            Please read the following statement and terms and conditions:
        </div>
    </div>
    <div class="registration-error registration-server-error registration_hide" role="alert">
        <span class="registration-error-message">sitecore api error</span>
    </div>

    <div class="registration-terms-container">
        <p>
            labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
        </p>

        <p>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.
        </p>
        <div class="checkbox-container">
            <label class="checkbox checkbox--secondary">
                <span class="label">I have read and agree to the England Supporters Travel Club Privacy Policy and Terms and Conditions</span>
                <input type="checkbox" name="ESTCChecked">
                <span class="checkmark-container">
                    <span class="checkmark"></span>
                </span>
            </label>

            <label class="checkbox checkbox--secondary registration_hide">
                <span class="label">I have read and agree to the England Supporters Travel Club Privacy Policy and Terms and
                    Conditions</span>
                <input type="checkbox" name="YouthESTCChecked">
                <span class="checkmark-container">
                    <span class="checkmark"></span>
                </span>
            </label>
        </div>
        <div class="registration-error-container registration-error registration_hide" role="alert">
            <span class="registration-error-message registration_hide" id="invalid-estc">invalid-estc</span>
            <span class="registration-error-message registration_hide" id="invalid-youth-estc">invalid-youth-estc</span>
        </div>
    </div>
    <div class="cta-container">
        <div class="registration-terms-and-condition__next" data-error-message="In order to become a Junior England Supporters Clubs member, you have to agree to the Terms and Conditions and Privacy Policy.">
            <a href="/" class="cta cta--r-disabled ">
                <p>Next</p>
            </a>

        </div>

        <div class="registration-terms-and-condition__remove_junior_and_continue registration_hide" data-error-message="In order to become a Junior England Supporters Clubs member, you have to agree to the Terms and Conditions and Privacy Policy.">
            <a href="/" class="cta cta--r-secondary ">
                <p>Remove Junior and Continue</p>
            </a>

        </div>
    </div>
</div>

No notes defined.

{
  "title": {
    "copy": "Please read the following statement and terms and conditions:"
  },
  "next": {
    "copy": "Next"
  },
  "continue": {
    "copy": "Remove Junior and Continue"
  },
  "para1": {
    "copy": " labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
  },
  "para2": {
    "copy": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam."
  },
  "checkbox1": {
    "copy": "I have read and agree to the England Supporters Travel Club Privacy Policy and Terms and Conditions",
    "name": "ESTCChecked"
  },
  "checkbox2": {
    "copy": "I have read and agree to the Junior England Supporters Club Privacy Policy and Terms and Conditions",
    "name": "YouthESCChecked"
  },
  "checkbox3": {
    "copy": "I have read and agree to the Junior England Supporters Travel Club Privacy Policy and Terms and Conditions",
    "name": "YouthESTCChecked"
  }
}
  • Content:
    /* eslint-disable compat/compat */
    /* eslint-disable operator-linebreak */
    import Validator from '../../validation';
    import {
      hideServerError,
      showServerError,
    } from '../../registration-server-error/registration-server-error';
    import {
      POST,
      termsAndConditionPayload,
      termsAndConditionPath,
      getAuth,
    } from '../../service';
    import {
      currentPage,
      nevigateToNext,
      onComponentVisible,
      showStep,
    } from '../../registrationUtility';
    import { hideClass } from '../../registration-error/registration-error';
    
    export default (currentElement, juniorFlow) => {
      let controller = new AbortController();
    
      const checkBosex = {
        ESTCChecked: false,
        YouthESTCChecked: false,
      };
    
      const callApi = async () => {
        const res = await POST(termsAndConditionPath, {
          ...termsAndConditionPayload,
          ...checkBosex,
          fanCode: getAuth().fanCode,
          youthIndividualIds: currentPage.selectJuniors.map(x => x.individualid),
        });
    
        if (res.success) {
          hideServerError(currentElement);
          sessionStorage.setItem(
            'orderResponse',
            JSON.stringify(res.orderResponse)
          );
          nevigateToNext(currentElement);
        } else {
          showServerError(currentElement, res.error);
        }
      };
    
      const nextClickHandler = async event => {
        event.preventDefault();
        const { target } = event;
    
        if (target.classList.contains('cta--r-primary')) {
          if (currentPage.selectJuniors.length === 0) {
            await callApi();
          } else if (checkBosex.ESTCChecked && checkBosex.YouthESTCChecked) {
            await callApi();
          } else {
            showServerError(
              currentElement,
              target.parentElement.getAttribute('data-error-message')
            );
          }
        }
      };
    
      const checkboxChangeHandler = (
        nextBtn,
        removeNadContinue,
        checkBoxes,
        errorContainer
      ) => {
        errorContainer.classList.add(hideClass);
        removeNadContinue.classList.add(hideClass);
        nextBtn.classList.remove(hideClass);
    
        checkBoxes.forEach(checkbox => {
          checkBosex[checkbox.name] = checkbox.checked;
        });
    
        const { ESTCChecked, YouthESTCChecked } = checkBosex;
    
        if (ESTCChecked && YouthESTCChecked) {
          Validator.swaapBtn(nextBtn, true);
        } else if (!ESTCChecked && !YouthESTCChecked) {
          Validator.swaapBtn(nextBtn, false);
        } else if (ESTCChecked || YouthESTCChecked) {
          errorContainer.classList.remove(hideClass);
          errorContainer.lastElementChild.classList.add(hideClass);
          errorContainer.firstElementChild.classList.add(hideClass);
          if (ESTCChecked) {
            if (currentPage.selectJuniors.length === 0) {
              removeNadContinue.classList.add(hideClass);
              nextBtn.classList.remove(hideClass);
              Validator.swaapBtn(nextBtn, true);
            } else {
              removeNadContinue.classList.remove(hideClass);
              nextBtn.classList.add(hideClass);
              errorContainer.lastElementChild.classList.remove(hideClass);
            }
          } else {
            removeNadContinue.classList.add(hideClass);
            nextBtn.classList.remove(hideClass);
            Validator.swaapBtn(nextBtn, false);
            errorContainer.firstElementChild.classList.remove(hideClass);
          }
        }
      };
    
      const removeNadContinueHandler = async event => {
        event.preventDefault();
        checkBosex.YouthESTCChecked = false;
        currentPage.selectJuniors = [];
        await callApi();
        juniorFlow.classList.add('registration_skip');
      };
    
      onComponentVisible(currentElement, () => {
        controller.abort('Removing previous event listeners');
        controller = new AbortController();
        hideServerError(currentElement);
        showStep('06');
        currentPage.page = currentElement;
    
        const [, ...juniorCheckBox] = currentElement.querySelectorAll(
          '.registration-terms-container .checkbox-container label'
        );
    
        const errorContainer = currentElement.querySelector(
          '.registration-error-container'
        );
    
        juniorCheckBox.forEach(element => {
          element.classList.add(hideClass);
        });
    
        if (currentPage.selectJuniors.length > 0) {
          juniorCheckBox.forEach(element => {
            element.classList.remove(hideClass);
          });
        }
    
        const Checkboxes = currentElement.querySelectorAll(
          '.registration-terms-container .checkbox-container label:not(.registration_hide) input[type=checkbox]'
        );
        const nextBtn = currentElement.querySelector(
          '.registration-terms-and-condition__next a'
        );
    
        const removeNadContinue = currentElement.querySelector(
          '.registration-terms-and-condition__remove_junior_and_continue a'
        );
    
        if (currentPage.selectJuniors.length > 0 && currentPage.adultMemberShip) {
          removeNadContinue.parentElement.classList.remove(hideClass);
        } else {
          removeNadContinue.parentElement.classList.add(hideClass);
        }
    
        checkboxChangeHandler(
          nextBtn,
          removeNadContinue,
          Checkboxes,
          errorContainer
        );
    
        nextBtn.addEventListener('click', nextClickHandler, {
          signal: controller.signal,
        });
    
        removeNadContinue.addEventListener('click', removeNadContinueHandler, {
          signal: controller.signal,
        });
    
        Checkboxes.forEach(checkbox => {
          checkbox.addEventListener(
            'change',
            () =>
              checkboxChangeHandler(
                nextBtn,
                removeNadContinue,
                Checkboxes,
                errorContainer
              ),
            {
              signal: controller.signal,
            }
          );
        });
      });
    };
    
  • URL: /components/raw/registration-terms-and-condition/registration-terms-and-condition.js
  • Filesystem Path: src/library/modules/registration/registration-self/registration-terms-and-condition/registration-terms-and-condition.js
  • Size: 5.5 KB
  • Content:
    .registration-terms-and-condition {
      $cta-container-mt: 40px;
      $cta-gap: 16px;
      $body-mt: 24px;
    
      .registration-terms-container {
        margin-top: $body-mt;
      }
    
      &__next {
        margin-top: $cta-container-mt;
      }
    
      .cta-container {
        .cta--r-secondary,
        .cta--r-primary {
          min-height: 44px;
          font-size: 16px;
        }
    
        div:not(:first-child) {
          margin-top: $cta-gap;
        }
      }
    
      .para-container {
        max-height: 387px;
        background-color: #d9d9d91a;
        overflow-y: auto;
        border-radius: 2px;
        margin-top: 24px;
    
        p {
          font-size: 14px;
        }
      }
    
      .checkbox-container {
        margin-top: 24px;
      }
    
      .registration-error{
        border-radius: 2px;
      }
    }
    
  • URL: /components/raw/registration-terms-and-condition/registration-terms-and-condition.scss
  • Filesystem Path: src/library/modules/registration/registration-self/registration-terms-and-condition/registration-terms-and-condition.scss
  • Size: 693 Bytes
<div class="registration-terms-and-condition registration_hide">
  <div class="title">
    {{render '@registration-form-title' title}}
  </div>
  {{!-- adding error --}}
  {{render '@registration-server-error'}}

  {{#> @registration-terms-container}}
  <p>
    {{para1.copy}}
  </p>

  <p>
    {{para2.copy}}
  </p>
  <div class="checkbox-container">
    {{render '@checkbox--secondary' checkbox1 merge="true"}}

    <label class="checkbox checkbox--secondary registration_hide">
      <span class="label">I have read and agree to the England Supporters Travel Club Privacy Policy and Terms and
        Conditions</span>
      <input type="checkbox" name="YouthESTCChecked">
      <span class="checkmark-container">
        <span class="checkmark"></span>
      </span>
    </label>
  </div>
  <div class="registration-error-container registration-error registration_hide" role="alert">
    <span class="registration-error-message registration_hide" id="invalid-estc">invalid-estc</span>
    <span class="registration-error-message registration_hide" id="invalid-youth-estc">invalid-youth-estc</span>
  </div>
  {{/ @registration-terms-container}}

  <div class="cta-container">
    <div class="registration-terms-and-condition__next"
      data-error-message="In order to become a Junior England Supporters Clubs member, you have to agree to the Terms and Conditions and Privacy Policy.">
      {{render '@cta--r-disabled' next merge="true"}}
    </div>

    <div class="registration-terms-and-condition__remove_junior_and_continue registration_hide"
      data-error-message="In order to become a Junior England Supporters Clubs member, you have to agree to the Terms and Conditions and Privacy Policy.">
      {{render '@cta--r-secondary' continue merge="true"}}
    </div>
  </div>
</div>