Changeset 3407 in products for quintagroup.analytics/trunk/quintagroup/analytics/browser/views.py
- Timestamp:
- Apr 5, 2012 10:24:27 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.analytics/trunk/quintagroup/analytics/browser/views.py
r3171 r3407 18 18 19 19 from GChartWrapper import VerticalBarStack 20 21 20 from quintagroup.analytics.config import COLORS, OTHER_TYPES, NO_WF_BIND 22 23 24 class OwnershipByType(BrowserView): 21 from quintagroup.analytics import QuintagroupAnalyticsMessageFactory as _ 22 23 MENUEITEMS = [{'href':'qa_overview', 'content':_('Overview')}, 24 {'href':'ownership_by_type', 'content':_('Ownership by type')}, 25 {'href':'ownership_by_state', 'content':_('Ownership by state')}, 26 {'href':'type_by_state', 'content':_('Types by state')}, 27 {'href':'portlets_stats', 'content':_('Portlets stats')}, 28 {'href':'legacy_portlets', 'content':_('Legacy portlets')}, 29 {'href':'properties_stats', 'content':_('Properties stats')},] 30 31 class AnalyticsBaseView(BrowserView): 32 def analiticsNavigation(self): 33 return MENUEITEMS 34 35 36 class OwnershipByType(AnalyticsBaseView): 25 37 MAX = 10 26 27 38 def __init__(self, context, request): 28 39 self.context = context … … 97 108 chart = VerticalBarStack(data, encoding='text') 98 109 types = other and types + OTHER_TYPES or types 99 chart.title( 'Content ownership by type').legend(*(types))110 chart.title(_('Content ownership by type')).legend(*(types)) 100 111 chart.bar('a', 10, 0).legend_pos("b") 101 112 chart.color(*COLORS) … … 106 117 107 118 108 class OwnershipByState( BrowserView):119 class OwnershipByState(AnalyticsBaseView): 109 120 MAX = 10 110 121 … … 189 200 max_value = max(self.getTotal()) 190 201 chart = VerticalBarStack(data, encoding='text') 191 title = 'Content ownership by state'202 title = _('Content ownership by state') 192 203 chart.title(title).legend(*self.states + [NO_WF_BIND]) 193 204 chart.bar('a', 10, 0).legend_pos("b") … … 199 210 200 211 201 class TypeByState( BrowserView):212 class TypeByState(AnalyticsBaseView): 202 213 MAX = 10 203 214 … … 281 292 max_value = max(self.getTotal()) 282 293 chart = VerticalBarStack(data, encoding='text') 283 chart.title( 'Content type by state').legend(294 chart.title(_('Content type by state')).legend( 284 295 *self.states + [NO_WF_BIND]) 285 296 chart.bar('a', 10, 0).legend_pos("b") … … 291 302 292 303 293 class LegacyPortlets( BrowserView):304 class LegacyPortlets(AnalyticsBaseView): 294 305 def __init__(self, context, request): 295 306 self.context = context … … 358 369 359 370 360 class PropertiesStats( BrowserView):371 class PropertiesStats(AnalyticsBaseView): 361 372 def __init__(self, context, request): 362 373 self.context = context … … 427 438 428 439 429 class PortletsStats( BrowserView):440 class PortletsStats(AnalyticsBaseView): 430 441 def __init__(self, context, request): 431 442 self.context = context
Note: See TracChangeset
for help on using the changeset viewer.