Skip to content

Instantly share code, notes, and snippets.

@nathanp
Created July 23, 2018 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanp/b24d4f22180e5abe7b1eb90a172e4619 to your computer and use it in GitHub Desktop.
Save nathanp/b24d4f22180e5abe7b1eb90a172e4619 to your computer and use it in GitHub Desktop.
<div class="panel panel-block">
<div class="panel-heading">
<h4 class="panel-title">Important Events</h4>
</div>
<div class="">
{% eventcalendaritem where:'EventCalendarId == 1' %}
<ul class="list-group list-group-panel">
{% for eventcalendaritem in eventcalendaritemItems %}
{% if eventcalendaritem.EventItem.IsActive == true %}
{% assign level = eventcalendaritem | Attribute:'EventLevel' %}
{% assign nextOccurrenceArray = eventcalendaritem.EventItem.EventItemOccurrences | Sort:'Schedule.EffectiveStartDate' %}
{% assign today = 'Now' | Date:'M/d/yyyy' %}
{% for next in nextOccurrenceArray %}
{% assign nextOccurrence = next | Index:forloop.index | Property:'Schedule.EffectiveStartDate' %}
{% if nextOccurrence < today %}
{% continue %}
{% endif %}
{% if level == "Silver Project" or level == "Gold Project" %}
<li class="list-group-item">
<a href="{{ 'Global' | Attribute:'InternalApplicationRoot' }}page/397?EventCalendarId=1&EventItemId={{ eventcalendaritem.EventItemId }}">{{ eventcalendaritem.EventItem.Name }}</a>
<br />
<i class="far fa-calendar"></i> {{ nextOccurrence | Date:'MM-dd-yyyy' }}
<br />
<i class="fas fa-circle" {% if level == "Gold Project" %} style="color:#ffc000" {% endif %}></i> {{ level }}
</li>
{% endif %}
{% break %}
{% endfor %}
{% endif %}
{% endfor %}
</ul>
{% endeventcalendaritem %}
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment