Display 'Others' when max displayed reached
This commit is contained in:
parent
f82e26e3bc
commit
a74a6b8469
|
@ -83,6 +83,12 @@ class IWLADisplayReferers(IPlugin):
|
|||
total_search[1] += search_engine_referers[r]['pages']
|
||||
total_search[2] += search_engine_referers[r]['hits']
|
||||
table.appendRow(row)
|
||||
if self.max_referers:
|
||||
others = 0
|
||||
for (uri, entrance) in top_referers[self.max_referers:]:
|
||||
others += entrance
|
||||
table.appendRow([self.iwla._(u'Others'), others])
|
||||
table.setCellCSSClass(table.getNbRows()-1, 0, 'iwla_others')
|
||||
|
||||
total_external = [0]*3
|
||||
table.appendRow(['<b>%s</b>' % (self.iwla._(u'External URL')), '', ''])
|
||||
|
@ -92,6 +98,12 @@ class IWLADisplayReferers(IPlugin):
|
|||
total_external[1] += referers[r]['pages']
|
||||
total_external[2] += referers[r]['hits']
|
||||
table.appendRow(row)
|
||||
if self.max_referers:
|
||||
others = 0
|
||||
for (uri, entrance) in top_referers[self.max_referers:]:
|
||||
others += entrance
|
||||
table.appendRow([self.iwla._(u'Others'), others])
|
||||
table.setCellCSSClass(table.getNbRows()-1, 0, 'iwla_others')
|
||||
|
||||
total_robot = [0]*3
|
||||
table.appendRow(['<b>%s</b>' % (self.iwla._(u'External URL (robot)')), '', ''])
|
||||
|
@ -101,6 +113,12 @@ class IWLADisplayReferers(IPlugin):
|
|||
total_robot[1] += robots_referers[r]['pages']
|
||||
total_robot[2] += robots_referers[r]['hits']
|
||||
table.appendRow(row)
|
||||
if self.max_referers:
|
||||
others = 0
|
||||
for (uri, entrance) in top_referers[self.max_referers:]:
|
||||
others += entrance
|
||||
table.appendRow([self.iwla._(u'Others'), others])
|
||||
table.setCellCSSClass(table.getNbRows()-1, 0, 'iwla_others')
|
||||
|
||||
page.appendBlock(table)
|
||||
|
||||
|
|
|
@ -56,6 +56,12 @@ class IWLADisplayTopDownloads(IPlugin):
|
|||
for (uri, entrance) in new_list:
|
||||
table.appendRow([generateHTMLLink(uri), entrance])
|
||||
total_entrance[1] += entrance
|
||||
if self.max_downloads:
|
||||
others = 0
|
||||
for (uri, entrance) in top_downloads[self.max_downloads:]:
|
||||
others += entrance
|
||||
table.appendRow([self.iwla._(u'Others'), others])
|
||||
table.setCellCSSClass(table.getNbRows()-1, 0, 'iwla_others')
|
||||
page.appendBlock(table)
|
||||
|
||||
display.addPage(page)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -55,6 +55,12 @@ class IWLADisplayTopPages(IPlugin):
|
|||
for (uri, entrance) in new_list:
|
||||
table.appendRow([generateHTMLLink(uri), entrance])
|
||||
total_hits[1] += entrance
|
||||
if self.max_pages:
|
||||
others = 0
|
||||
for (uri, entrance) in top_pages[self.max_pages:]:
|
||||
others += entrance
|
||||
table.appendRow([self.iwla._(u'Others'), others])
|
||||
table.setCellCSSClass(table.getNbRows()-1, 0, 'iwla_others')
|
||||
page.appendBlock(table)
|
||||
|
||||
display.addPage(page)
|
||||
|
|
Loading…
Reference in New Issue
Block a user