{# Zusätzliches Javascript - ehem. bootbox durch tucal->hs_url() ersetzt #}
{% if (load_js) %}
<script src="{{ app_base }}app/static/js/modulview.js"></script>
{% endif %}
{# Wenn nichts gefunden wurde Text anzeigen, sonst Tabelle #}
{% if veranstaltungen|length == 0 %}
<p>{{not_found_text|raw }}</p>
{% else %}
{% if (load_mp) %}
{% set mp_id = "MeinPlanForm_" ~ random() %}
<form id="{{mp_id}}" class="vlvz_activities_form">
<input type="hidden" name="no_tucal" value="1">
{% endif %}
<div class="table-responsive">
<table class="table vlvz_activities {{css_class}}">
{# Head #}
<thead>
<tr>
<th>Nummer</th>
<th>Name</th>
{% if detail_in_table == true %}
<th>Gruppen</th>
<th>Dozierende</th>
{% endif %}
{% if joined_time_room == true %}
<th>Zeit, Raum</th>
{% else %}
<th>Zeit</th>
{% if room_in_table == true %}
<th>Raum</th>
{% endif %}
{% endif %}
{% if detail_in_table == false %}
<th>Details</th>
{% endif %}
</tr>
</thead>
<tbody>
{# Veranstaltungen durchlaufen #}
{% for v in veranstaltungen %}
<tr>
{# Nummer #}
<td style="white-space: nowrap;">
{{v.nummer}}
{% if (load_mp == 1) %}
<br />
<input id="checkbox-{{v.id}}" type="checkbox" name="mp_ids[]" value="{{v.id}}" data-mpnumber="{{v.nummer}}" />
{% endif %}
</td>
{# Name, Art, Zusatz #}
<td>
<label for="checkbox-{{v.id}}" style="font-weight: normal;margin: 0;">
{% if (v.url != "") %}
<a class="link" href="{{v.url}}">{{v.name}}</a>
{% else %}
{{v.name}}
{% endif %}
</label>
<div>
{# Veranstaltungsart Vorlesung/Uebung etc. #}
{% if use_vlvz_style == true %}
<span class="art {{v.external_art_css}}">{{v.art}}</span>
{% else %}
<span style="color: #000">[{{v.art}}]</span>
{% endif %}
{# Veranstaltungsstil digital/Praesenz/hybrid #}
{% set stil = "" %}
{% set cssstil = "" %}
{% if (v.praesenz == 1) %}
{% if (v.digital == "digital") %}
{% set stil = "hybrid" %}
{% set cssstil = "hybrid" %}
{% else %}
{% set stil = "präsenz" %}
{% set cssstil = "praesenz" %}
{% endif %}
{% elseif (v.digital == "digital") %}
{% set stil = "digital" %}
{% set cssstil = "digital" %}
{% endif %}
{% if stil != "" %}
{% if use_vlvz_style == true %}
<span class="art {{ cssstil }}">{{ stil }}</span>
{% else %}
<span style="color: #000">[{{ stil }}]</span>
{% endif %}
{% endif %}
</div>
<div class="v_zusatz">
{% if (v.zusatz_html != "") %}
<span style="color: #c2043e">{{v.zusatz_html|raw}}</span>
{% endif %}
</div>
<div class="v_info">
{% if (v.info_html != "") %}
<span style="color: #000;font-style: italic;">{{v.info_html|raw}}</span>
{% endif %}
</div>
</td>
{% if detail_in_table == true %}
{# Gruppen #}
<td>
{% if (v.gruppen|length > 0) %}
{% if (v.gruppen.obl|length != 0) %}
<strong>obl:</strong>
{% set gruppen = v.gruppen.obl %}
{% for g in gruppen %}
{% if (loop.last == false) %}
<span title="{{g.lang}} ({{g.fakult_lang}})">{{g.kurz}},</span>
{% else %}
<span title="{{g.lang}} ({{g.fakult_lang}})">{{g.kurz}}</span>
{% endif %}
{% endfor %}
<br>
{% endif %}
{% if (v.gruppen.wo|length != 0) %}
<strong>wo:</strong>
{% set gruppen = v.gruppen.wo %}
{% for g in gruppen %}
{% if (loop.last == false) %}
<span title="{{g.lang}} ({{g.fakult_lang}})">{{g.kurz}},</span>
{% else %}
<span title="{{g.lang}} ({{g.fakult_lang}})">{{g.kurz}}</span>
{% endif %}
{% endfor %}
<br>
{% endif %}
{% if (v.gruppen.fak|length != 0) %}
<strong>fak:</strong>
{% set gruppen = v.gruppen.fak %}
{% for g in gruppen %}
{% if (loop.last == false) %}
<span title="{{g.lang}} ({{g.fakult_lang}})">{{g.kurz}},</span>
{% else %}
<span title="{{g.lang}} ({{g.fakult_lang}})">{{g.kurz}}</span>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
</td>
{# Dozenten #}
<td>
{% if (v.dozenten|length > 0) %}
{% for doz in v.dozenten %}
{% if (loop.last == false) %}
<span>{{doz.title}} {{doz.nachname}},</span>
{% else %}
<span>{{doz.title}} {{doz.nachname}}</span>
{% endif %}
{% endfor %}
{% endif %}
</td>
{% endif %}
{% if joined_time_room == true %}<td>{% endif %}
{# Zeitangabe #}
{% if (v.woche == "Einzeltermin") %}
{% if joined_time_room == false %}
<td>{{v.einzel}}</td>
{% else %}
{{v.einzel}}
{% endif %}
{% else %}
{% if joined_time_room == false %}
<td style="white-space: nowrap;">
{% else %}
<strong>Zeit: </strong>
{% endif %}
{{v.tag}} ({{v.woche}})
{% if (v.woche != "keine Angabe") %}
<br/>{{v.start}}-{{v.ende}}
{% endif %}
{% if joined_time_room == false %}</td>{% endif %}
{% endif %}
{# Raumangabe #}
{% if room_in_table == true %}
{% if joined_time_room == false %}
<td style="white-space: nowrap;">
{% else %}
{% if (v.raum|length > 0) %}<br><strong>Raum: </strong>{% endif %}
{% endif %}
{% for r in v.raum %}
{# Umbruch, wenn mehrere Räume #}
{% if (loop.index0 > 0) %}<br>{% endif %}
{# Link bestimmen, eventuell wird ein eindeutiger Link mitgeliefert
ansonsten wird der generische Link verwendet (der kann aber ins Leere führen) #}
{% set room_link = "https://www.tu-chemnitz.de/tu/lageplan/campusfinder/campusfinder.php?raum=" ~ r %}
{% if v.raum_ext[loop.index0].campusfinder_params %}
{% set room_link = "https://www.tu-chemnitz.de/tu/lageplan/campusfinder/campusfinder.php?" ~ v.raum_ext[loop.index0].campusfinder_params %}
{% endif %}
<a href="{{ room_link }}">
{{ v.raum_ext[loop.index0].alternativ }}
{% if v.raum_ext[loop.index0].alternativ %}
{% if joined_time_room == false %}<br><span{% if use_vlvz_style == false %} style="font-size:.9em;"{% endif %} class="new_roomnumber">
{% else %}<span>{% endif %}
(alt: {{ r }})
</span>
{% endif %}
</a>
{% endfor %}
{% if joined_time_room == false and (v.raum|length == 0) %}
k.A.
{% endif %}
{% if joined_time_room == false %}</td>{% endif %}
{% endif %}
{% if joined_time_room == true %}</td>{% endif %}
{# Detailansicht #}
{% if detail_in_table == false %}
<td>
<div class="details_icon">
{# Twig-Filter "tucal_hs_detailview" ruft tucal->hs_url() #}
{{ v.nummer|tucal_hs_detailview|raw }}
</div>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if (load_mp) %}
<div style="text-align: right;">
<button class="btn btn-info"
title="Ausgewählte Veranstaltungen dem Persönlichen Stundenplan hinzufügen"
form="{{mp_id}}"
formmethod="post"
formaction="{{ app_base }}meinplan/add"
type="submit">
<span class="glyphicon glyphicon-plus"></span> Auswahl dem Persönlichen Stundenplan hinzufügen
</button>
</div>
</form>
{% endif %}
{% endif %}