Skip to content
Snippets Groups Projects
Select Git revision
  • 3ba851158f9ade3d217f59382aeef252aad58805
  • main default protected
  • release
  • master-interface-proto4
  • ozg-5634-ozgcloud-ingress
  • OZG-3322_connect_to_mongodb_over_tls
  • 2.20.0
  • 2.19.0
  • 2.18.0
  • 2.17.0
  • 2.16.0
  • 2.15.0
  • 2.14.0
  • 2.13.0
  • 2.12.0
  • 2.11.0
  • 2.10.1
  • 2.10.0
  • 2.9.0
  • 2.8.0
  • 2.7.1
  • 2.7.0
  • 2.6.0
  • 2.5.1
  • 2.5.0
  • 2.4.0
26 results

build-native-local-docker-image.sh

Blame
  • plugin.py 985 B
    import ckan.plugins as plugins
    import ckan.plugins.toolkit as toolkit
    
    def odsh_main_groups():
        '''Return a list of the groups to be shown on the start page.'''
    
        # Get a list of all the site's groups from CKAN, sorted by number of
        # datasets.
        groups = toolkit.get_action('group_list')(
            data_dict={'all_fields': True})
    
        return groups
    
    class OdshPlugin(plugins.SingletonPlugin):
        plugins.implements(plugins.IConfigurer)
        plugins.implements(plugins.ITemplateHelpers)
    
        # IConfigurer
    
        def update_config(self, config_):
            toolkit.add_template_directory(config_, 'templates')
            toolkit.add_public_directory(config_, 'public')
            toolkit.add_resource('fanstatic', 'odsh')
        
        def get_helpers(self):
            # Template helper function names should begin with the name of the
            # extension they belong to, to avoid clashing with functions from
            # other extensions.
            return {'odsh_main_groups': odsh_main_groups}