<link rel="stylesheet" type="text/css" href="includes/js/select2/css/select2.min.css" />
<div class="card panel-fcs-content" style="border:none;">
    <div class="card-header text-end">
        [% if $Tools->FCS_Count($Messages) %]
        <input type="button" id="deleteMessages" class="btn btn-outline-primary" value="[% $user->gettext('Alle Löschen') %]" onclick="deleteAllMessages();"/>                    
    [% /if %]    

    </div>
<div class="card-body">
[% if $MessageFilter %]

        <form id="MessageForm" class="form-horizontal form-label-left" style="margin-bottom: 5px;">
            <label for="MessageFilter">[% $user->gettext('Filtern') %] </label>
            <select name="MessageFilter[]" id="MessageFilter" multiple="multiple" class="form-control" style="width: 100%">
                [% foreach from=$MessageFilter item=filter key=messagetype %]
                    <option value="[% $filter.id %]" [% if $filter.selected %]selected="selected"[% /if %]>[% $messagetype %] ([% $filter.cnt %]) </option>
                [% /foreach %]
            </select>
        </form>
[% /if %]  

    <ul class="list-group">
    [% foreach from=$Messages item=Message %]
    <li style="height:auto !important;" id="Message_[% $Message.id %]" class="list-group-item Message MessageType_[% $Message.messagetypeid %] [% if $Message.readdate %]MessageReaded[% /if %]">
        <div class="row">
            <div class="col-sm-2">
                 <span class="MessageDate"> [% $Message.createdate|strtotime|date_format:"%d.%m. %H:%M" %] </span>
            </div>
            <div class="col-sm-10" style="text-wrap: wrap;">
                         [% $Message.message %]
            </div>
        </div>
       
    </li>
[% foreachelse %]
    <li class="list-group-item">
        [% $user->gettext('Keine Nachrichten') %]
    </li>
[% /foreach %]
    </ul>
</div>
</div>



