import web

class Panel:
    '''
    This class is a view where the plugins' actions are showed to the user.
    When the user clicks a action the framework go to the corresponding view.
    '''
    def GET(self):
        plugins = web.ctx.plugin_manager.get_enabled_plugins()
        actions = []

        for plugin in plugins:
            actions += (a for a in plugin.get_main_panel_actions())

        sorted(actions, key=lambda x: x.get_human_name())

        return web.ctx.render.panel.bigpanel(actions)
