]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
filters: Fix submitter display when we only have an email address
authorDamien Lespiau <damien.lespiau@intel.com>
Mon, 24 Aug 2015 16:54:08 +0000 (17:54 +0100)
committerStephen Finucane <stephen.finucane@intel.com>
Thu, 5 Nov 2015 03:56:27 +0000 (03:56 +0000)
I'm fairly sure I fixed that already, but here we go again. It's totally
valid to only have an email address for the submitter, so handle that
case properly.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
patchwork/templates/patchwork/filters.html

index fe0c9b85f8e995c7e88b1fda34a19250b940b8a9..65fd6bfe17c10932f34657c2db7db63fa63f8f2e 100644 (file)
@@ -54,11 +54,15 @@ $(document).ready(function() {
         },
         render: {
             option: function(item, escape) {
-                return '<div>' + escape(item.name) + ' &lt;' +
-                                 escape(item.email) + '&gt;' + '</div>';
+                if (item.name)
+                    return '<div>' + escape(item.name) + ' &lt;' +
+                                     escape(item.email) + '&gt;' + '</div>';
+                return '<div>' + escape(item.email) + '</div>';
             },
             item: function(item, escape) {
-                return '<div>' + escape(item.name) + '</div>';
+                if (item.name)
+                    return '<div>' + escape(item.name) + '</div>';
+                return '<div>' + escape(item.email) + '</div>';
             }
         },
         load: function(query, callback) {