Commits

Guido Draheim committed 6346997

notes_info_userlist

Comments (0)

Files changed (2)

src/usernotes/notes_info.py

 import sqlalchemy.sql.functions as by
 
 from db.session import context
-from db.model import NotesMail
+from db.model import NotesInfo, NotesFields
 
 import web_nav
 
     def do_userlist(self, req, domain):
         Item = collections.namedtuple("Item", ["mail_user", "mail_date"])
         session = context(self.env)
-        q = session.query(NotesMail.mail_user, by.max(NotesMail.mail_date))
-        q = q.group_by(NotesMail.mail_user).order_by(desc(NotesMail.mail_date))
+        q = session.query(NotesInfo.note_user, by.max(NotesInfo.modified_on))
+        q = q.group_by(NotesInfo.note_user).order_by(desc(NotesInfo.modified_on))
         datalist = []
         for item in q.all():
             datalist.append(Item(*item))
         add_stylesheet(req, PACKAGE + '/css/userscriptservernotes.css')
         add_script(req, 'common/js/trac.js')
         add_script(req, 'common/js/wikitoolbar.js')
-        return ('notes_mail_userlist.html', data, None)
+        return ('notes_info_userlist.html', data, None)
     def do_search(self, req, domain):
         mail_user = req.args.get("user", "")
         if not mail_user:

src/usernotes/templates/notes_info_userlist.html

+<!DOCTYPE html
+    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:py="http://genshi.edgewall.org/"
+      xmlns:xi="http://www.w3.org/2001/XInclude">
+  <xi:include href="layout.html" />
+  <xi:include href="macros.html" />
+<head><title>${title}</title></head>
+<body>
+<div id="ctxtnav" class="nav">
+</div>
+<xi:include href="usernotes_domains_nav.html" />
+
+<div id="content">
+<h2>${title}</h2>
+ 
+<py:if test="message">
+  <div class="error">
+    ${message}
+  </div>
+</py:if>
+ 
+<py:if test="content">
+  <div class="content">
+    ${content}
+  </div>
+</py:if>
+</div>
+
+<table>
+<tr py:for="item in datalist">
+  <td class="user"><a href="${base_url}?op=search&amp;user=${item.mail_user}" style="color: ${color_mail_user(item.mail_user)}">${item.mail_user}</a></td>
+  <td class="date">${format_datetime(item.mail_date.replace(tzinfo = req.tz), '%Y-%m-%d %H:%M')}</td>
+</tr>
+</table>
+
+</body>
+</html>