[% foreach from = $templates item = $templatetype %]
    <div class="card panel-info shadow-sm rounded [% if $templatetype.typeid != 0 %]TypeForTemplate[% /if %]" id="TypeTemplate_[% $templatetype.typeid %]">
        <div class="card-header" role="tab" id="Panel_TemplateForTypes[% $templatetype.typeid %]">
            <div class="row">
                <div class="col-lg-11">
                    <h3 class="card-title">[% $templatetype.typename %]</h3>
                </div>
                <div class="col-lg-1 text-end">
                    [% if $templatetype.typeid != 0 %]
                        <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion"href="#TemplateForTypes[% $templatetype.typeid %]Collapse" aria-expanded="true" aria-controls="TemplateForTypes[% $templatetype.typeid %]Collapse" onclick="TypeTplPosition([% $templatetype.typeid %]);"><span class="fa [% if !$templatetype.templatecollapse %]fa-chevron-up[% else%]fa-chevron-down[% /if %]" id="icon_Tpl"></span> </a>
                    [% /if%]
                </div>
            </div>  
        </div>
        <div id="TemplateForTypes[% $templatetype.typeid %]Collapse" class="panel-collapse [% if $templatetype.typeid == 0 || !$templatetype.templatecollapse %]in[% else%]collapse[% /if %]" role="tabpanel" aria-labelledby="headingOne">
            <div class="card-body">
                <ul class="small-block-grid-1 medium-block-grid-2 large-block-grid-4 tplsortable" id="TemplateForTypes[% $templatetype.typeid %]List">

                    [% foreach from = $templatetype.templates item = $template %]
                        [% if $template.ownapplication > 0 %]
                            <li class="TypeTemplate" id="Tpl_[% $template.tickettemplateid %]">
                                <a href='[% $template.ApplicationURL %]' style='text-decoration:none; color:black;' target="_blank">
                                    <div class="card panel-info shadow-sm rounded">
                                        <div class="card-header" style="background-color: #f5f5f5; border-bottom: none;">
                                            <span class="fcs-card-title h6 ForFilter" style="color:black">
                                                Eigene Anwendung ([% $template.Title %])
                                            </span>
                                        </div>
                                        [% if !$smarty.const.CUTSELECTTYPEDESCRIPTION %]
                                            <div class='card-body ForFilter' style="background-color: #f5f5f5;">
                                                <p><i>[% $template.Description %]</i></p>
                                            </div>
                                        [% /if %]
                                    </div>
                                </a>
                            </li>
                        [% else %]
                            <li class="TypeTemplate" id="Tpl_[% $template.tickettemplateid %]">
                                <a href='index.php?module=ticket&event=newTicket&TicketTemplateID=[% $template.tickettemplateid %][% $URLSuffix %]' style='text-decoration:none; color:black;' target="_top">
                                    <div class="card panel-info shadow-sm rounded">
                                        <div class="card-header" style="background-color: #f5f5f5; border-bottom: none;">
                                            [% if $template.SetIconFromDir %]
                                                <img title="[% $template.shortdescr %]" src="[% $template.IconFromDir %]" class="type-icon">
                                            [% else %]
                                                <img title="[% $template.shortdescr %]" src="index.php?module=upload&class=download&event=ShowImage&name=[% $template.icon_path %]" class="type-icon">
                                            [% /if %]
                                            <span class="fcs-card-title h6 ForFilter" style="color:black" [% if $template.templatedescr %]title="[% $template.templatedescr %][% /if %]">
                                                [% $template.shortdescr %]
                                                <span style="display:none;">[% $template.templatetags %]</span>
                                            </span>
                                        </div>
                                        [% if !$smarty.const.CUTSELECTTYPEDESCRIPTION %]
                                            <div class='card-body ForFilter' style="background-color: #f5f5f5;">
                                                [% if  $template.templatedescr %]
                                                    <p><i>[% $template.templatedescr %]</i></p>
                                                [% else %]
                                                    <p><i>[% $user->gettext('Keine Beschreibung') %]</i></p>
                                                [% /if %]
                                            </div>
                                        [% /if %]
                                    </div>
                                </a>
                            </li>
                        [% /if %]
                    [% /foreach %]
                </ul>
            </div>
        </div>
    </div>
[% /foreach %]
