getlackey/lackey-cms

View on GitHub
modules/cms/server/views/tableview.dust

Summary

Maintainability
Test Coverage
{>"cms/cms/main"/}

{<body}
<section data-lky-component="table" class="table-header">

    <div class="left">
        <h2>{title}</h2>
        {?create}<a data-lky-btn {?create.javascript}data-lky-javascript={create.javascript}{/create.javascript} data-lky-hook="{?create.template}open-modal{/create.template}" {?create.template}data-lky-template="{create.template}"{/create.template} href="{?create.href}{create.href}{:else}{create}{/create.href}"  data-lky-href="{create.href}">Add New</a>{/create}
    </div>
    <div class="right">
        <input data-lky-hook="table.filter" type="search" placeholder="Search"/>
        <div class="overflow-wrap">
            <a class="overflow" data-lky-hook="table.actions"><img src="img/cms/cms/svg/overflow.svg" /></a>

            <div class="overflow-menu">
                <a class="tableAction" href="{route|base}.xlsx">Export XLSX</a>
                {#tableActions}
                    {?href}
                        <a class="tableAction" href="{href}">
                            {?icon}
                                <img src="{icon}"/>
                            {:else}
                                {label}
                            {/icon}
                        </a>
                    {:else}
                    {?api}
                        <button data-lky-api="{api}">
                    {:else}
                        <button data-lky-hook="{hook}" data-lky-id="{id}">
                    {/api}
                        {?icon}
                            <img src="{icon}"/>
                        {:else}
                            {label}
                        {/icon}
                        </button>
                    {/href}
                {/tableActions}
            </div>
        </div>
    </div>

    {! FILTER OPTIONS !}
    {?filterOptions}
        {>"cms/core/{filterOptions.template}"/}
    {/filterOptions}

    {! CONTENT TABLE !}
    {>"cms/core/table" table=data.table/}
</section>
{/body}