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

Revision

Revision 531 | Revision 540 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
497 lars 1
<script type="text/javascript">
511 lars 2
    $(function () {
515 lars 3
        $('#reiter').tabs();
497 lars 4
        $("#directoryTable").dataTable({
5
            "lengthMenu": [[100, -1], [100, "Alle"]],
6
            "language": {
7
                "url": "/js/DataTables-1.10.19/German.json"
8
            }
9
        });
10
        $("#itemTable").dataTable({
11
            "lengthMenu": [[100, -1], [100, "Alle"]],
12
            "language": {
13
                "url": "/js/DataTables-1.10.19/German.json"
14
            }
15
        });
531 lars 16
        $('.edit_item').click(function () {
17
            let aIdArr = $(this).attr("id").split("_");
18
            let aId = aIdArr[1];
539 lars 19
            $('#editItemDlg').load("/Online-Shop/item/" + aId + "/edit", function () {
530 lars 20
                $('#editItemDlg').dialog("open");
21
            })
529 lars 22
        })
497 lars 23
    })
24
</script>
514 lars 25
<div id="reiter">
26
    <ul>
27
        {if $directory->sub_dirs|count}
531 lars 28
            <li>
29
                <a href="#subdirs">Unterkategorien</a>
30
            </li>
514 lars 31
        {/if}
32
        {if $directory->items|count}
531 lars 33
            <li>
34
                <a href="#items">Artikel</a>
35
            </li>
514 lars 36
        {/if}
37
    </ul>
38
    {if $directory->sub_dirs|count}
39
        <div id="subdirs">
40
            <table id="directoryTable">
41
                <thead>
493 lars 42
                <tr>
514 lars 43
                    <th>Name</th>
44
                    <th>Bilder</th>
45
                    <th>Aktionen</th>
493 lars 46
                </tr>
514 lars 47
                </thead>
48
                <tbody>
49
                {foreach $directory->sub_dirs as $subDir}
50
                    <tr>
51
                        <td>{$subDir->name}</td>
52
                        <td>
53
                            {foreach $subDir->medium as $medium}
54
                                <img src="https://www.{config('webanos.shop')}/images/upload/{$medium->medium->folder}/mini/{$medium->medium->name}"
55
                                     alt="">
56
                            {/foreach}
57
                        </td>
58
                        <td>
531 lars 59
                            <button id="dir_{$subDir->id}_edit" class="btn btn-xs btn-primary edit_dir">Bearbeiten
60
                            </button>
529 lars 61
                            <button id="dir_{$subDir->id}_del" class="btn btn-xs btn-danger del_dir">Löschen</button>
514 lars 62
                        </td>
63
                    </tr>
64
                {/foreach}
65
                </tbody>
66
            </table>
67
        </div>
68
    {/if}
69
    {if $directory->items|count}
70
        <div id="items">
71
            <table id="itemTable">
72
                <thead>
493 lars 73
                <tr>
514 lars 74
                    <th>Name</th>
75
                    <th>Bilder</th>
521 lars 76
                    <th>Hersteller</th>
522 lars 77
                    <th>Preise</th>
514 lars 78
                    <th>Aktionen</th>
493 lars 79
                </tr>
514 lars 80
                </thead>
81
                <tbody>
82
                {foreach $directory->items as $item}
83
                    <tr>
84
                        <td>{$item->name}</td>
85
                        <td>
86
                            {foreach $item->medium as $medium}
87
                                <img src="https://www.{config('webanos.shop')}/images/upload/{$medium->medium->folder}/mini/{$medium->medium->name}"
88
                                     alt="">
89
                            {/foreach}
90
                        </td>
91
                        <td>
521 lars 92
                            {$item->manufacturer->name}
93
                        </td>
94
                        <td>
522 lars 95
                            {foreach $item->price as $price}
523 lars 96
                                {if $price->preis > 0}
97
                                    {$price->preis|money_format}
524 lars 98
                                {else}
523 lars 99
                                    {$price->preis|abs}%
100
                                {/if}
101
                                <br>
522 lars 102
                            {/foreach}
103
                        </td>
104
                        <td>
531 lars 105
                            <button id="item_{$item->id}_edit" class="btn btn-xs btn-primary edit_item">Bearbeiten
106
                            </button>
529 lars 107
                            <button id="item_{$item->id}_del" class="btn btn-xs btn-danger del_item">Löschen</button>
514 lars 108
                        </td>
109
                    </tr>
110
                {/foreach}
111
                </tbody>
112
            </table>
113
        </div>
114
    {/if}
520 lars 115
</div>