{# Copyright (C) 2023 Dirk Stöcker This software is licensed as described in the file COPYING, which you should have received as part of this distribution. The terms are also available at https://trac.edgewall.org/wiki/TracLicense. This software consists of voluntary contributions made by many individuals. For the exact contribution history, see the revision history and logs, available at https://trac.edgewall.org/. #} # extends 'layout.html' # block title # if author: ${_("Ticket Stats (%(author)s)" % {'author' : author})} # else: ${_("Ticket Stats")} # endif # endblock title </head> <body> # block content <div id="content" class="wiki"> <div class="trac-modifiedby"> For <a href="${last_1m}">last month</a>, <a href="${last_12m}">last year</a>, or <a href="${last_all}">all time</a> </div> <h1>${_("Statistics - Tickets")}</h1> <table> # if author: <tr><td width="150">${_("Author")}</td><td align="right">${author}</td></tr> # endif <tr><td width="150">${_("First ticket")}</td><td align="right">${mintime}</td></tr> <tr><td width="150">${_("Last ticket")}</td><td align="right">${maxtime}</td></tr> <tr><td width="150">${_("Ticket age")}</td><td align="right">${age}</td></tr> <tr><td width="150">${_("Reporters")}</td><td align="right">${reporters}</td></tr> <tr><td width="150">${_("Tickets")}</td><td align="right">${total}</td></tr> <tr><td width="150">${_("Tickets-per-year")}</td><td align="right">${peryear}</td></tr> <tr><td width="150">${_("Tickets-per-month")}</td><td align="right">${permonth}</td></tr> <tr><td width="150">${_("Tickets-per-day")}</td><td align="right">${perday}</td></tr> <tr><td width="150">${_("Tickets-per-hour")}</td><td align="right">${perhour}</td></tr> </table> # if history: <br /> <h2>${_("Open Tickets")}</h2> <div id="opentickets" style="width:600px;height:300px;"></div> <script language="javascript" type="text/javascript"> $(function () { var options = { lines: { show: true, fill: true }, xaxis: { mode: "time", timeformat: "%d %b %y" }, colors: [ "#afd8f8", "#cb4b4b" ], legend: { show: true, backgroundOpacity: 0, }, }; var d1 = [{%for stat in history%}[${stat.x},${stat.opened}]{%if not loop.last%},{%endif%}{%if not loop.last and stat.opened != history[loop.index0+1].opened%}[${history[loop.index0+1].x},${stat.opened}],{%endif%}{%endfor%}]; var d2 = [{%for stat in history%}[${stat.x},${stat.accepted}]{%if not loop.last%},{%endif%}{%if not loop.last and stat.accepted != history[loop.index0+1].accepted%}[${history[loop.index0+1].x},${stat.accepted}],{%endif%}{%endfor%}]; $.plot($("#opentickets"), [ { data: d1, label: 'Open' }, { data: d2, label: 'Accepted' } ], options); }); </script> <div id="openclosetickets" style="width:600px;height:300px;"></div> <script language="javascript" type="text/javascript"> $(function () { var options = { bars: { show: true }, xaxis: { mode: "time", timeformat: "%d %b %y" }, colors: [ "#4bcb4b", "#cb4b4b" ], legend: { show: true, backgroundOpacity: 0, }, }; var d1 = [{%for stat in history%}[${stat.x},${stat.openeddelta+stat.closeddelta}]{%if not loop.first%}{%if not loop.last%},{%endif%}{%endif%}{%endfor%}]; var d2 = [{%for stat in history%}[${stat.x},${stat.openeddelta}]{%if not loop.first%}{%if not loop.last%},{%endif%}{%endif%}{%endfor%}]; $.plot($("#openclosetickets"), [ { data: d1, label: 'Closed' }, { data: d2, label: 'Opened' } ], options); }); </script> # endif <br /> <h2>${_("Tickets by author")}</h2> <table id="ticketsbyauthor" class="tablesorter"> <thead> <tr> <th>${_("Author")}</th> <th>${_("Reports")}</th> <th>${_("Changes")}</th> </tr> </thead> <tbody> # for stat in byauthor: <tr> <td width="150"><a href="${stat.url}">${stat.name}</a></td> <td width="100" align="right">${stat.reports}</td> <td width="100" align="right">${stat.changes}</td> </tr> # endfor </tbody> </table> <script language="javascript" type="text/javascript"> $(document).ready(function() { $("#ticketsbyauthor").tablesorter( {sortList: [[1,1]]} ); }); </script> <br /> <h2>${_("Tickets by component")}</h2> <table id="ticketsbycomponent" class="tablesorter"> <thead> <tr> <th>${_("Component")}</th> <th>${_("Open")}</th> <th>${_("Total")}</th> </tr> </thead> <tbody> # for stat in bycomponent: <tr> <td width="150"><a href="${stat.url}">${stat.name}</a></td> <td width="100" align="right">${stat.open}</td> <td width="100" align="right">${stat.total}</td> </tr> # endfor </tbody> </table> <script language="javascript" type="text/javascript"> $(document).ready(function() { $("#ticketsbycomponent").tablesorter( {sortList: [[1,1]]} ); }); </script> <br /> <h2>${_("Tickets by milestone")}</h2> <table id="ticketsbymilestone" class="tablesorter"> <thead> <tr> <th>${_("Milestone")}</th> <th>${_("Open")}</th> <th>${_("Total")}</th> </tr> </thead> <tbody> # for stat in bymilestone: <tr> <td width="150"><a href="${stat.url}">${stat.name}</a></td> <td width="100" align="right">${stat.open}</td> <td width="100" align="right">${stat.total}</td> </tr> # endfor </tbody> </table> <script language="javascript" type="text/javascript"> $(document).ready(function() { $("#ticketsbymilestone").tablesorter( {sortList: [[1,1]]} ); }); </script> <br /> <h2>${_("Most active tickets")}</h2> <table> # for stat in active: <tr> <td width="50"><a href="${stat.url}">${stat.id}</a></td> <td width="150"><a href="${stat.url2}">${stat.component}</a></td> <td width="350">${stat.name}</td> <td width="75" align="right">${stat.count}</td> <td width="75" align="right">${stat.percent}%</td> </tr> # endfor </table> <br /> <h2>${_("Oldest open tickets")}</h2> <table> # for stat in oldest: <tr> <td width="50"><a href="${stat.url}">${stat.id}</a></td> <td width="150"><a href="${stat.url2}">${stat.component}</a></td> <td width="350">${stat.name}</td> <td width="100" align="right">${stat.time}</td> </tr> # endfor </table> <br /> <h2>${_("Latest tickets reported")}</h2> <table> # for stat in newest: <tr> <td width="50"><a href="${stat.url}">${stat.id}</a></td> <td width="150"><a href="${stat.url2}">${stat.component}</a></td> <td width="350">${stat.name}</td> <td width="100" align="right">${stat.time}</td> </tr> # endfor </table> <br /> <h2>${_("Latest tickets changed")}</h2> <table> # for stat in recent: <tr> <td width="50"><a href="${stat.url}">${stat.id}</a></td> <td width="150"><a href="${stat.url2}">${stat.component}</a></td> <td width="350">${stat.name}</td> <td width="100" align="right">${stat.time}</td> </tr> # endfor </table> </div> #endblock content </body> </html>