From: Michael Tremer Date: Sun, 23 Oct 2022 15:13:50 +0000 (+0000) Subject: distro: Drop old source handlers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2102ba2425eeaf5af0e1d1e371d70776d66d98eb;p=pbs.git distro: Drop old source handlers Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 42cd14ae..07a63ed1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -157,10 +157,6 @@ webdir = $(buildservicedir)/web dist_templates_DATA = \ src/templates/base.html \ - src/templates/distro-source-commit-detail.html \ - src/templates/distro-source-commit-reset.html \ - src/templates/distro-source-commits.html \ - src/templates/distro-source-detail.html \ src/templates/index.html \ src/templates/jobs-abort.html \ src/templates/jobs-buildroot.html \ diff --git a/src/templates/distro-source-commit-detail.html b/src/templates/distro-source-commit-detail.html deleted file mode 100644 index 4c7987ae..00000000 --- a/src/templates/distro-source-commit-detail.html +++ /dev/null @@ -1,140 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ _("Commit") }}: {{ commit.revision }}{% end block %} - -{% block body %} - - - - -
- {% if source.gitweb or (current_user and current_user.is_admin()) %} -
-

- {{ _("Source") }}: {{ source.name }} -
- - {{ commit.revision[:7] }} - {{ commit.subject }} - -

-
-
- -
- {% else %} -
-

- {{ _("Source") }}: {{ source.name }} -
- - {{ commit.revision[:7] }} - {{ commit.subject }} - -

-
- {% end %} -
- - -
- {% if commit.message %} -
- {% else %} -
- {% end %} -
- - - - - - - - - - - - - - - - - - - -
{{ _("Revision") }}{{ commit.revision }}
{{ _("Date") }}{{ format_date(commit.date, full_format=True) }}
{{ _("Author") }}{% module LinkToUser(commit.author) %}
{{ _("Committer") }}{% module LinkToUser(commit.committer) %}
-
-
- {% if commit.message %} -
- {% module CommitMessage(commit) %} -
- {% end %} -
- -
-
-

- {{ _("Packages created from this commit") }} -

-
-
- -
-
- {% if commit.packages %} -
- - {% for pkg in commit.packages %} - - - - - {% end %} -
- {{ pkg.friendly_name }} - - {{ pkg.summary }} -
-
- {% else %} -

{{ _("There were no packages created from this commit.") }}

- {% end %} -
-
-{% end block %} diff --git a/src/templates/distro-source-commit-reset.html b/src/templates/distro-source-commit-reset.html deleted file mode 100644 index f9955189..00000000 --- a/src/templates/distro-source-commit-reset.html +++ /dev/null @@ -1,78 +0,0 @@ -{% extends "base.html" %} - -{% block body %} - - - - -
-
-
-

{{ _("Danger!") }}

- {{ _("This is a very dangerous action!") }}
- {{ _("Don't do it, if you are not absolutely sure what you are doing.") }} -
- -

- {{ _("This commit will be reset. Which means all packages associated with it will be deleted, and the commit will be parsed again.") }} - {{ _("This action may cause severe problems and may only be allowed when something went horribly wrong.") }} -

- - - {{ _("Reset commit") }} - -
-
- - {% if commit.packages %} -
-
-

{{ _("These packages will be deleted") }}

- - {% for pkg in commit.packages %} - - - - - {% end %} -
- {{ pkg.friendly_name }} - - {{ pkg.summary }} -
-
-
- {% end %} -{% end block %} diff --git a/src/templates/distro-source-commits.html b/src/templates/distro-source-commits.html deleted file mode 100644 index 32403c93..00000000 --- a/src/templates/distro-source-commits.html +++ /dev/null @@ -1,69 +0,0 @@ -{% extends "base.html" %} - -{% block body %} - - -
-
-

- {{ _("Distribution") }}: {{ distro.name }}
- {{ _("Source") }}: {{ source.name }} - {{ _("Commits") }} -

-
-
- -
-
-

- {{ _("Source repository") }}: - - {{ source.name }} - -

-
-
-
-
- {% module CommitsTable(distro, source, commits) %} -
-
- -
-
- -
-
-{% end block %} diff --git a/src/templates/distro-source-detail.html b/src/templates/distro-source-detail.html deleted file mode 100644 index d8c74fe9..00000000 --- a/src/templates/distro-source-detail.html +++ /dev/null @@ -1,75 +0,0 @@ -{% extends "base.html" %} - -{% block body %} - - -
-
-

- {{ _("Source") }}: {{ source.name }} -

-
-
- -
-
-
- - - {% if source.gitweb %} - - - - - {% end %} - - - - - - - - - -
{{ _("Gitweb") }} - - {{ source.gitweb }} - -
{{ _("Branch") }}{{ source.branch }}
{{ _("Imported commits") }}{{ len(source) }}
-
-
-
- -
-
-

{{ _("Latest commits") }}

-
-
-
-
- {% module CommitsTable(distro, source, commits) %} -
-
- -{% end block %} diff --git a/src/web/__init__.py b/src/web/__init__.py index 33bad7be..0a698750 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -157,15 +157,6 @@ class Application(tornado.web.Application): (r"/distros/(?P[A-Za-z0-9\-\.]+)/repos/(?P[A-Za-z0-9\-]+)/mirrorlist", repos.MirrorlistHandler), - (r"/distro/([A-Za-z0-9\-\.]+)/source/([A-Za-z0-9\-\.]+)", - distributions.DistroSourceDetailHandler), - (r"/distro/([A-Za-z0-9\-\.]+)/source/([A-Za-z0-9\-\.]+)/commits", - distributions.DistroSourceCommitsHandler), - (r"/distro/([A-Za-z0-9\-\.]+)/source/([A-Za-z0-9\-\.]+)/([\w]{40})", - distributions.DistroSourceCommitDetailHandler), - (r"/distro/([A-Za-z0-9\-\.]+)/source/([A-Za-z0-9\-\.]+)/([\w]{40})/reset", - distributions.DistroSourceCommitResetHandler), - # Mirrors (r"/mirrors", mirrors.MirrorListHandler), (r"/mirror/new", mirrors.MirrorNewHandler), diff --git a/src/web/distributions.py b/src/web/distributions.py index 3bd68f87..e078ce8b 100644 --- a/src/web/distributions.py +++ b/src/web/distributions.py @@ -48,105 +48,6 @@ class EditHandler(base.BaseHandler): self.redirect("/distros/%s" % distro.slug) -class DistroSourceDetailHandler(base.BaseHandler): - def get(self, slug, source_ident): - distro = self.backend.distros.get_by_slug(slug) - if not distro: - raise tornado.web.HTTPError(404, "Distro not found") - - source = distro.get_source(source_ident) - if not source: - raise tornado.web.HTTPError(404, "Source '%s' not found in distro '%s'" \ - % (source_ident, distro.name)) - - # Get the latest commits. - commits = source.get_commits(limit=5) - - self.render("distro-source-detail.html", distro=distro, source=source, - commits=commits) - - -class DistroSourceCommitsHandler(base.BaseHandler): - def get(self, slug, source_ident): - distro = self.backend.distros.get_by_slug(slug) - if not distro: - raise tornado.web.HTTPError(404, "Distro not found") - - source = distro.get_source(source_ident) - if not source: - raise tornado.web.HTTPError(404, "Source '%s' not found in distro '%s'" \ - % (source_ident, distro.name)) - - offset = self.get_argument("offset", 0) - try: - offset = int(offset) - except ValueError: - offset = 0 - - limit = self.get_argument("limit", 50) - try: - limit = int(limit) - except ValueError: - limit = 50 - - commits = source.get_commits(limit=limit, offset=offset) - - self.render("distro-source-commits.html", distro=distro, source=source, - commits=commits, limit=limit, offset=offset, number=50) - - -class DistroSourceCommitDetailHandler(base.BaseHandler): - def get(self, slug, source_ident, commit_ident): - distro = self.backend.distros.get_by_slug(slug) - if not distro: - raise tornado.web.HTTPError(404, "Distribution '%s' not found" % slug) - - source = distro.get_source(source_ident) - if not source: - raise tornado.web.HTTPError(404, "Source '%s' not found in distro '%s'" \ - % (source_ident, distro.name)) - - commit = source.get_commit(commit_ident) - if not commit: - raise tornado.web.HTTPError(404, "Commit '%s' not found in source '%s'" \ - % (commit_ident, source.name)) - - self.render("distro-source-commit-detail.html", distro=distro, - source=source, commit=commit) - - -class DistroSourceCommitResetHandler(base.BaseHandler): - @tornado.web.authenticated - def get(self, slug, source_ident, commit_ident): - distro = self.backend.distros.get_by_slug(slug) - if not distro: - raise tornado.web.HTTPError(404, "Distribution '%s' not found" % slug) - - source = distro.get_source(source_ident) - if not source: - raise tornado.web.HTTPError(404, "Source '%s' not found in distro '%s'" \ - % (source_ident, distro.name)) - - commit = source.get_commit(commit_ident) - if not commit: - raise tornado.web.HTTPError(404, "Commit '%s' not found in source '%s'" \ - % (commit_ident, source.name)) - - if not self.current_user.is_admin(): - raise tornado.web.HTTPError(403) - - confirmed = self.get_argument("confirmed", None) - if confirmed: - commit.reset() - - self.redirect("/distro/%s/source/%s/%s" % \ - (distro.slug, source.identifier, commit.revision)) - return - - self.render("distro-source-commit-reset.html", distro=distro, - source=source, commit=commit) - - class ListModule(ui_modules.UIModule): def render(self, distros): return self.render_string("distros/modules/list.html", distros=distros)