Display 'Others' when max displayed reached

This commit is contained in:
2014-12-17 21:27:31 +01:00
parent f82e26e3bc
commit a74a6b8469
4 changed files with 37 additions and 0 deletions

View File

@@ -55,6 +55,13 @@ class IWLADisplayTopHits(IPlugin):
for (uri, entrance) in new_list:
table.appendRow([generateHTMLLink(uri), entrance])
total_hits[1] += entrance
if self.max_hits:
others = 0
for (uri, entrance) in top_hits[self.max_hits:]:
others += entrance
table.appendRow([self.iwla._(u'Others'), others])
table.setCellCSSClass(table.getNbRows()-1, 0, 'iwla_others')
page.appendBlock(table)
display.addPage(page)