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

Revision

Revision 522 | Revision 524 | 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
        });
16
    })
17
</script>
514 lars 18
<div id="reiter">
19
    <ul>
20
        {if $directory->sub_dirs|count}
21
        <li>
22
            <a href="#subdirs">Unterkategorien</a>
23
        </li>
24
        {/if}
25
        {if $directory->items|count}
26
        <li>
27
            <a href="#items">Artikel</a>
28
        </li>
29
        {/if}
30
    </ul>
31
    {if $directory->sub_dirs|count}
32
        <div id="subdirs">
33
            <table id="directoryTable">
34
                <thead>
493 lars 35
                <tr>
514 lars 36
                    <th>Name</th>
37
                    <th>Bilder</th>
38
                    <th>Aktionen</th>
493 lars 39
                </tr>
514 lars 40
                </thead>
41
                <tbody>
42
                {foreach $directory->sub_dirs as $subDir}
43
                    <tr>
44
                        <td>{$subDir->name}</td>
45
                        <td>
46
                            {foreach $subDir->medium as $medium}
47
                                <img src="https://www.{config('webanos.shop')}/images/upload/{$medium->medium->folder}/mini/{$medium->medium->name}"
48
                                     alt="">
49
                            {/foreach}
50
                        </td>
51
                        <td>
52
                            <button id="dir_{$subDir->id}_edit" class="btn btn-xs btn-primary">Bearbeiten</button>
53
                            <button id="dir_{$subDir->id}_del" class="btn btn-xs btn-danger">Löschen</button>
54
                        </td>
55
                    </tr>
56
                {/foreach}
57
                </tbody>
58
            </table>
59
        </div>
60
    {/if}
61
    {if $directory->items|count}
62
        <div id="items">
63
            <table id="itemTable">
64
                <thead>
493 lars 65
                <tr>
514 lars 66
                    <th>Name</th>
67
                    <th>Bilder</th>
521 lars 68
                    <th>Hersteller</th>
522 lars 69
                    <th>Preise</th>
514 lars 70
                    <th>Aktionen</th>
493 lars 71
                </tr>
514 lars 72
                </thead>
73
                <tbody>
74
                {foreach $directory->items as $item}
75
                    <tr>
76
                        <td>{$item->name}</td>
77
                        <td>
78
                            {foreach $item->medium as $medium}
79
                                <img src="https://www.{config('webanos.shop')}/images/upload/{$medium->medium->folder}/mini/{$medium->medium->name}"
80
                                     alt="">
81
                            {/foreach}
82
                        </td>
83
                        <td>
521 lars 84
                            {$item->manufacturer->name}
85
                        </td>
86
                        <td>
522 lars 87
                            {foreach $item->price as $price}
523 lars 88
                                {if $price->preis > 0}
89
                                    {$price->preis|money_format}
90
                                {$else}
91
                                    {$price->preis|abs}%
92
                                {/if}
93
                                <br>
522 lars 94
                            {/foreach}
95
                        </td>
96
                        <td>
514 lars 97
                            <button id="item_{$item->id}_edit" class="btn btn-xs btn-primary">Bearbeiten</button>
98
                            <button id="item_{$item->id}_del" class="btn btn-xs btn-danger">Löschen</button>
99
                        </td>
100
                    </tr>
101
                {/foreach}
102
                </tbody>
103
            </table>
104
        </div>
105
    {/if}
520 lars 106
</div>