{% if training_session.approved? %}
  <div class="np-training-session-cta-note">
    <i class="far fa-check np-training-session-icon"></i>
    {% t .registered %}
  </div>
{% elsif training_session.pending? %}
  <div class="np-training-session-cta-note np-training-session-cta-note-error">
    {% t .pending %}
  </div>
{% elsif training_session.denied? %}
  <div class="np-training-session-cta-note np-training-session-cta-note-error">
    {% t .denied %}
  </div>
{% elsif training_session.too_late? %}
  <div class="np-training-session-cta-note np-training-session-cta-note-error">
    {% t .too_late %}
  </div>
{% elsif training_session.no_seats? %}
  <div class="np-training-session-cta-note np-training-session-cta-note-error">
    {% t .no_seats %}
  </div>
{% endif %}
<div class="np-training-session-cta">
<script>console.log("{{training_event.event_type}}")</script>
<div class="np-training-session-cta-buttons">
  <form
  action="{% route training_session_registration, id: training_session.id %}"
  method="post"
>
  {% form_authenticity_token %}

  {% if training_session.internal? and training_session.approved? %}
    {% if features.training_events_google_calendar? %}
      {% include "training_session_calendars" %}
      <button type="submit" class="np-top-button np-button np-button-big np-button-secondary">
        {% t .unregister %}
      </button>
    {% else %}
      <button type="submit" class="np-top-button np-button-font-color np-button np-button-big">
        {% t .unregister %}
      </button>
    {% endif %}

    <input type="hidden" name="_method" value="delete" />
  {% endif %}

  {% if training_session.not_registered? %}
    <button onclick="handleEventRedirection()" type="submit" class="np-top-button np-button np-button-big" id="register-btn">
      {% t .register %}
    </button>
  {% endif %}
</form>
</div>
 {% comment %} {% if training_event.event_type == "zoom_webinar" or training_event.event_type == "online" %}
    <a href="{{training_session.session_url}}" class="np-top-button np-button np-button-big" target="_blank">
      Register
    </a>
    <br>
     {% include "training_session_calendars" %} 
  {% else %}
       <form
        action="{% route training_session_registration, id: training_session.id %}"
        method="post"
      >
        {% form_authenticity_token %}

        {% if training_session.internal? and training_session.approved? %}
          {% if features.training_events_google_calendar? %}
             {% include "training_session_calendars" %} 
            <button type="submit" class="np-top-button np-button np-button-big np-button-secondary">
              {% t .unregister %}
            </button>
          {% else %}
            <button type="submit" class="np-top-button np-button-font-color np-button np-button-big">
              {% t .unregister %}
            </button>
          {% endif %}

          <input type="hidden" name="_method" value="delete" />
        {% endif %}

        {% if training_session.not_registered? %}
          {% if training_event.title == 'EBU Training - QLD' %}
            <a href="https://ljhookergroup.eventsair.com/2023---ebu-training---queensland/registration" class="np-top-button np-button np-button-big" target="_blank">
              {% t .register %}
            </a>
          {% elsif training_event.title == 'EBU Training - VIC' %}
            <a href="https://ljhookergroup.eventsair.com/2023---ebu-training---victoria/registration" class="np-top-button np-button np-button-big" target="_blank">
              {% t .register %}
            </a>
          {% elsif training_event.title == 'EBU Training - SA' %}
            <a href="https://ljhookergroup.eventsair.com/2023---ebu-training---south-australia/registration" class="np-top-button np-button np-button-big" target="_blank">
              {% t .register %}
            </a>
          {% elsif training_event.title == 'EBU Training - NSW' %}
            <a href="https://ljhookergroup.eventsair.com/2023---ebu-training---new-south-wales/registration" class="np-top-button np-button np-button-big" target="_blank">
              {% t .register %}
            </a>
          {% elsif training_event.title == 'EBU Training - ACT' %}
            <a href="https://ljhookergroup.eventsair.com/2023---ebu-training---australian-capital-territory/registration" class="np-top-button np-button np-button-big" target="_blank">
              {% t .register %}
            </a>
          {% elsif training_event.title == 'Shine PM - SA' %}
            <a href="https://ljhookergroup.eventsair.com/2023---shine-property-management-conference---south-australia/registration" class="np-top-button np-button np-button-big" target="_blank">
              {% t .register %}
            </a>
          {% elsif training_event.title == 'Shine PM - WA' %}
            <a href="https://ljhookergroup.eventsair.com/2023---shine-property-management-conference---western-australia/registration" class="np-top-button np-button np-button-big" target="_blank">
              {% t .register %}
            </a>
          {% elsif training_event.title == 'Shine PM - VIC &amp; TAS' %}
            <a href="https://ljhookergroup.eventsair.com/2023---shine-property-management-conference---victoria/registration" class="np-top-button np-button np-button-big" target="_blank">
              {% t .register %}
            </a>
          {% elsif training_event.title == 'Shine PM - ACT' %}
            <a href="https://ljhookergroup.eventsair.com/2023---shine-property-management-conference---australian-capital-territory/registration" class="np-top-button np-button np-button-big" target="_blank">
              {% t .register %}
            </a>
          {% elsif training_event.title == 'Shine PM - NSW' %}
            <a href="https://ljhookergroup.eventsair.com/2023---shine-property-management-conference---new-south-wales/registration" class="np-top-button np-button np-button-big" target="_blank">
              {% t .register %}
            </a>
          {% elsif training_event.title == 'Shine PM - QLD' %}
            <a href="https://ljhookergroup.eventsair.com/2023---shine-property-management-conference---queensland/registration" class="np-top-button np-button np-button-big" target="_blank">
              {% t .register %}
            </a>
           {% elsif training_event.title == 'Influencer Training' %}
            <a href="" class="np-top-button np-button np-button-big">
              {% t .register %}
            </a> 
          {% else %}
            <button type="submit" class="np-top-button np-button np-button-big">
              {% t .register %}
            </button>
          {% endif %}
        {% endif %}
      </form> 
  {% endif %}{% endcomment %}
</div>

