Source

c5t / c5t / core / templates / pages / index.mak

Full commit
<%inherit file="local:templates.master"/>
<%! from c5t.core.lib import helpers as h %>
<%def name="title()">Page Listing</%def>

%if h.can_add(None):
  <a href="./new">New Page</a><br/>
%endif
<div id="pages">
<table id="pages_tbl">
    <tr>
        <th><a href="?sort_by=title">Name</a></th>
        <th><a href="?sort_by=slug">Path</a></th>
        <th>Parent</th>
        <th>Tags</th>
        <th></th>
    </tr>
    %for page in pages:
    <tr>
      <td><a href="../${page.path()}/">${page.title}</a></td>
      <td>${page.path()}</td>
      <td>${page.parent.path() if page.parent else ''}</td>
      <td>
        <div class="tagHandler">
          <ul id="tagHandler" class="tagHandler tagHandlerContainer">
          %for tag in page.tags:
            <li class="tagItem">${tag}</li>
          %endfor
          </ul>
        </div>
      </td>
      <td><a class="page_link" href="../${page.path()}/edit">Edit</a>
        <a class="page_link" href="../${page.path()}/new">Add Subpage</a>
        <form method="POST" action="../${page.path()}" class="button-to" id="main">
            <input type="hidden" name="_method" value="DELETE" />
            <input type="hidden" name="page_id" value="${page._id}" />
            <input onclick="return confirm('Are you sure you want to delete ${page.title.replace("'","\\'")}?');" class="delete" value="Delete" type="submit" />
        </form>
      </td>
    </tr>
    <% thetext = h.strip_tags(page.text) %>
    % if (thetext is None):
    <tr><td colspan="6" class="excerpt-td"><strong>Excerpt:</strong> No content</td></tr>
    % else:
    <tr><td colspan="6" class="excerpt-td"><strong>Excerpt:</strong> ${thetext[0:1000]} ${len(thetext) > 1000 and '...' or ''}</td></tr>
    %endif
    %endfor
</table>
</div>
<div class="clear"></div>