Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

<section class="wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><i class="icon_document_alt"></i> WOD Template Admin</h3>
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
                <li>WOD Template Admin</li>
            </ol>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <button class="btn btn-primary wod-template-new" style="margin-bottom:10px;">
                <i class="fa fa-plus"></i> New Template
            </button>
            <table class="table table-striped table-bordered table-hover" id="wodTemplateTable">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>Brand</th>
                    <th>State</th>
                    <th>Columns</th>
                    <th>Mail To</th>
                    <th>Active</th>
                    <th>Actions</th>
                </tr>
                </thead>
                <tbody>
                    #foreach($t in $templates)
                    <tr>
                        <td>$t.getId()</td>
                        <td>$t.getBrand()</td>
                        <td>$t.getState()</td>
                        <td>
                            <span class="badge">$columnCountMap.get($t.getId()) columns</span>
                        </td>
                        <td style="max-width:200px;overflow:hidden;text-overflow:ellipsis;">$t.getMailTo()</td>
                        <td>
                            #if($t.isActive())
                                <span class="label label-success">Active</span>
                            #else
                                <span class="label label-default">Inactive</span>
                            #end
                        </td>
                        <td>
                            <button class="btn btn-xs btn-info wod-template-edit" data-id="$t.getId()">
                                <i class="fa fa-pencil"></i> Edit
                            </button>
                            #if($t.isActive())
                                <button class="btn btn-xs btn-danger wod-template-delete" data-id="$t.getId()">
                                    <i class="fa fa-trash"></i> Deactivate
                                </button>
                            #end
                        </td>
                    </tr>
                    #end
                </tbody>
            </table>
        </div>
    </div>
</section>

<script type="text/javascript">
    $(document).ready(function () {
        $('#wodTemplateTable').DataTable({
            "bPaginate": true,
            "bFilter": true,
            "bInfo": false,
            "order": [[0, "desc"]],
            "pageLength": 25
        });
    });
</script>