denny/ShinyCMS

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

Summary

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

[%- VIEW category_list %]
    [%- BLOCK list %]
        [%- FOREACH category IN item %]
        <tr class="showfocus">
            <td>
                [% category.name | html %]
            </td>
            <td>
                [% category.parent.name | html %]
            </td>
            <td>
                [% category.description | html %]
            </td>
            <td>
                <a class="action" href="[% c.uri_for( '/shop', 'category', category.url_name ) %]">View</a>
                <a class="action" href="[% c.uri_for( 'category', category.id, 'edit' ) %]">Edit</a>
            </td>
        </tr>
        [%- IF category.shop_categories %]
            [% view.print([category.shop_categories]) -%]
        [%- END %]
        [%- END %]
    [%- END %]
[%- END %]
<table class="list">
    <tr>
        <th>
            Category
        </th>
        <th>
            Parent Category
        </th>
        <th>
            Description
        </th>
        <th>
            Actions
        </th>
    </tr>
    [% category_list.print(categories) %]
</table>