From: Michael Tremer Date: Thu, 13 Oct 2022 10:46:54 +0000 (+0000) Subject: web: Drop more unused UI modules X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f14be3499c32cdc2b06930ca563d62fea353bc8;p=pbs.git web: Drop more unused UI modules Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 889f7ae8..d43aed56 100644 --- a/Makefile.am +++ b/Makefile.am @@ -269,21 +269,15 @@ dist_templates_modules_DATA = \ src/templates/modules/commits-table.html \ src/templates/modules/commit-message.html \ src/templates/modules/files-table.html \ - src/templates/modules/jobs-table.html \ src/templates/modules/link-to-user.html \ src/templates/modules/log-files-table.html \ src/templates/modules/modal-base.html \ src/templates/modules/modal-build-comment.html \ src/templates/modules/modal-build-push.html \ src/templates/modules/modal-build-unpush.html \ - src/templates/modules/package-header.html \ src/templates/modules/packages-files-table.html \ - src/templates/modules/packages-table.html \ - src/templates/modules/package-table-detail.html \ - src/templates/modules/repo-actions-table.html \ src/templates/modules/source-table.html \ - src/templates/modules/text.html \ - src/templates/modules/watchers-sidebar-table.html + src/templates/modules/text.html templates_modulesdir = $(templatesdir)/modules diff --git a/src/templates/modules/jobs-table.html b/src/templates/modules/jobs-table.html deleted file mode 100644 index 44148720..00000000 --- a/src/templates/modules/jobs-table.html +++ /dev/null @@ -1,72 +0,0 @@ - -
- - - - - - - - - - - {% if jobs %} - {% for job in jobs %} - - - - - - - {% end %} - - {% if not build.supported_arches == "all" %} - - - - {% end %} - {% else %} - - - - {% end %} - -
{{ _("Arch") }}{{ _("State") }}{{ _("Host") }}{{ _("Duration") }}
- {{ job.arch }} - - {% if job.state == "pending" %} - {{ _("Pending") }} - {% elif job.state == "failed" %} - {{ _("Failed") }} - {% elif job.state == "dispatching" %} - {{ _("Dispatching") }} - {% elif job.state == "finished" %} - {{ _("Finished") }} - {% elif job.state == "running" %} - {{ _("Running") }} - {% elif job.state == "aborted" %} - {{ _("Aborted") }} - {% else %} - {{ job.state }} - {% end %} - - {% if job.builder %} - {{ job.builder.name }} - {% else %} - {{ _("N/A") }} - {% end %} - - {% if job.state == "running" %} - {{ _("Running since %s") % friendly_time(job.duration) }} - {% elif job.duration %} - {{ friendly_time(job.duration) }} - {% else %} - {{ _("Not finished, yet.") }} - {% end %} -
- {{ _("This package only supports %s.") % locale.list(build.supported_arches.split()) }} -
{{ _("No jobs, yet.") }}
-
diff --git a/src/templates/modules/package-header.html b/src/templates/modules/package-header.html deleted file mode 100644 index 6308bd4d..00000000 --- a/src/templates/modules/package-header.html +++ /dev/null @@ -1,37 +0,0 @@ -

- {% module Text(pkg.description) %} -

- -
- - - {% if pkg.url %} - - - - - {% end %} - {% if pkg.license %} - - - - - {% end %} - - {% if pkg.groups %} - - - - - {% end %} - - {% if pkg.maintainer %} - - - - - {% end %} - - -
{{ _("Home") }}{% raw linkify(pkg.url, shorten=True) %}
{{ _("License") }}{{ pkg.license }}
{{ _("Group", "Groups", len(pkg.groups)) }}{{ locale.list(pkg.groups) }}
{{ _("Maintainer") }}{% module LinkToUser(pkg.maintainer) %}
-
\ No newline at end of file diff --git a/src/templates/modules/package-table-detail.html b/src/templates/modules/package-table-detail.html deleted file mode 100644 index 318e80dd..00000000 --- a/src/templates/modules/package-table-detail.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/src/templates/modules/packages-table.html b/src/templates/modules/packages-table.html deleted file mode 100644 index 34b36825..00000000 --- a/src/templates/modules/packages-table.html +++ /dev/null @@ -1,28 +0,0 @@ -
- - - - - - - - - - - {% for package in packages %} - - - - - - - {% end %} - -
{{ _("Name") }}{{ _("Summary") }}{{ _("Size") }} 
- {{ package.friendly_name }} - {{ package.summary }}{{ format_size(package.filesize) }} - - {{ _("Download") }} - -
-
\ No newline at end of file diff --git a/src/templates/modules/repo-actions-table.html b/src/templates/modules/repo-actions-table.html deleted file mode 100644 index a59611e3..00000000 --- a/src/templates/modules/repo-actions-table.html +++ /dev/null @@ -1,45 +0,0 @@ -
- {% for action in actions %} -
- {{ action.pkg.friendly_name }} - {{ _("added %s") % locale.format_date(action.time_added) }} - - {% if current_user and action.have_permission(current_user) %} -

- {% if action.is_doable() %} - {{ _("Run") }} - {% end %} - {{ _("Remove action") }} -

- {% end %} - -
-

- {% if action.score_needed %} - {{ _("One more score needed.", "%(score)s more scores needed.", action.score_needed) % { "score" : action.score_needed } }} - {% else %} - {{ _("No more scores needed.") }} - {% end %} -
- {% if action.pkg.maintainer %} - {{ _("Maintainer: %s") % action.pkg.maintainer }} -
- {% end %} - {{ _("Go to package description") }} -
-

-
- - -
- {% end %} -
-
 
diff --git a/src/templates/modules/watchers-sidebar-table.html b/src/templates/modules/watchers-sidebar-table.html deleted file mode 100644 index 122e3275..00000000 --- a/src/templates/modules/watchers-sidebar-table.html +++ /dev/null @@ -1,73 +0,0 @@ -

- - {% if current_user and current_user in watchers %} - {% if len(watchers) == 1 %} - {{ _("You.") }} - {% elif len(watchers) == 2 %} - {{ _("You and one other.") }} - {% else %} - {{ _("You and %s others.") % (len(watchers) - 1) }} - {% end %} - {% else %} - {{ _("One person.", "%(num)s people.", len(watchers)) % { "num" : len(watchers) } }} - {% end %} - -

- - diff --git a/src/web/__init__.py b/src/web/__init__.py index 31c5f136..b8110b3d 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -74,17 +74,11 @@ class Application(tornado.web.Application): "CommitMessage" : ui_modules.CommitMessageModule, "CommitsTable" : ui_modules.CommitsTableModule, "JobState" : ui_modules.JobStateModule, - "JobsTable" : ui_modules.JobsTableModule, "FilesTable" : ui_modules.FilesTableModule, "LinkToUser" : ui_modules.LinkToUserModule, "LogFilesTable" : ui_modules.LogFilesTableModule, - "PackagesTable" : ui_modules.PackagesTableModule, - "PackageTable2" : ui_modules.PackageTable2Module, - "PackageHeader" : ui_modules.PackageHeaderModule, "PackageFilesTable" : ui_modules.PackageFilesTableModule, - "RepoActionsTable" : ui_modules.RepoActionsTableModule, "SourceTable" : ui_modules.SourceTableModule, - "WatchersSidebarTable" : ui_modules.WatchersSidebarTableModule, "HeadingDate" : ui_modules.HeadingDateModule, diff --git a/src/web/ui_modules.py b/src/web/ui_modules.py index 1361efd9..56def25b 100644 --- a/src/web/ui_modules.py +++ b/src/web/ui_modules.py @@ -122,18 +122,6 @@ class HeadingDateModule(UIModule): return self.locale.format_date(date, shorter=True, relative=False) -class PackagesTableModule(UIModule): - def render(self, job, packages): - return self.render_string("modules/packages-table.html", job=job, - packages=packages) - - -class PackageTable2Module(UIModule): - def render(self, packages): - return self.render_string("modules/package-table-detail.html", - packages=packages) - - class FilesTableModule(UIModule): def render(self, files): return self.render_string("modules/files-table.html", files=files) @@ -145,11 +133,6 @@ class LogFilesTableModule(UIModule): files=files) -class PackageHeaderModule(UIModule): - def render(self, pkg): - return self.render_string("modules/package-header.html", pkg=pkg) - - class PackageFilesTableModule(UIModule): def render(self, pkg, filelist): return self.render_string("modules/packages-files-table.html", @@ -277,15 +260,6 @@ class JobStateModule(UIModule): return """%s""" % (" ".join(classes), text) -class JobsTableModule(UIModule): - def render(self, build, jobs=None, type="release"): - if jobs is None: - jobs = build.jobs - - return self.render_string("modules/jobs-table.html", build=build, - jobs=jobs, type=type) - - class JobsListModule(UIModule): def render(self, jobs, show_arch_only=False, show_packages=False): return self.render_string("modules/jobs/list.html", jobs=jobs, @@ -308,23 +282,6 @@ class BuildOffsetModule(UIModule): return self.render_string("modules/build-offset.html") -class RepoActionsTableModule(UIModule): - def render(self, repo): - actions = repo.get_actions() - - return self.render_string("modules/repo-actions-table.html", - repo=repo, actions=actions) - - -class WatchersSidebarTableModule(UIModule): - def render(self, build, watchers, limit=5): - # Sort the watchers by their realname. - watchers.sort(key=lambda watcher: watcher.realname) - - return self.render_string("modules/watchers-sidebar-table.html", - build=build, watchers=watchers, limit=limit) - - class SelectLocaleModule(UIModule): LOCALE_NAMES = [ # local code, English name, name