Subversion-Projekte lars-tiefland.webanos.marine-sales.de

Revision

Revision 540 | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<script type="text/javascript">
    $(function () {
        $('#reiter').tabs();
        $("#directoryTable").dataTable({
            "lengthMenu": [[100, -1], [100, "Alle"]],
            "language": {
                "url": "/js/DataTables-1.10.19/German.json"
            }
        });
        $("#itemTable").dataTable({
            "lengthMenu": [[100, -1], [100, "Alle"]],
            "language": {
                "url": "/js/DataTables-1.10.19/German.json"
            }
        });
        $('.edit_item').click(function () {
            let slug = $(this).data("slug");
            $('#editItemDlg').load("/Online-Shop/item/" + slug + "/edit", function () {
                $('#editItemDlg').dialog("open");
            })
        })
    })
</script>
<div id="reiter">
    <ul>
        {if $directory->sub_dirs|count}
            <li>
                <a href="#subdirs">Unterkategorien</a>
            </li>
        {/if}
        {if $directory->items|count}
            <li>
                <a href="#items">Artikel</a>
            </li>
        {/if}
    </ul>
    {if $directory->sub_dirs|count}
        <div id="subdirs">
            <table id="directoryTable">
                <thead>
                <tr>
                    <th>Name</th>
                    <th>Bilder</th>
                    <th>Aktionen</th>
                </tr>
                </thead>
                <tbody>
                {foreach $directory->sub_dirs as $subDir}
                    <tr>
                        <td>{$subDir->name}</td>
                        <td>
                            {foreach $subDir->medium as $medium}
                                <img src="https://www.{config('webanos.shop')}/images/upload/{$medium->medium->folder}/mini/{$medium->medium->name}"
                                     alt="">
                            {/foreach}
                        </td>
                        <td>
                            <button id="dir_{$subDir->id}_edit" class="btn btn-xs btn-primary edit_dir" data-slug="{$subDir->slug}">Bearbeiten</button>
                            <button id="dir_{$subDir->id}_del" class="btn btn-xs btn-danger del_dir" data-slug="{$subDir->slug}">Löschen</button>
                        </td>
                    </tr>
                {/foreach}
                </tbody>
            </table>
        </div>
    {/if}
    {if $directory->items|count}
        <div id="items">
            <table id="itemTable">
                <thead>
                <tr>
                    <th>Name</th>
                    <th>Bilder</th>
                    <th>Hersteller</th>
                    <th>Preise</th>
                    <th>Aktionen</th>
                </tr>
                </thead>
                <tbody>
                {foreach $directory->items as $item}
                    <tr>
                        <td>{$item->name}</td>
                        <td>
                            {foreach $item->medium as $medium}
                                <img src="https://www.{config('webanos.shop')}/images/upload/{$medium->medium->folder}/mini/{$medium->medium->name}"
                                     alt="">
                            {/foreach}
                        </td>
                        <td>
                            {$item->manufacturer->name}
                        </td>
                        <td>
                            {foreach $item->price as $price}
                                {if $price->preis > 0}
                                    {$price->preis|money_format}
                                {else}
                                    {$price->preis|abs}%
                                {/if}
                                <br>
                            {/foreach}
                        </td>
                        <td>
                            <button id="item_{$item->id}_edit" class="btn btn-xs btn-primary edit_item" data-slug="{$item->slug}">Bearbeiten
                            </button>
                            <button id="item_{$item->id}_del" class="btn btn-xs btn-danger del_item" data-slug="{$itenm->slug}">Löschen</button>
                        </td>
                    </tr>
                {/foreach}
                </tbody>
            </table>
        </div>
    {/if}
</div>