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