]> git.ipfire.org Git - pbs.git/commitdiff
web: Drop comments pages
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 22 Jun 2022 10:42:31 +0000 (10:42 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 22 Jun 2022 10:42:31 +0000 (10:42 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/templates/builds/comments.html [deleted file]
src/templates/modules/comments-table.html [deleted file]
src/templates/user-profile.html
src/web/__init__.py
src/web/builds.py
src/web/ui_modules.py

index 829512bf32478c5bf78f95590762002e289d60db..1d30fcb3b12431456eda2b10357e74f84aa998bf 100644 (file)
@@ -207,7 +207,6 @@ dist_templates_builders_DATA = \
 templates_buildersdir = $(templatesdir)/builders
 
 dist_templates_builds_DATA = \
-       src/templates/builds/comments.html \
        src/templates/builds/index.html \
        src/templates/builds/show.html
 
@@ -260,7 +259,6 @@ dist_templates_modules_DATA = \
        src/templates/modules/build-offset.html \
        src/templates/modules/build-state-warnings.html \
        src/templates/modules/build-table.html \
-       src/templates/modules/comments-table.html \
        src/templates/modules/commits-table.html \
        src/templates/modules/commit-message.html \
        src/templates/modules/files-table.html \
diff --git a/src/templates/builds/comments.html b/src/templates/builds/comments.html
deleted file mode 100644 (file)
index fc9e72f..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-{% extends "../base.html" %}
-
-{% block title %}{{ _("Build comments") }}{% end block %}
-
-{% block body %}
-       <ul class="breadcrumb">
-               <li>
-                       <a href="/">{{ _("Home") }}</a>
-                       <span class="divider">/</span>
-               </li>
-               <li>
-                       <a href="/builds">{{ _("Builds") }}</a>
-                       <span class="divider">/</span>
-               </li>
-               {% if user %}
-                       <li>
-                               <a href="/builds/comments">{{ _("Comments") }}</a>
-                               <span class="divider">/</span>
-                       </li>
-                       <li class="active">
-                               <a href="/builds/comments/{{ user.name }}">{{ user.realname }}</a>
-                       </li>
-               {% else %}
-                       <li class="active">
-                               <a href="/builds/comments">{{ _("Comments") }}</a>
-                       </li>
-               {% end %}
-       </ul>
-
-       {% if user %}
-               <ul class="nav nav-pills pull-right">
-                       <li>
-                               <a href="/builds/comments">{{ _("Show all comments") }}</a>
-                       </li>
-               </ul>
-       {% end %}
-
-       <div class="page-header">
-               {% if user %}
-                       <h2>{{ _("%s's latest comments") % user.firstname }}</h2>
-               {% else %}
-                       <h2>{{ _("Build comments") }}</h2>
-               {% end %}
-       </div>
-
-       {% if comments %}       
-               <p>
-                       {% if user %}
-                               {{ _("This page shows %s's latest comments.") % user.firstname }}
-                       {% else %}
-                               {{ _("This page shows the latest comments on builds.") }}
-                       {% end %}
-                       {{ _("The Pakfire Build Service is all about social development and so, communicating with eath others is important. Please join.") }}
-               </p>
-
-               {% module Log(comments, show_build=True) %}
-
-               <ul class="pager">
-                       {% if have_prev %}
-                               <li class="previous">
-                                       <a href="?offset={{ offset - limit }}&limit={{ limit }}">&larr; {{ _("Newer") }}</a>
-                               </li>
-                       {% else %}
-                               <li class="previous disabled">
-                                       <a href="#">&larr; {{ _("Newer") }}</a>
-                               </li>
-                       {% end %}
-
-                       {% if have_next %}
-                               <li class="next">
-                                       <a href="?offset={{ offset + limit }}&limit={{ limit }}">{{ _("Older") }} &rarr;</a>
-                               </li>
-                       {% else %}
-                               <li class="next disabled">
-                                       <a href="#">{{ _("Older") }} &rarr;</a>
-                               </li>
-                       {% end %}
-               </ul>
-       {% elif not comments and user %}
-               <p class="muted">
-                       {{ _("%s did not comment on anything, yet.") % user.firstname }}
-               </p>
-       {% end %}
-{% end block %}
diff --git a/src/templates/modules/comments-table.html b/src/templates/modules/comments-table.html
deleted file mode 100644 (file)
index 0f22807..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<div class="comments">
-       {% if comments %}
-               {% for comment in comments %}
-                       <div class="comment {{ comment.vote }}">
-                               <p class="text">{{ comment.text }}</p>
-                               <span>
-                                       {% if show_package %}
-                                               <a href="/package/{{ comment.pkg.name }}/{{ comment.pkg.epoch }}/{{ comment.pkg.version }}/{{ comment.pkg.release }}">{{ _("on %s") % comment.pkg.friendly_name }}</a> -
-                                       {% end %}
-                                       {% if show_user %}
-                                               <a href="/user/{{ comment.user.name }}">{{ _("by %s") % comment.user.realname }}</a> -
-                                       {% end %}
-                                       {{ locale.format_date(comment.time_created) }}
-
-                                       {% if comment.time_updated %}
-                                               _("Updated") {{ locale.format_date(comment.time_updated) }}
-                                       {% end %}
-                               </span>
-                       </div>
-               {% end %}
-       {% else %}
-               <p>{{ _("No comments so far.") }}</p>
-       {% end %}
-</div>
-<div style="clear: both;">&nbsp;</div>
index 0bfd71916179e396b8cdb90a43e0533fb4fa0162..f0ded1e5ad06ac32f1f0c422d49bd9c031c6940f 100644 (file)
@@ -32,9 +32,6 @@
                                        {{ _("Actions") }}
                                </button>
                                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
-                                       <a class="dropdown-item" href="/builds/comments/{{ user.name }}">
-                                               {{ _("View comments") }}
-                                       </a>
                                        {% if current_user == user or current_user.is_admin() %}
                                                <a class="dropdown-item" href="/user/{{ user.name }}/edit">
                                                        <i class="icon-edit"></i>
index 30cc23b4cc36d063a07868f2ad2af30b15a82e2a..a8c554543cc25cf0fb0f6a93d1637b43f3ed4e62 100644 (file)
@@ -63,7 +63,6 @@ class Application(tornado.web.Application):
                                "CommitsTable"       : ui_modules.CommitsTableModule,
                                "JobState"           : ui_modules.JobStateModule,
                                "JobsTable"          : ui_modules.JobsTableModule,
-                               "CommentsTable"      : ui_modules.CommentsTableModule,
                                "FilesTable"         : ui_modules.FilesTableModule,
                                "LinkToUser"         : ui_modules.LinkToUserModule,
                                "LogTable"           : ui_modules.LogTableModule,
@@ -126,8 +125,6 @@ class Application(tornado.web.Application):
 
                        # Builds
                        (r"/builds", builds.IndexHandler),
-                       (r"/builds/comments", builds.BuildsCommentsHandler),
-                       (r"/builds/comments/(\w+)", builds.BuildsCommentsHandler),
                        (r"/builds/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})", builds.ShowHandler),
                        (r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/bugs", builds.BuildBugsHandler),
                        (r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/manage", builds.BuildManageHandler),
index 91bfb46bb5cbe4f0d46d856f262ab1fb7efff3b7..d81939834980e23f3ff1b9a8a762189d709e9914 100644 (file)
@@ -120,37 +120,6 @@ class BuildBugsHandler(base.BaseHandler):
                self.redirect("/build/%s/bugs" % build.uuid)
 
 
-class BuildsCommentsHandler(base.BaseHandler):
-       def get(self, user_name=None):
-               user = None
-               if user_name:
-                       user = self.backend.users.get_by_name(user_name)
-
-               limit  = self.get_argument("limit", 10)
-               offset = self.get_argument("offset", 0)
-
-               try:
-                       limit  = int(limit)
-                       offset = int(offset)
-               except:
-                       raise tornado.web.HTTPError(400)
-
-               # Try to get one more comment than requested and check if there
-               # is a next page that it to be shown.
-               comments = self.backend.builds.get_comments(limit=limit + 1,
-                       offset=offset, user=user)
-
-               # Set markers for next and prev pages.
-               have_next = len(comments) > limit
-               have_prev = offset > limit
-
-               # Remove the extra element from the list.
-               comments = comments[:limit]
-
-               self.render("builds/comments.html", comments=comments, limit=limit,
-                       offset=offset + limit, user=user, have_prev=have_prev, have_next=have_next)
-
-
 class BuildStateHandler(base.BaseHandler):
        def get(self, uuid):
                build = self.backend.builds.get_by_uuid(uuid)
index f372d65048c5b07f2cf4d36a752d8524555d43e3..a96ab7f5dfb0efafa0e575a95bee3d4206141c49 100644 (file)
@@ -315,32 +315,6 @@ class SourceTableModule(UIModule):
                        distro=distro, sources=sources)
 
 
-class CommentsTableModule(UIModule):
-       def render(self, comments, show_package=False, show_user=True):
-               pkgs, users = {}, {}
-               for comment in comments:
-                       if show_package:
-                               try:
-                                       pkg = pkgs[comment.pkg_id]
-                               except KeyError:
-                                       pkg = pkgs[comment.pkg_id] = \
-                                               self.backend.packages.get_by_id(comment.pkg_id)
-
-                               comment["pkg"] = pkg
-
-                       if show_user:
-                               try:
-                                       user = users[comment.user_id]
-                               except KeyError:
-                                       user = users[comment.user_id] = \
-                                               self.backend.users.get_by_id(comment.user_id)
-
-                               comment["user"] = user
-
-               return self.render_string("modules/comments-table.html",
-                       comments=comments, show_package=show_package, show_user=show_user)
-
-
 class LogModule(UIModule):
        def render(self, entries, **args):
                return self.render_string("modules/log.html",