Add Others field in index
This commit is contained in:
@@ -22,8 +22,10 @@ class IWLADisplayTopHits(IPlugin):
|
||||
page = DisplayHTMLPage(title, path, self.iwla.getConfValue('css_path', []))
|
||||
table = DisplayHTMLBlockTable('All Hits', ['URI', 'Entrance'])
|
||||
table.setColsCSSClass(['', 'iwla_hit'])
|
||||
total_hits = [0]*2
|
||||
for (uri, entrance) in top_hits:
|
||||
table.appendRow([generateHTMLLink(uri), entrance])
|
||||
total_hits[1] += entrance
|
||||
page.appendBlock(table)
|
||||
|
||||
self.iwla.getDisplay().addPage(page)
|
||||
@@ -38,4 +40,9 @@ class IWLADisplayTopHits(IPlugin):
|
||||
table.setColsCSSClass(['', 'iwla_hit'])
|
||||
for (uri, entrance) in top_hits[:10]:
|
||||
table.appendRow([generateHTMLLink(uri), entrance])
|
||||
total_hits[1] -= entrance
|
||||
if total_hits[1]:
|
||||
total_hits[0] = 'Others'
|
||||
table.appendRow(total_hits)
|
||||
table.setCellCSSClass(table.getNbRows()-1, 0, 'iwla_others')
|
||||
index.appendBlock(table)
|
||||
|
||||
Reference in New Issue
Block a user