{extends file=$smarty.const.SMARTY_LAYOUT_MAIN_POPUP}

{block name="content"}

    <h1 style="padding:10px;">{$lang['licenses']['mainHeader']}</h1>

    <table class="simpleList">
        <thead>
            <tr>
                <th>{$lang['licenses']['tableHeader']['library']}</th>
                <th>{$lang['licenses']['tableHeader']['version']}</th>
                <th>{$lang['licenses']['tableHeader']['license']}</th>
                <th>{$lang['licenses']['tableHeader']['description']}</th>
            </tr>
        </thead>
        <tbody>
            {foreach $libraries as $lib}
                <tr>
                    <td>
                        {if $lib.url}
                            <a href="{$lib.url}" target="_blank" rel="noopener noreferrer">{$lib.name}</a>
                        {else}
                            {$lib.name}
                        {/if}
                    </td>
                    <td>{$lib.version}</td>
                    <td>
                        <a href="javascript:void(0);" onclick="$('license-text-{$lib@index}').toggle()">{$lib.license}</a>
                    </td>
                    <td>{$lib.description}</td>
                </tr>
                <tr id="license-text-{$lib@index}" style="display:none;">
                    <td colspan="4">
                        <div class="license-text">{$lib.licenseText|nl2br}</div>
                    </td>
                </tr>
            {/foreach}
        </tbody>
    </table>

    <div align="center" style="padding-bottom:5px">
        Copyright &copy; <a href="https://www.dcsplus.net/" target="_blank">dcsplus.net</a>
    </div>

{/block}

{block name="css" append}
    <style>
        div.license-text {
            max-height: 200px;
            overflow-y: auto;
            background: #f5f5f5;
            padding: 10px;
            font-size: 12px;
        }
    </style>
{/block}
