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

Revision

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