Exemple #1
0
    def update_config(self, config):
        toolkit.add_public_directory(config, 'public')
        toolkit.add_template_directory(config, 'templates')
        toolkit.add_resource('public', 'ckanext-geoview')

        self.proxy_enabled = 'resource_proxy' in toolkit.config.get(
            'ckan.plugins', '')
Exemple #2
0
    def update_config(self, config):
        toolkit.add_public_directory(config, "../public")
        toolkit.add_template_directory(config, "../templates")
        toolkit.add_resource("../public", "ckanext-geoview")

        self.proxy_enabled = "resource_proxy" in toolkit.config.get(
            "ckan.plugins", "")
Exemple #3
0
    def update_config(self, config):
        tk.add_template_directory(config, '../templates')
        tk.add_public_directory(config, '../public')
        tk.add_resource('../fanstatic', 'showcase')
        if tk.check_ckan_version(min_version='2.4', max_version='2.9.0'):
            tk.add_ckan_admin_tab(config, 'showcase_admins',
                                  'Showcase Config')
        elif tk.check_ckan_version(min_version='2.9.0'):
            tk.add_ckan_admin_tab(config, 'showcase_blueprint.admins',
                                  'Showcase Config')

        if tk.check_ckan_version(min_version='2.9.0'):
            mappings = config.get('ckan.legacy_route_mappings', {})
            if isinstance(mappings, string_types):
                mappings = json.loads(mappings)

            bp_routes = [
                'index', 'new', 'delete',
                'read', 'edit', 'manage_datasets',
                'dataset_showcase_list', 'admins', 'admin_remove'
            ]
            mappings.update({
                'showcase_' + route: 'showcase_blueprint.' + route
                for route in bp_routes
            })
            # https://github.com/ckan/ckan/pull/4521
            config['ckan.legacy_route_mappings'] = json.dumps(mappings)
Exemple #4
0
    def update_config(self, config):
        ''' Set up the resource library, public directory and
        template directory for all the spatial extensions
        '''
        tk.add_public_directory(config, '../public')
        tk.add_template_directory(config, '../templates')
        tk.add_resource('../public', 'ckanext-spatial')

        # Add media types for common extensions not included in the mimetypes
        # module
        mimetypes.add_type('application/json', '.geojson')
        mimetypes.add_type('application/gml+xml', '.gml')
    def update_config(self, config_):
        if not tables_exist():
            log.critical(u'''
The validation extension requires a database setup. Please run the following
to create the database tables:
    paster --plugin=ckanext-validation validation init-db
''')
        else:
            log.debug(u'Validation tables exist')

        t.add_template_directory(config_, u'templates')
        t.add_public_directory(config_, u'public')
        t.add_resource(u'fanstatic', 'ckanext-validation')
    def update_config(self, config_):
        if not tables_exist():
            if is_ckan_29():
                init_command = 'ckan validation init-db'
            else:
                init_command = 'paster --plugin=ckanext-validation validation init-db'
            log.critical(
                u'''
The validation extension requires a database setup.
Validation pages will not be enabled.
Please run the following to create the database tables:
    %s''', init_command)
        else:
            log.debug(u'Validation tables exist')

        t.add_template_directory(config_, u'templates')
        t.add_public_directory(config_, u'public')
        t.add_resource(u'assets', 'ckanext-validation')
Exemple #7
0
    def update_config(self, config):
        self.organization_pages = tk.asbool(config.get('ckanext.pages.organization', False))
        self.group_pages = tk.asbool(config.get('ckanext.pages.group', False))

        tk.add_template_directory(config, '../theme/templates_main')
        if self.group_pages:
            tk.add_template_directory(config, '../theme/templates_group')
        if self.organization_pages:
            tk.add_template_directory(config, '../theme/templates_organization')

        tk.add_resource('../assets', 'pages')

        tk.add_public_directory(config, '../assets/')
        tk.add_public_directory(config, '../assets/vendor/ckeditor/')
        tk.add_public_directory(config, '../assets/vendor/ckeditor/skins/moono-lisa')
Exemple #8
0
 def update_config(self, config_):
     toolkit.add_template_directory(config_, 'templates')
     toolkit.add_public_directory(config_, 'public')
     toolkit.add_resource('webassets', 'resourcesfilter')
 def update_config(self, config_):
     tk.add_template_directory(config_, "templates")
     tk.add_resource("assets", "create_typed_package")
Exemple #10
0
 def update_config(self, config):
     tk.add_resource('textbox/theme', 'textbox')
     tk.add_template_directory(config, 'textbox/templates')
Exemple #11
0
 def update_config(self, config_):
     toolkit.add_template_directory(config_, 'templates')
Exemple #12
0
 def update_config(self, config_):
     toolkit.add_template_directory(config_, 'templates')
     # We need to register the following templates dir in order
     # to fix downloading the HTML file instead of previewing when
     # 'webpage_view' is enabled
     toolkit.add_template_directory(config_, 'theme/templates')
Exemple #13
0
 def _add_template_directory(self, config):
     if not check_ckan_version('2.9'):
         add_template_directory(config, '2.8_templates')
     add_template_directory(config, 'templates')
     add_resource('assets', 'ckanext-scheming')
Exemple #14
0
 def _add_template_directory(self, config):
     add_template_directory(config, 'templates')
     add_public_directory(config, 'public')
     add_resource('public', 'ckanext-scheming')
 def update_config(self, config):
     toolkit.add_template_directory(config, 'templates')
     toolkit.add_public_directory(config, 'public')
     toolkit.add_resource('public/javascript/', 'request_js')
     logging.warning("ytp_request plugin enabled")
 def _add_template_directory(self, config):
     if _SchemingMixin._template_dir_added:
         return
     _SchemingMixin._template_dir_added = True
     add_template_directory(config, 'templates')
Exemple #17
0
    def update_config(self, config):
        toolkit.add_public_directory(config, 'public')
        toolkit.add_template_directory(config, 'templates')
        toolkit.add_resource('public', 'ckanext-geoview')

        self.proxy_enabled = 'resource_proxy' in toolkit.config.get('ckan.plugins', '')
 def update_config(self, config_):
     toolkit.add_template_directory(config_, 'templates')
     # toolkit.add_public_directory(config_, 'public')
     toolkit.add_resource('fanstatic', 'eaw_schema')
Exemple #19
0
 def update_config(self, config_):
     toolkit.add_template_directory(config_, 'templates')
     toolkit.add_public_directory(config_, 'public')
     toolkit.add_resource('fanstatic', 'data_qld')
     toolkit.add_resource('fanstatic', 'data_qld_theme')
     toolkit.add_resource('reporting/fanstatic', 'data_qld_reporting')
Exemple #20
0
 def _add_template_directory(self, config):
     if _SchemingMixin._template_dir_added:
         return
     _SchemingMixin._template_dir_added = True
     add_template_directory(config, 'templates')
     add_resource('fanstatic', 'scheming')
Exemple #21
0
 def _add_template_directory(self, config):
     add_template_directory(config, 'templates')
Exemple #22
0
 def _add_template_directory(self, config):
     if _SchemingMixin._template_dir_added:
         return
     _SchemingMixin._template_dir_added = True
     add_template_directory(config, 'templates')
Exemple #23
0
 def update_config(self, config_):
     toolkit.add_template_directory(config_, 'templates')