Commits

Guido Draheim  committed 9884c7e

use paginator for recordingfiles

  • Participants
  • Parent commits 714c116
  • Branches dvbcronrecording

Comments (0)

Files changed (2)

File src/dvbcronrecording/files.py

 from trac.perm import IPermissionRequestor
 from trac.web.chrome import ITemplateProvider
 from trac.config import PathOption
+from trac.util.presentation import Paginator
 
 from quoting import quote4, unquote4
 
             diskfree = commands.getoutput("df -h "+self.intodir)
             message =  "| \n".join([ item for item in diskfree.split("\n") if "/" in item ])
             # message = diskfree 
+        entries = self._file_entries(cursor, req)
         data = {}
         data['title'] = translate("Recorded Files Overview")
-        data['entries'] = self._file_entries(cursor, req)
+        data["_pagenum"] = req.args.get("_pagenum", "0")
+        data["_pagesize"] = req.args.get("_pagesize", "10")
+        data['datalist'] = Paginator(entries, int(data["_pagenum"]), int(data["_pagesize"]))
         data['message'] = unicode(message)
         data["_"] = translate
         add_stylesheet(req, PACKAGE+'/css/recordinglist.css')

File src/dvbcronrecording/templates/recordingfiles.html

     </tr>
     </thead>
     <tbody>
-        <tr py:for="item in entries" class="recordingfile">
+        <tr py:for="item in datalist" class="recordingfile">
            <td>
               <a href="${href.recording('file/remove/'+item.file)}">
                 <span class="delete">
         </tr>
     </tbody>
   </table>
+  <xi:include href="paginator_datalist.html" />
 
 </div>
 <hr />