From f60222c9b5b266af6f75d1f2a4d69e1a70748f4d Mon Sep 17 00:00:00 2001 From: j Date: Tue, 12 Nov 2019 17:50:07 +0000 Subject: [PATCH] processing note --- static/js/item.js | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/static/js/item.js b/static/js/item.js index 91c9b8f4..c5045d1f 100644 --- a/static/js/item.js +++ b/static/js/item.js @@ -41,11 +41,28 @@ pandora.ui.item = function() { pandora.user.ui.itemView.slice(0, 1) ) > -1 ? 'an': 'a') + ' ' +'{1} view.', [result.data.title, Ox._(pandora.user.ui.itemView)]); - pandora.$ui.contentPanel.replaceElement(1, - Ox.Element() - .css({marginTop: '32px', fontSize: '12px', textAlign: 'center'}) - .html(html) - ); + + var note = Ox.Element() + .css({marginTop: '32px', fontSize: '12px', textAlign: 'center'}) + pandora.$ui.contentPanel.replaceElement(1, note); + if (pandora.user.username == item.user || pandora.hasCapability('canSeeAllTasks')) { + pandora.api.getTasks({ + user: pandora.hasCapability('canSeeAllTasks') ? '' : pandora.user.username + }, function(result_) { + var tasks = result_.data.items.filter(function(task) { return task.item == item}) + if (tasks.length == 0) { + html = Ox._( + '{0} is currently processed. ' + + '{1} view will be available in a moment.', + [result.data.title, Ox._(pandora.user.ui.itemView)] + ) + } + note.html(html) + }) + } else { + note.html(html) + } + pandora.site.itemViews.filter(function(view) { return view.id == 'documents'; }).length && pandora.api.get({