denny/ShinyCMS

View on GitHub
root/admin/events/list_events.tt

Summary

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

<table class="list">
    <tr>
        <th class="main">
            Event
        </th>
        <th>
            Start Date
        </th>
        <th>
            Actions
        </th>
    </tr>
    [%- FOREACH event IN events.all %]
    <tr class="showfocus">
        <td>
            [% event.name | html %]
        </td>
        <td>
            [% event.start_date.day %] [% event.start_date.month_abbr %] [% event.start_date.year %]
        </td>
        <td>
            <a class="action" href="[% c.uri_for( '/events', event.start_date.year, event.start_date.month, event.url_name ) %]">View</a>
            <a class="action" href="[% c.uri_for( 'edit', event.id ) %]">Edit</a>
        </td>
    </tr>
    [%- END %]
</table>

[%- pager = events.pager -%]
[%- page_count = events.count -%]
[%- INCLUDE 'admin/includes/pager.tt' -%]