# -*- coding: utf-8 -*-
<%! from babel.dates import format_date, format_datetime, format_time %>
<%inherit file="/core/hide-right.mak"/>
<%def name="header()">
    % if c.title is not UNDEFINED:
    <title>{{package}} :: ${c.title or 'Index'}</title>
    % endif
    <link rel="stylesheet" type="text/css" href="/css/dashboard.css" />
    <script type="text/javascript" src="/js/thickbox.js">
</script>
    <link type="text/css" rel="stylesheet" href="/css/thickbox.css" media="screen" />
</%def>
<%def name="lhcolumn()">
    <%include file="./adminnav.mak" />
    <%include file="./motd.mak" />
</%def>
<%def name="content()">
    <div class="edith1" style="margin-top:0;"><span class="warn">${_('Recent Changes')}</span></div>
    <table width="100%" class="editlist">
        <tr>
            <th>${_('Change')}</th>
            <th>${_('Date')}</th>
            <th style="text-align:center;">${_('User')}</th>
            <th style="text-align:center;">${_('Edit')}</th>
        </tr>
        <tr><td colspan="4" style="padding: 0.5em;"><hr /></td></tr>
    % for change in c.changes:
        <tr>
            <td><img src='/img/silk/${change.item}_${change.action}.png' alt=""/> 
                % if change.action is 'delete':
                    ${h.truncate(change.content,
                                      length=30, indicator='...', 
                                      whole_word=True)|n}
                % else:
                    <a class="thickbox" href="${h.url('%ss_popup'%change.item.encode('ascii'), id=change.refid)}?height=400&amp;width=600"
                    title="Changelog item ${change.id}"
                    >${h.truncate(change.content,
                                       length=30, 
                                       indicator='...', 
                                       whole_word=True)|n}</a>
                % endif
            </td>
            <td>
                ${format_datetime(
                    change.date, "hh:mm a, EEE MMM dd ''yy", locale='en')|n}
            </td>
            <td style="text-align:center;">${change.user.username|n}</td>
            <td style="text-align:center;">
               <a href="${h.url('edit_%s' % h.literal(change.item), id=change.refid)}" title="${_('Edit')}"
               ><img src="/img/silk/pencil.png" alt=""/></a>
            </td>
        </tr>
    % endfor
    </table>
</%def>
<%def name="lhcolumn()">
    <%include file="./adminnav.mak" />
    <%include file="./motd.mak" />
</%def>
