{% for minical in loops.minical %}
{% if minical.MODULE_ID eq definition.MODULE_ID %}
<a style="display: inline;" id="minical{{ minical.MODULE_ID }}"></a>
{{ definition.LR_BLOCK_H_L }}{% if definition.S_BLOCK_ICON %}
{% if definition.FA_ENABLED %}
	<i class="icon b3p-icon fa {{ definition.FA_ICON }}" style="font-size: {{ definition.FA_SIZE }}px;" aria-hidden="true"></i>
{% else %}
	<img src="{{ definition.IMAGE_SRC }}" width="{{ definition.IMAGE_WIDTH }}" height="{{ definition.IMAGE_HEIGHT }}" alt="" />
{% endif %}
{% endif %}{{ definition.TITLE }}{{ definition.LR_BLOCK_H_R }}
	<table class="portal-module-postbody">
		<tr>
			<td class="portal-calendar-go-previous" colspan="2">{% if S_CONTENT_DIRECTION eq 'rtl' %}{{ minical.U_NEXT_MONTH }}{% else %}{{ minical.U_PREV_MONTH }}{% endif %}</td>
			<td colspan="3" class="portal-calendar-current-month"><span class="genmed">{{ minical.L_MINI_CAL_MONTH }}</span></td>
			<td class="portal-calendar-go-next" colspan="2">{% if S_CONTENT_DIRECTION eq 'rtl' %}{{ minical.U_PREV_MONTH }}{% else %}{{ minical.U_NEXT_MONTH }}{% endif %}</td>
		</tr>
		<tr class="portal-calendar-days-title">
			{% if minical.S_SUNDAY_FIRST %}
				<td><span class="gensmall">{{ minical.L_MINI_CAL_SUN }}</span></td>
			{% endif %}
				<td><span class="gensmall">{{ minical.L_MINI_CAL_MON }}</span></td>
				<td><span class="gensmall">{{ minical.L_MINI_CAL_TUE }}</span></td>
				<td><span class="gensmall">{{ minical.L_MINI_CAL_WED }}</span></td>
				<td><span class="gensmall">{{ minical.L_MINI_CAL_THU }}</span></td>
				<td><span class="gensmall">{{ minical.L_MINI_CAL_FRI }}</span></td>
				<td><span class="gensmall">{{ minical.L_MINI_CAL_SAT }}</span></td>
			{% if not minical.S_SUNDAY_FIRST %}
				<td><span class="gensmall">{{ minical.L_MINI_CAL_SUN }}</span></td>
			{% endif %}
		</tr>
		{% for mini_cal_row in minical.mini_cal_row %}
		{% if mini_cal_row.MODULE_ID eq definition.MODULE_ID %}
		<tr class="portal-calendar-days">
			{% for mini_cal_days in mini_cal_row.mini_cal_days %}
				<td><span class="gensmall">{{ mini_cal_days.MINI_CAL_DAY }}</span></td>
			{% endfor %}
		</tr>
		{% endif %}
		{% endfor %}
	</table>
	{% if minical.S_DISPLAY_EVENTS %}
	<hr class="dashed" />
	<div class="menutitle portal-calendar-events-heading">{{ lang('CURRENT_EVENTS') }}{{ lang('COLON') }}</div>
	<ul class="portal-events">
		{% for cur_events in minical.cur_events %}

		<li class="row">
			<dl class="row-item">
				<dt class="portal-calendar-event-listing">
					{% if cur_events.EVENT_URL %}<a href="{{ cur_events.EVENT_URL }}" title="{{ cur_events.EVENT_TITLE }}" {% if cur_events.EVENT_URL_NEW_WINDOW %}onclick="window.open('{{ cur_events.EVENT_URL }}'); return false;"{% endif %}>{% endif %}
					<span class="portal-calendar-event-title">{{ cur_events.EVENT_TITLE }}{{ lang('COLON') }}</span><br />
					{% if cur_events.ALL_DAY %}{{ lang('EVENT_START') }}{{ lang('COLON') }}&nbsp;{{ cur_events.START_TIME }}<br />{{ lang('EVENT_ALL_DAY') }}<br />
					{% elseif not cur_events.ALL_DAY and cur_events.END_TIME %}{{ lang('EVENT_START') }}{{ lang('COLON') }}&nbsp;{{ cur_events.START_TIME }}<br />{{ lang('EVENT_END') }}{{ lang('COLON') }}&nbsp;{{ cur_events.END_TIME }}<br />
					{% else %}{{ lang('EVENT_ALL_DAY') }}<br />
					{% endif %}
					{% if cur_events.EVENT_DESC %}<span class="portal-calendar-event-description">{{ cur_events.EVENT_DESC }}</span>{% endif %}
					{% if cur_events.EVENT_URL %}</a>{% endif %}
				</dt>
			</dl>
		</li>

		{% else %}
		<li class="calendar-info"><span class="gensmall portal-title-span"><strong>{{ lang('NO_CUR_EVENTS') }}</strong></span><br /></li>
		{% endfor %}
	</ul>
	<hr class="portal-calendar-divider" />
	<div class="menutitle portal-calendar-events-heading">{{ lang('UPCOMING_EVENTS') }}{{ lang('COLON') }}</div>
	<ul class="portal-events">
		{% for upcoming_events in minical.upcoming_events %}

		<li class="row">
			<dl class="row-item">
				<dt class="portal-calendar-event-listing">
					{% if upcoming_events.EVENT_URL %}<a href="{{ upcoming_events.EVENT_URL }}" title="{{ upcoming_events.EVENT_TITLE }}" {% if upcoming_events.EVENT_URL_NEW_WINDOW %}onclick="window.open('{{ upcoming_events.EVENT_URL }}'); return false;"{% endif %}>{% endif %}
					<span class="portal-calendar-event-title">{{ upcoming_events.EVENT_TITLE }}{{ lang('COLON') }}</span><br />
					{% if not upcoming_events.ALL_DAY and not upcoming_events.END_TIME %}{{ lang('EVENT_TIME') }}{{ lang('COLON') }}&nbsp;{{ upcoming_events.START_TIME }}<br />
					{% elseif not upcoming_events.ALL_DAY and upcoming_events.END_TIME %}{{ lang('EVENT_START') }}{{ lang('COLON') }}&nbsp;{{ upcoming_events.START_TIME }}<br />{{ lang('EVENT_END') }}{{ lang('COLON') }}&nbsp;{{ upcoming_events.END_TIME }}<br />
					{% else %}{{ lang('EVENT_TIME') }}{{ lang('COLON') }}&nbsp;{{ upcoming_events.START_TIME }}<br />{{ lang('EVENT_ALL_DAY') }}<br />
					{% endif %}
					{% if upcoming_events.EVENT_DESC %}<span class="portal-calendar-event-description">{{ upcoming_events.EVENT_DESC }}</span><br />{% endif %}
					{% if upcoming_events.EVENT_URL %}</a>{% endif %}
				</dt>
			</dl>
		</li>

		{% else %}
		<li class="calendar-info"><span class="gensmall portal-title-span"><strong>{{ lang('NO_UPCOMING_EVENTS') }}</strong></span><br /></li>
		{% endfor %}
	</ul>
	<br />
	{% endif %}
{{ definition.LR_BLOCK_F_L }}{{ definition.LR_BLOCK_F_R }}
{% endif %}
{% endfor %}
