From: Michael Tremer Date: Fri, 24 Jun 2022 14:09:23 +0000 (+0000) Subject: web: Create a new bug list X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df69af7198378d20bfa3de5e003802d342ac3157;p=pbs.git web: Create a new bug list Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 73033c18..71031c08 100644 --- a/Makefile.am +++ b/Makefile.am @@ -127,6 +127,7 @@ web_PYTHON = \ src/web/__init__.py \ src/web/auth.py \ src/web/base.py \ + src/web/bugs.py \ src/web/builders.py \ src/web/builds.py \ src/web/distributions.py \ @@ -190,6 +191,13 @@ dist_templates_DATA = \ templatesdir = $(datadir)/templates +templates_bugsdir = $(templatesdir)/bugs + +dist_templates_bugs_modules_DATA = \ + src/templates/bugs/modules/list.html + +templates_bugs_modulesdir = $(templates_bugsdir)/modules + dist_templates_builders_DATA = \ src/templates/builders/delete.html \ src/templates/builders/detail.html \ diff --git a/src/buildservice/bugtracker.py b/src/buildservice/bugtracker.py index 0ced1904..f78b9005 100644 --- a/src/buildservice/bugtracker.py +++ b/src/buildservice/bugtracker.py @@ -154,6 +154,12 @@ class Bug(base.Object): def init(self, data): self.data = data + def __repr__(self): + return "<%s #%s>" % (self.__class__.__name__, self.id) + + def __str__(self): + return "#%s" % self.id + def __eq__(self, other): if isinstance(other, self.__class__): return self.id == other.id diff --git a/src/templates/bugs/modules/list.html b/src/templates/bugs/modules/list.html new file mode 100644 index 00000000..378b87dc --- /dev/null +++ b/src/templates/bugs/modules/list.html @@ -0,0 +1,23 @@ + + + {% for bug in bugs %} + + + + + + {% end %} + +
+ {{ bug }} + + {{ bug.summary }} + +
+ + {{ bug.status }} {% if bug.resolution %}{{ bug.resolution }}{% end %} + + {% if bug.assignee %} + ‐ {% module LinkToUser(bug.assignee) %} + {% end %} +
diff --git a/src/templates/package-detail-list.html b/src/templates/package-detail-list.html index 40b3e8db..ee7be166 100644 --- a/src/templates/package-detail-list.html +++ b/src/templates/package-detail-list.html @@ -80,27 +80,16 @@ {% end %} {% if bugs %} -
-
-

- {{ _("Open bugs") }} -

-
- -
-
-
- {% module BugsTable(package, bugs) %} -
-
+
{{ _("Open Bugs In This Package") }}
+ + {% module BugsList(bugs) %} + + + {{ _("Show All Bugs") }} + + + + {{ _("File A New Bug") }} + {% end %} {% end block %} diff --git a/src/web/__init__.py b/src/web/__init__.py index 1476b3b8..9646abf0 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -12,6 +12,7 @@ from ..constants import * # Import all handlers from . import auth +from . import bugs from . import builders from . import builds from . import distributions @@ -43,6 +44,9 @@ class Application(tornado.web.Application): "LogEntry" : ui_modules.LogEntryModule, "LogEntryComment" : ui_modules.LogEntryCommentModule, + # Bugs + "BugsList" : bugs.ListModule, + "BuildHeadline" : ui_modules.BuildHeadlineModule, "BuildsList" : builds.ListModule, "BuildStateWarnings" : ui_modules.BuildStateWarningsModule, diff --git a/src/web/bugs.py b/src/web/bugs.py new file mode 100644 index 00000000..4b065a7a --- /dev/null +++ b/src/web/bugs.py @@ -0,0 +1,28 @@ +#!/usr/bin/python3 +############################################################################### +# # +# Pakfire - The IPFire package management system # +# Copyright (C) 2022 Pakfire development team # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +import tornado.web + +from . import ui_modules + +class ListModule(ui_modules.UIModule): + def render(self, bugs): + return self.render_string("bugs/modules/list.html", bugs=bugs)