mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-13 07:29:39 +00:00
Fleshing out
* Improve docstring * Add settings form * Register blueprint * Register management side menu item
This commit is contained in:
parent
8908c43b23
commit
bcb8737c24
@ -1,8 +1,31 @@
|
||||
from indico.core.plugins import IndicoPlugin
|
||||
from indico.core import signals
|
||||
from indico.core.plugins import IndicoPlugin, IndicoPluginBlueprint, url_for_plugin
|
||||
from MaKaC.i18n import _
|
||||
from MaKaC.webinterface.wcomponents import SideMenuItem
|
||||
|
||||
from controllers import RHStatisticsView
|
||||
from forms import SettingsForm
|
||||
|
||||
|
||||
class StatisticsPlugin(IndicoPlugin):
|
||||
"""Statistic plugin
|
||||
"""Statistics plugin
|
||||
|
||||
A plugin to export statistic of Indico.
|
||||
This statistics plugin provides statistics of conferences, meetings and
|
||||
contributions. Notice it's not designed to provide general analytics.
|
||||
"""
|
||||
|
||||
settings_form = SettingsForm
|
||||
|
||||
def init(self):
|
||||
super(StatisticsPlugin, self).init()
|
||||
self.connect(signals.event_management_sidemenu, self.add_sidemenu_item)
|
||||
|
||||
def add_sidemenu_item(self, event):
|
||||
return (SideMenuItem(_("Statistics (new)"), url_for_plugin('statistics.view', event)),)
|
||||
|
||||
def get_blueprints(self):
|
||||
return blueprint
|
||||
|
||||
|
||||
blueprint = IndicoPluginBlueprint('statistics', __name__)
|
||||
blueprint.add_url_rule('/event/<confId>/manage/statistics_new', 'view', RHStatisticsView)
|
||||
|
||||
7
piwik/indico_statistics/controllers.py
Normal file
7
piwik/indico_statistics/controllers.py
Normal file
@ -0,0 +1,7 @@
|
||||
from MaKaC.webinterface.rh.conferenceModif import RHConferenceModifBase
|
||||
|
||||
|
||||
class RHStatisticsView(RHConferenceModifBase):
|
||||
|
||||
def _process(self):
|
||||
return 'statistics'
|
||||
8
piwik/indico_statistics/forms.py
Normal file
8
piwik/indico_statistics/forms.py
Normal file
@ -0,0 +1,8 @@
|
||||
from wtforms import BooleanField, IntegerField
|
||||
|
||||
from indico.web.forms.base import IndicoForm
|
||||
|
||||
|
||||
class SettingsForm(IndicoForm):
|
||||
cache_enabled = BooleanField('Enable report caching', default=True)
|
||||
cache_ttl = IntegerField('Report caching TTL (seconds)', default=3600)
|
||||
Loading…
x
Reference in New Issue
Block a user