diff options
-rw-r--r-- | devel/views.py | 5 | ||||
-rw-r--r-- | packages/utils.py | 7 | ||||
-rw-r--r-- | templates/devel/index.html | 50 |
3 files changed, 59 insertions, 3 deletions
diff --git a/devel/views.py b/devel/views.py index 694ed6dc..0002df04 100644 --- a/devel/views.py +++ b/devel/views.py @@ -18,6 +18,7 @@ from main.models import Package, PackageDepend, PackageFile, TodolistPkg from main.models import Arch, Repo from main.models import UserProfile from packages.models import PackageRelation +from packages.utils import get_signoff_groups from todolists.utils import get_annotated_todolists from .utils import get_annotated_maintainers @@ -48,6 +49,9 @@ def index(request): todolists = get_annotated_todolists() todolists = [todolist for todolist in todolists if todolist.incomplete_count > 0] + signoffs = sorted(get_signoff_groups(user=request.user), + key=operator.attrgetter('pkgbase')) + maintainers = get_annotated_maintainers() maintained = PackageRelation.objects.filter( @@ -70,6 +74,7 @@ def index(request): 'orphan': orphan, 'flagged' : flagged, 'todopkgs' : todopkgs, + 'signoffs': signoffs } return direct_to_template(request, 'devel/index.html', page_dict) diff --git a/packages/utils.py b/packages/utils.py index b21ac557..0df0e382 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -330,7 +330,7 @@ SELECT DISTINCT p1.pkgbase, r.name cursor.execute(sql, params) return dict(cursor.fetchall()) -def get_signoff_groups(repos=None): +def get_signoff_groups(repos=None, user=None): if repos is None: repos = Repo.objects.filter(testing=True) repo_ids = [r.pk for r in repos] @@ -340,6 +340,11 @@ def get_signoff_groups(repos=None): packages = test_pkgs.order_by('pkgname') packages = attach_maintainers(packages) + # Filter by user if asked to do so + if user is not None: + packages = [p for p in packages if user == p.packager + or user in p.maintainers] + # Collect all pkgbase values in testing repos pkgtorepo = get_target_repo_map(repos) diff --git a/templates/devel/index.html b/templates/devel/index.html index d3f7ec3b..06cf10ab 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -15,8 +15,8 @@ <thead> <tr> <th>Name</th> - <th>Repo</th> <th>Version</th> + <th>Repo</th> <th>Arch</th> <th>Flagged</th> <th>Last Updated</th> @@ -26,8 +26,8 @@ {% for pkg in flagged %} <tr class="{% cycle 'odd' 'even' %}"> <td>{% pkg_details_link pkg %}</td> - <td>{{ pkg.repo.name }}</td> <td>{{ pkg.full_version }}</td> + <td>{{ pkg.repo.name }}</td> <td>{{ pkg.arch.name }}</td> <td>{{ pkg.flag_date|date }}</td> <td>{{ pkg.last_update|date }}</td> @@ -96,6 +96,47 @@ </tbody> </table> + <h3>Signoff Status</h3> + + <table id="dash-signoffs" class="results"> + <thead> + <tr> + <th>Name</th> + <th>Version</th> + <th>Arch</th> + <th>Target Repo</th> + <th>Last Updated</th> + <th>Approved</th> + <th>Signoffs</th> + </tr> + </thead> + <tbody> + {% for group in signoffs %} + <tr class="{% cycle 'odd' 'even' %}"> + <td>{% pkg_details_link group.package %}</td> + <td>{{ group.version }}</td> + <td>{{ group.arch.name }}</td> + <td>{{ group.target_repo }}</td> + <td>{{ group.last_update|date }}</td> + {% if group.specification.known_bad %} + <td class="approval signoff-bad">Bad</td> + {% else %} + {% if not group.specification.enabled %} + <td class="approval signoff-disabled">Disabled</td> + {% else %} + <td class="approval signoff-{{ group.approved|yesno }}">{{ group.approved|yesno|capfirst }}</td> + {% endif %} + {% endif %} + <td><ul class="signoff-list"> + {% for signoff in group.signoffs %} + <li class="signed-username" title="Signed off by {{ signoff.user }}">{{ signoff.user }}{% if signoff.revoked %} (revoked){% endif %}</li> + {% endfor %} + </ul></td> + </tr> + {% endfor %} + </tbody> + </table> + <h3>Developer Reports</h3> <ul> <li><a href="reports/big/">Big</a>: @@ -255,6 +296,11 @@ $(document).ready(function() { {widgets: ['zebra'], sortList: [[0,0], [1,0]]}); $("#dash-todo:not(:has(tbody tr.empty))").tablesorter( {widgets: ['zebra'], sortList: [[1,1]]}); + $("#dash-signoffs:not(:has(tbody tr.empty))").tablesorter({ + widgets: ['zebra'], + sortList: [[0,0]], + headers: { 6: {sorter: false } } + }); $(".dash-stats").tablesorter({ widgets: ['zebra'], sortList: [[0,0]], |