[bugzilla-gnome-org-extensions] developers: Add beforecomments hook implementation



commit be276bb4da74fbeb105ef204e0fecf12e5b79ae6
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Sun Nov 9 13:16:19 2014 +0100

    developers: Add beforecomments hook implementation
    
    It switches user cache to an empty cache, so we will not get values
    from it which are without descriptions ([reporter], [developer] and so
    on).

 .../hook/bug/comments-beforecomments.html.tmpl     |   23 ++++++++++++++++++++
 TODO                                               |   19 ----------------
 2 files changed, 23 insertions(+), 19 deletions(-)
---
diff --git a/Developers/template/en/default/hook/bug/comments-beforecomments.html.tmpl 
b/Developers/template/en/default/hook/bug/comments-beforecomments.html.tmpl
new file mode 100644
index 0000000..b3a4d0a
--- /dev/null
+++ b/Developers/template/en/default/hook/bug/comments-beforecomments.html.tmpl
@@ -0,0 +1,23 @@
+[%# The contents of this file are subject to the Mozilla Public
+  # License Version 1.1 (the "License"); you may not use this file
+  # except in compliance with the License. You may obtain a copy of
+  # the License at http://www.mozilla.org/MPL/
+  #
+  # Software distributed under the License is distributed on an "AS
+  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+  # implied. See the License for the specific language governing
+  # rights and limitations under the License.
+  #
+  # The Original Code is the Bugzilla Bug Tracking System.
+  #
+  # The Initial Developer of the Original Code is Everything Solved, Inc.
+  # Portions created by the Initial Developer are Copyright (C) 2010
+  # the Initial Developer. All Rights Reserved.
+  #
+  # Contributor(s):
+  #   Max Kanat-Alexander <mkanat bugzilla org>
+  #%]
+
+[% IF mode.defined && mode == 'edit' %]
+  [% user_cache = {} %]
+[% END %]
diff --git a/TODO b/TODO
index 736ec50..37e1689 100644
--- a/TODO
+++ b/TODO
@@ -3,25 +3,6 @@
 3. Weekly status page (https://bugzilla.gnome.org/page.cgi?id=weekly-bug-summary.html)
 4. Browse page (https://bugzilla.gnome.org/browse.cgi?product=Evolution)
 5. Describe user page (https://bugzilla.gnome.org/page.cgi?id=describeuser.html)
-6. Developers:
-Hooking to user won't work - currently the hook requires comment, bug
-and a mode to be defined.  The user templated is cached and then the
-cached version is used in the comments.  Unfortunately, the caching
-for the first time happens in table with attachments.  Here, comment
-and mode are not defined.
-
-Simplest solution would be modifying the template before closing span
-with "bz_comment_user" class by adding the contents of Developer's
-hook.
-
-More sophisticated solution would involve another cache.
-
-Reproducible only when there are attachments. Without attachments the
-titles work correctly.
-
-Idea - replace "user_cache = template_cache.users" with "user_cache =
-{}"
-
 8. New extension - ExtensionDeps
 Create a new extension that will keep the data about dependencies
 between extensions. For example PatchStatus depends on


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]