From: Michael Tremer Date: Sun, 23 Oct 2022 12:28:49 +0000 (+0000) Subject: jobs: Move the UI module to the correct place X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ef8936f5e758f90d4adbd706f2d93b0cfb2ae53;p=pbs.git jobs: Move the UI module to the correct place Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 4771b2fb..0e434e23 100644 --- a/Makefile.am +++ b/Makefile.am @@ -235,6 +235,11 @@ dist_templates_jobs_messages_DATA = \ templates_jobs_messagesdir = $(templates_jobsdir)/messages +dist_templates_jobs_modules_DATA = \ + src/templates/jobs/modules/list.html + +templates_jobs_modulesdir = $(templates_jobsdir)/modules + templates_messagesdir = $(templatesdir)/messages dist_templates_mirrors_DATA = \ @@ -255,11 +260,6 @@ dist_templates_modules_DATA = \ templates_modulesdir = $(templatesdir)/modules -dist_templates_modules_jobs_DATA = \ - src/templates/modules/jobs/list.html - -templates_modules_jobsdir = $(templates_modulesdir)/jobs - dist_templates_repos_DATA = \ src/templates/repos/create-custom.html \ src/templates/repos/builds.html \ diff --git a/src/templates/modules/jobs/list.html b/src/templates/jobs/modules/list.html similarity index 100% rename from src/templates/modules/jobs/list.html rename to src/templates/jobs/modules/list.html diff --git a/src/web/__init__.py b/src/web/__init__.py index b90730db..a592035f 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -52,7 +52,7 @@ class Application(tornado.web.Application): "EventUserMessage" : events.UserMessageModule, # Jobs - "JobsList" : ui_modules.JobsListModule, + "JobsList" : jobs.ListModule, # Packages "PackageInfo" : packages.InfoModule, diff --git a/src/web/jobs.py b/src/web/jobs.py index ba96ef2f..27879308 100644 --- a/src/web/jobs.py +++ b/src/web/jobs.py @@ -3,6 +3,7 @@ import tornado.web from . import base +from . import ui_modules class QueueHandler(base.BaseHandler): def get(self): @@ -90,3 +91,9 @@ class JobAbortHandler(base.BaseHandler): job.aborted_state = 0 self.redirect("/job/%s" % job.uuid) + + +class ListModule(ui_modules.UIModule): + def render(self, jobs, show_arch_only=False, show_packages=False): + return self.render_string("jobs/modules/list.html", jobs=jobs, + show_arch_only=show_arch_only, show_packages=show_packages) diff --git a/src/web/ui_modules.py b/src/web/ui_modules.py index 8b24e53d..f189be3f 100644 --- a/src/web/ui_modules.py +++ b/src/web/ui_modules.py @@ -91,12 +91,6 @@ class PackageFilesTableModule(UIModule): pkg=pkg, filelist=filelist) -class JobsListModule(UIModule): - def render(self, jobs, show_arch_only=False, show_packages=False): - return self.render_string("modules/jobs/list.html", jobs=jobs, - show_arch_only=show_arch_only, show_packages=show_packages) - - class SourceTableModule(UIModule): def render(self, distro, sources): return self.render_string("modules/source-table.html",