{% assign omni = false %}
{% assign core = false %}
{% assign partners = false %}
{% assign redirect = false %}
{% assign both_gorups = false %}

{% if current_person.signed_in? %}
  {% assign log_out = false %}
  {% for group in current_person.groups %}
	{% if group.name contains 'Partners' %}
	  {% assign partners = true %}
	{% else %}
	  {% if group.name contains 'Core' %}
		{% assign core = true %}
		{% elsif group.name contains 'Omni' %}
		  {% assign omni = true %}
	  	{% endif %}
	  {% endif %}
  {% endfor %}
{% endif %}
{% if omni and core %}
  {% assign both_gorups = true %}
{% endif %}

{% unless partners or both_gorups %}
  {% if partners %}
    {% assign redirect = false %}
  {% elsif core and learning_path.name contains 'Omni' %}
    {% assign redirect = true %}
  {% elsif omni and learning_path.name contains 'Core' %}
      {% assign redirect = true %}
  {% endif %}
{% endunless %}


{% if redirect %}
  <script>window.location.replace('/app')</script>
{% endif %}

<div class="lp-desktop-wrapper">
  <div class="row">
    <div class="col-xs-12 col-sm-6">
      <div class="np-card-container card-learning-path-desktop">
        <img
          src="{{ learning_path.image_url }}"
          class="np-top-image image-learning-path-desktop"
          alt="{{ learning_path.name }}"
        />
        <div class="np-card-padding-dynamic">
          {% include "learning_path_description" %}
          {% include "learning_path_instructors" %}
        </div>
      </div>
    </div>
    <div class="col-xs-12 col-sm-6 np-grid-spacing lp-progress-and-cta-wrapper">
      <div class="np-top-cta">
        {% include "learning_path_progress_and_cta" %}
      </div>
      {% include "learning_path_outline" %}
    </div>
  </div>
</div>
