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/>
<div id="pages">
<table id="pages_tbl">
        <th><a href="?sort_by=title">Name</a></th>
        <th><a href="?sort_by=slug">Path</a></th>
    %for page in pages:
      <td><a href="../${page.path()}/">${page.title}</a></td>
      <td>${page.parent.path() if page.parent else ''}</td>
        <div class="tagHandler">
          <ul id="tagHandler" class="tagHandler tagHandlerContainer">
          %for tag in page.tags:
            <li class="tagItem">${tag}</li>
      <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" />
    <% 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>
<div class="clear"></div>