denny/ShinyCMS

View on GitHub
root/admin/shop/list_items.tt

Summary

Maintainability
Test Coverage
[%-    meta.title = 'List Shop Items' -%]

<table class="list">
    <tr>
        <th class="main">
            Item
        </th>
        <th>
            Actions
        </th>
    </tr>
    [%- FOREACH category IN categories.all %]
    <tr>
    <td class="subheading" colspan="2">
            <b>[% category.name | html %]</b>
        </td>
    </tr>
    [%- FOREACH item_category IN category.shop_item_categories %]
    [%- category_item = item_category.item -%]
    <tr class="showfocus">
        <td>
            [% category_item.name | html %]
        </td>
        <td>
            <a class="action" href="[% c.uri_for( '/shop/item', category_item.code ) %]">View</a>
            <a class="action" href="[% c.uri_for( '/admin/shop/item', category_item.id, 'edit' ) %]">Edit</a>
        </td>
    </tr>
    [%- END %]
    [%- END %]
</table>