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

Revision

Revision 98 | Revision 109 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
{extends file="index.tpl"}
2
{block name="maincontent"}
87 lars 3
    <!-- $Id: manufacturerList.tpl 100 2023-07-14 21:40:24Z lars $ BEGIN -->
2 lars 4
    <script>
5
        $(function (){
85 lars 6
            $('#editDlg').dialog({
2 lars 7
                autoOpen:false,
8
                modal:true,
9
                resizable:false,
98 lars 10
                width:800,
11
                buttons:[
12
                    {
13
                        text:"OK",
14
                        icon:"ui-icon-check",
15
                        click:function (){
100 lars 16
                            $.post("/Online-Shop/manufacturers/"+$("#ID").val(),$('#manufacturerForm').serializeArray(),function(){
98 lars 17
                                $('#editDlg').dialog("close")
18
                                location.reload()
19
                            });
20
                        }
21
                    },
22
                    {
23
                        text:"Abbrechen",
24
                        icon:"ui-icon-cancel",
25
                        click:function (){
100 lars 26
                            $('#editDlg').dialog("close");
98 lars 27
                        }
28
                    }
29
                ]
2 lars 30
            })
31
            $("#new").uibutton({
32
                icons:{
33
                    primary:"ui-icon-plus"
34
                }
35
            }).click(function()
36
            {
85 lars 37
                let url="/Online-Shop/manufacturers/create/";
38
                $('#editDlg').load(url).dialog("open");
2 lars 39
            });
40
            $(".edit").uibutton({
41
                icons:{
42
                    primary:"ui-icon-pencil"
43
                }
44
            }).click(function() {
86 lars 45
                let url="/Online-Shop/manufacturers/"+$(this).attr("data-id")+"/edit/";
85 lars 46
                $('#editDlg').load(url).dialog("open");
2 lars 47
            });
48
            $(".del").uibutton({
49
                icons:{
50
                    primary:"ui-icon-trash"
51
                }
52
            })
87 lars 53
            $("#dataTable").dataTable({
2 lars 54
                "lengthMenu": [[100, -1], [100, "Alle"]],
55
                "language": {
56
                    "url": "/js/DataTables-1.10.19/German.json"
57
                }
58
            });
59
        })
60
    </script>
61
    <button id="new"></button>
62
    <br><br>
87 lars 63
    <table style="width:100%" id="dataTable">
2 lars 64
        <thead>
65
        <tr>
66
            <th>Name</th>
67
            <th>Aktionen</th>
68
        </tr>
69
        </thead>
70
        <tbody>
85 lars 71
        {foreach $manufacturers as $manufacturer}
2 lars 72
            <tr>
85 lars 73
                <td>{$manufacturer.name}</td>
2 lars 74
                <td>
85 lars 75
                    <button class="edit" data-id="{$manufacturer.id}"></button>
76
                    <button class="del" data-id="{$manufacturer.id}"></button>
2 lars 77
                </td>
78
            </tr>
79
        {/foreach}
80
        </tbody>
81
    </table>
85 lars 82
    <div id="editDlg"></div>
87 lars 83
    <!-- $Id: manufacturerList.tpl 100 2023-07-14 21:40:24Z lars $ END -->
2 lars 84
{/block}