Commits

Nikolaj Sjujskij committed cdcdaa9

Display ticket reporter's name in link popup title

  • Participants
  • Parent commits 6a8ccae

Comments (0)

Files changed (3)

     pass
 
 # query to fetch month data (with DATE_FIELD set)
-QUERY_MONTH = """SELECT ticket.id, ticket.owner, ticket.summary,
+QUERY_MONTH = """SELECT ticket.id, ticket.owner, ticket.summary, ticket.reporter,
                         ticket.status, ticket_custom.value AS due_date
                 FROM ticket INNER JOIN ticket_custom
                 ON ticket.id = ticket_custom.ticket
 
 # query to fetch tickets closed this month without DATE_FIELD set
 QUERY_UNSET_DATE = """SELECT DISTINCT ON (ticket.id)
-                            ticket.id, ticket.owner, ticket.summary,
+                            ticket.id, ticket.owner,
+                            ticket.summary, ticket.reporter,
                             ticket_change.time AS closed_at
                         FROM ticket INNER JOIN ticket_change
                             ON ticket.id = ticket_change.ticket
                     """.format(DATE_FIELD)
 
 # query to fetch open tickets
-QUERY_OPEN = "SELECT id, owner, summary FROM ticket WHERE status!='closed'"
+QUERY_OPEN = """SELECT id, owner, summary, reporter
+                FROM ticket WHERE status!='closed'"""
 # query to fetch tickets close not earlier than a week ago
-QUERY_CLSD_WEEK = """SELECT id, owner, summary FROM ticket WHERE status='closed'
-                     AND changetime > %s"""
+QUERY_CLSD_WEEK = """SELECT id, owner, summary,reporter FROM ticket
+                     WHERE status='closed' AND changetime>%s"""
 
 # prepare dictionary of DB connections
 TRACS = []
 from defaults import *
 from utils import dictify
 
+# prepare dictionary of DEVS: {login: name}
+DEVDICT = {}
+for dev in DEVS:
+    DEVDICT[dev[1]] = dev[0]
+del dev
+
 def other_colour(colour):
     return 'dark' if colour == 'light' else 'light'
 
     month, year = (basedate.month, basedate.year)
     context = {
                'devs': DEVS,
+               'devdict': DEVDICT,
                'month_data': month_data,
                'calendar': calendar.monthcalendar(year, month),
                'weekhdr': calendar.weekheader(3).split(' '),

File templates/index.html

                     <span class="project_name">{{ trac }}</span>
                     {% for ticket in tickets %}
                     <p class="{{ ticket.status }}">
-                    <a href="{{ ticket.base_url }}/ticket/{{ ticket.id }}">
+                    <a href="{{ ticket.base_url }}/ticket/{{ ticket.id }}"
+                       title="{{ devdict.get(ticket.reporter, ticket.reporter) }}">
                         <span class="num">#{{ ticket.id }}</span>:
                         {{ ticket.summary }}</a>
                     </p>
             <ul>
             {% for ticket in tickets %}
                 <li>
-                    <a href="{{ ticket.base_url }}/ticket/{{ ticket.id }}">
+                <a href="{{ ticket.base_url }}/ticket/{{ ticket.id }}"
+                   title="{{ devdict.get(ticket.reporter, ticket.reporter) }}">
                         <span class="num">#{{ ticket.id }}</span>:
                         {{ ticket.summary }}</a>
                 </li>
             <ul>
             {% for ticket in tickets %}
                 <li>
-                    <a href="{{ ticket.base_url }}/ticket/{{ ticket.id }}">
+                    <a href="{{ ticket.base_url }}/ticket/{{ ticket.id }}"
+                       title="{{ devdict.get(ticket.reporter, ticket.reporter) }}">
                         <span class="num">#{{ ticket.id }}</span>:
                         {{ ticket.summary }}</a>
                 </li>