diff --git a/ckanext/odsh/fanstatic/odsh.css b/ckanext/odsh/fanstatic/odsh.css index 5a21b2a6ff9c9e636e7e5ebf4bd4405be51a49ca..41139e9fa5c6878a2500f9e4846549c1876f111e 100644 --- a/ckanext/odsh/fanstatic/odsh.css +++ b/ckanext/odsh/fanstatic/odsh.css @@ -3075,7 +3075,7 @@ body.filters-modal div.row>aside.secondary.span3 { } } -.tpsh-collection-list { +.odsh-collection-list { list-style-type: none; } diff --git a/ckanext/odsh/fanstatic/tpsh_toggle_menu.js b/ckanext/odsh/fanstatic/odsh_toggle_menu.js similarity index 91% rename from ckanext/odsh/fanstatic/tpsh_toggle_menu.js rename to ckanext/odsh/fanstatic/odsh_toggle_menu.js index 1a8a8c82d0f4849ca49b8bf525247cca7cdbf755..876b3f8740ae4f021a8969a01562259722339619 100644 --- a/ckanext/odsh/fanstatic/tpsh_toggle_menu.js +++ b/ckanext/odsh/fanstatic/odsh_toggle_menu.js @@ -1,6 +1,6 @@ "use strict"; -ckan.module('tpsh_toggle_menu', function ($) { +ckan.module('odsh_toggle_menu', function ($) { return { initialize: function () { $.proxyAll(this, /_on/); diff --git a/ckanext/odsh/fanstatic/tpsh_validate_password.js b/ckanext/odsh/fanstatic/odsh_validate_password.js similarity index 97% rename from ckanext/odsh/fanstatic/tpsh_validate_password.js rename to ckanext/odsh/fanstatic/odsh_validate_password.js index f0f8f71b55e4f6a2cd9e52c6a39b09ab302d2dab..9ad4a91b7299d67251997cf190699f2dbcb664eb 100644 --- a/ckanext/odsh/fanstatic/tpsh_validate_password.js +++ b/ckanext/odsh/fanstatic/odsh_validate_password.js @@ -53,7 +53,7 @@ function setSubmitButtonState(isPasswordValid) { } -ckan.module('tpsh_validate_password', function ($) { +ckan.module('odsh_validate_password', function ($) { return { initialize: function () { $.proxyAll(this, /_on/); diff --git a/ckanext/odsh/fanstatic/webassets.yml b/ckanext/odsh/fanstatic/webassets.yml index 6ddebcd3183c4695db12f95ed4772a05e74325fc..37bb956c0f2bbb607951648982a36d607ad6bef7 100644 --- a/ckanext/odsh/fanstatic/webassets.yml +++ b/ckanext/odsh/fanstatic/webassets.yml @@ -52,20 +52,20 @@ odsh_popover_script: contents: - odsh_popover.js -tpsh_toggle_menu: +odsh_toggle_menu: filters: rjsmin # preprocessor - output: ckanext-odsh/tpsh_toggle_menu.js + output: ckanext-odsh/odsh_toggle_menu.js extra: preload: - base/main contents: - - tpsh_toggle_menu.js + - odsh_toggle_menu.js -tpsh_validate_password: +odsh_validate_password: filters: rjsmin # preprocessor - output: ckanext-odsh/tpsh_validate_password.js + output: ckanext-odsh/odsh_validate_password.js contents: - - tpsh_validate_password.js + - odsh_validate_password.js odsh_dataset_map_script: filters: rjsmin # preprocessor @@ -135,8 +135,8 @@ odsh_spatial_query_style: # - odsh_popover.js # - odsh_populate_tags.js # - odsh_spatial_query.js -# - tpsh_toggle_menu.js -# - tpsh_validate_password.js +# - odsh_toggle_menu.js +# - odsh_validate_password.js # - vendor/jquery-ui-autocomplete/jquery-ui.js # - vendor/leaflet.draw.js # - vendor/leaflet.js diff --git a/ckanext/odsh/helpers.py b/ckanext/odsh/helpers.py index fa1d51b808eaa582e8843a30888f970ab77d72e5..980a3460ebf6613a382a8d7e7cd1044e7605ff78 100644 --- a/ckanext/odsh/helpers.py +++ b/ckanext/odsh/helpers.py @@ -371,7 +371,7 @@ def is_within_last_month(date, date_ref=None): return True return False -def tpsh_get_all_datasets_belonging_to_collection(context, collection_name): +def get_all_datasets_belonging_to_collection(context, collection_name): rel_collection_dict = dict({"id": collection_name}) name_list = list() try: @@ -384,14 +384,14 @@ def tpsh_get_all_datasets_belonging_to_collection(context, collection_name): name_list.append(item_object) return name_list -def tpsh_get_all_datasets_belonging_to_collection_by_dataset(context, dataset_name): - collection_name = tpsh_get_collection_name_by_dataset(context, dataset_name) +def get_all_datasets_belonging_to_collection_by_dataset(context, dataset_name): + collection_name = get_collection_name_by_dataset(context, dataset_name) if collection_name: - name_list = tpsh_get_all_datasets_belonging_to_collection(context, collection_name) + name_list = get_all_datasets_belonging_to_collection(context, collection_name) return name_list return list() -def tpsh_get_collection_name_by_dataset(context, dataset_name): +def get_collection_name_by_dataset(context, dataset_name): rel_dataset_dict = dict({"id" : dataset_name}) list_rel_dataset = toolkit.get_action('package_relationships_list')(context, rel_dataset_dict) if not len(list_rel_dataset): @@ -399,7 +399,7 @@ def tpsh_get_collection_name_by_dataset(context, dataset_name): collection_name = list_rel_dataset[0]['object'] return collection_name -def tpsh_get_successor_and_predecessor_dataset(context, pkg_dict): +def get_successor_and_predecessor_dataset(context, pkg_dict): dataset_name = pkg_dict.get('name') siblings_dicts_with_access = _get_siblings_dicts_with_access(context, pkg_dict) if siblings_dicts_with_access: @@ -421,7 +421,7 @@ def tpsh_get_successor_and_predecessor_dataset(context, pkg_dict): def _get_siblings_dicts_with_access(context, pkg_dict): dataset_name = pkg_dict.get('name') - list_of_siblings = tpsh_get_all_datasets_belonging_to_collection_by_dataset(context, dataset_name) + list_of_siblings = get_all_datasets_belonging_to_collection_by_dataset(context, dataset_name) n_siblings = len(list_of_siblings) if n_siblings>0: siblings_dicts = [get_package_dict(name) for name in list_of_siblings] @@ -445,8 +445,8 @@ def _sort_siblings_by_name_and_date(siblings_dicts): def get_package_dict(name): return model.Package.get(name).as_dict() -def tpsh_get_successor_and_predecessor_urls(context, pkg_dict): - successor_name, predecessor_name = tpsh_get_successor_and_predecessor_dataset(context, pkg_dict) +def get_successor_and_predecessor_urls(context, pkg_dict): + successor_name, predecessor_name = get_successor_and_predecessor_dataset(context, pkg_dict) successor_url, predecessor_url = ( helpers.url_for('dataset.read', id=name) if name is not None diff --git a/ckanext/odsh/logic/action.py b/ckanext/odsh/logic/action.py index 2985fb2fc0ef264b990699a50cb4196702a23da1..071397e85858da96f3946dbe0cb364ad967311eb 100644 --- a/ckanext/odsh/logic/action.py +++ b/ckanext/odsh/logic/action.py @@ -117,7 +117,7 @@ def odsh_user_create(context, data_dict): raise logic.ValidationError(PASSWORD_ERROR_MESSAGE) -def tpsh_user_update(context, data_dict): +def odsh_user_update(context, data_dict): password = data_dict.get('password') if not password: password = data_dict.get('password1') diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index 6a8d8b88520ad44bad740a10cd3fbcaa9de8053d..a7ffbfa4c5a0d2e1a8bd5cf01b6cb7a479778ac4 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -106,7 +106,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm def get_actions(self): return {'package_create': action.odsh_package_create, - 'user_update': action.tpsh_user_update, + 'user_update': action.odsh_user_update, 'user_create': action.odsh_user_create, 'resource_create': action.odsh_resource_create, } @@ -132,18 +132,18 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm def create_package_schema(self): schema = super(OdshPlugin, self).create_package_schema() self._update_schema(schema) - self._tpsh_update_create_or_update_package_schema(schema) + self._update_create_or_update_package_schema(schema) return schema def update_package_schema(self): schema = super(OdshPlugin, self).update_package_schema() self._update_schema(schema) - self._tpsh_update_create_or_update_package_schema(schema) + self._update_create_or_update_package_schema(schema) return schema def show_package_schema(self): schema = super(OdshPlugin, self).show_package_schema() - self._tpsh_update_show_package_schema(schema) + self._update_show_package_schema(schema) return schema def _update_schema(self, schema): @@ -175,7 +175,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm schema.update( {'__extras': [toolkit.get_converter('odsh_validate_extras')]}) - def _tpsh_update_create_or_update_package_schema(self, schema): + def _update_create_or_update_package_schema(self, schema): schema.update({ 'language': [ toolkit.get_validator('ignore_missing'), @@ -186,7 +186,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm toolkit.get_converter('convert_to_extras') ], 'relatedPackage': [ - toolkit.get_validator('tpsh_validate_relatedPackage'), + toolkit.get_validator('validate_relatedPackage'), toolkit.get_converter('convert_to_extras') ], 'accessibility': [ @@ -196,7 +196,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm }) return schema - def _tpsh_update_show_package_schema(self, schema): + def _update_show_package_schema(self, schema): schema.update({ 'language': [ toolkit.get_converter('convert_from_extras'), @@ -320,15 +320,15 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm 'odsh_spatial_extends_available': odsh_helpers.spatial_extends_available, 'odsh_public_resource_url': odsh_helpers.odsh_public_resource_url, 'odsh_show_testbanner': odsh_helpers.odsh_show_testbanner, - 'tpsh_get_daterange_prettified': helper_pkg_dict.get_daterange_prettified, - 'tpsh_get_language_of_package': helpers_tpsh.get_language_of_package, + 'get_daterange_prettified': helper_pkg_dict.get_daterange_prettified, + 'get_language_of_package': helpers_tpsh.get_language_of_package, 'get_language_icon': helpers_tpsh.get_language_icon, 'short_name_for_category': odsh_helpers.short_name_for_category, 'get_spatial_for_selection': helpers_tpsh.get_spatial_for_selection, 'get_language_for_selection': helpers_tpsh.get_language_for_selection, - 'tpsh_get_resource_size': helpers_tpsh.get_resource_size, - 'tpsh_get_address_org':helpers_tpsh.get_address_org, - 'tpsh_get_body_mail':helpers_tpsh.get_body_mail, + 'get_resource_size': helpers_tpsh.get_resource_size, + 'get_address_org':helpers_tpsh.get_address_org, + 'get_body_mail':helpers_tpsh.get_body_mail, 'odsh_load_mdk_sample_dataset': odsh_helpers.odsh_load_mdk_sample_dataset, 'odsh_load_raw_mdk_sample_dataset': odsh_helpers.odsh_load_raw_mdk_sample_dataset, } diff --git a/ckanext/odsh/templates/header.html b/ckanext/odsh/templates/header.html index 708d0a572b31f637fe6276466cdb759b2c8d3dc1..85f97274022d38dc50fbf15d15e2f7b325883e4c 100644 --- a/ckanext/odsh/templates/header.html +++ b/ckanext/odsh/templates/header.html @@ -1,5 +1,5 @@ {% block scripts %} -{% asset 'ckanext-odsh/tpsh_toggle_menu' %} +{% asset 'ckanext-odsh/odsh_toggle_menu' %} {% endblock scripts %} {% block header_wrapper %} @@ -24,7 +24,7 @@ </div> <h1 class='site-title'> {{ g.site_title }} </h1> </div> - <div id="menu-button-and-title" data-module="tpsh_toggle_menu"> + <div id="menu-button-and-title" data-module="odsh_toggle_menu"> <span class="fa fa-bars"></span> <h1 class='site-title-mobile'> {{ g.site_title }} </h1> </div> @@ -34,7 +34,7 @@ <div class='row navigation-row'> <nav class="section navigation"> <ul class="nav nav-pills"> - <li class="header-menu-mobile" data-module="tpsh_toggle_menu"> + <li class="header-menu-mobile" data-module="odsh_toggle_menu"> <a>{{ _('Menu') }}</a> <img src="/base/images/icon_close_white.svg" alt="Menü schließen" aria-label="Menü schließen" /> </li> diff --git a/ckanext/odsh/templates/macros/form.html b/ckanext/odsh/templates/macros/form.html index 5cd97c690c3a28e0af88db0757287fa341f49b30..57a5c2a15e205d18abfc7442b36b63a8047a692c 100644 --- a/ckanext/odsh/templates/macros/form.html +++ b/ckanext/odsh/templates/macros/form.html @@ -134,7 +134,7 @@ Examples: selected=2011, error=errors.year) }} #} -{% macro tpsh_select(name, id='', label='', options='', selected='', error='', classes=[], attrs={}, +{% macro odsh_select(name, id='', label='', options='', selected='', error='', classes=[], attrs={}, is_required=false) %} {% set classes = (classes|list) %} {% do classes.append('control-select') %} diff --git a/ckanext/odsh/templates/organization/snippets/organization_form.html b/ckanext/odsh/templates/organization/snippets/organization_form.html index 1f8f80a564586a5d99e1442667873f3f2915ccb7..c0bf3069cf2826c1873480c3692c12954b297d82 100644 --- a/ckanext/odsh/templates/organization/snippets/organization_form.html +++ b/ckanext/odsh/templates/organization/snippets/organization_form.html @@ -29,7 +29,7 @@ - {% set extras = h.tpsh_get_address_org(data) %} + {% set extras = h.get_address_org(data) %} {{ form.input_address('person','Ansprechpartner', value= extras.person , index=0, placeholder='', type='text', attrs={}) }} diff --git a/ckanext/odsh/templates/package/snippets/info.html b/ckanext/odsh/templates/package/snippets/info.html index e32c0634afa161c13fd16c7d4d3115359f794869..927f32942a7faa67e1154f94ccaaacbb1107d5b7 100644 --- a/ckanext/odsh/templates/package/snippets/info.html +++ b/ckanext/odsh/templates/package/snippets/info.html @@ -9,7 +9,7 @@ Example: #} -{% set daterange = h.tpsh_get_daterange_prettified(pkg) %} +{% set daterange = h.get_daterange_prettified(pkg) %} {% set license_attribution_by_text = h.odsh_extract_value_from_extras(pkg.extras, 'licenseAttributionByText') %} {% block package_info %} diff --git a/ckanext/odsh/templates/package/snippets/package_basic_fields.html b/ckanext/odsh/templates/package/snippets/package_basic_fields.html index 505186a55ee714b97a487f99ec191b3c469b8d26..f497f0bb4ce1774c60ab8e27444a1d18c985167c 100644 --- a/ckanext/odsh/templates/package/snippets/package_basic_fields.html +++ b/ckanext/odsh/templates/package/snippets/package_basic_fields.html @@ -230,7 +230,7 @@ dataset_is_draft)) %} {# field language #} {% set before_selected = data.get('language') or h.odsh_extract_value_from_extras(data.extras, 'language') or 'http://publications.europa.eu/resource/authority/language/DEU' %} -{{ form.tpsh_select('language', label=_('language'), options=h.get_language_for_selection(), selected=before_selected , error=errors.language, is_required=False, classes=['control-full']) }} +{{ form.odsh_select('language', label=_('language'), options=h.get_language_for_selection(), selected=before_selected , error=errors.language, is_required=False, classes=['control-full']) }} {# field spatial_uri #} diff --git a/ckanext/odsh/templates/package/snippets/resource_form.html b/ckanext/odsh/templates/package/snippets/resource_form.html index 678d05a0c0aa1c4e1366699fef7a4ed1c6a63a25..fb3f99da26600dad2dde9bea8327f385ae176a6c 100644 --- a/ckanext/odsh/templates/package/snippets/resource_form.html +++ b/ckanext/odsh/templates/package/snippets/resource_form.html @@ -65,7 +65,7 @@ {% set error_string = _('odsh_resource_format_error_label') if errors.format %} {% set format_attrs = {'data-module': 'odsh_guessformat', 'data-module-formats':h.odsh_resource_formats(true)} %} - {{ form.tpsh_select('format', id='field-format', label=_('Format'), selected=data.format, options=h.odsh_resource_formats(), is_required=True, error=error_string, attrs=format_attrs, classes=['control-full'])}} + {{ form.odsh_select('format', id='field-format', label=_('Format'), selected=data.format, options=h.odsh_resource_formats(), is_required=True, error=error_string, attrs=format_attrs, classes=['control-full'])}} {% endblock %} {% endblock %} diff --git a/ckanext/odsh/templates/package/snippets/resource_item.html b/ckanext/odsh/templates/package/snippets/resource_item.html index b08e58bdbaaf4a5afc1f9ca6191556ddf58a0f40..b6f438c0499de0ff52cbaed5d1eb8671582f166a 100644 --- a/ckanext/odsh/templates/package/snippets/resource_item.html +++ b/ckanext/odsh/templates/package/snippets/resource_item.html @@ -5,7 +5,7 @@ {% set download = h.odsh_public_resource_url(res) or url %} {% set rtitle=h.resource_display_name(res) if res.name else ' '%} -{% set resource_size = h.tpsh_get_resource_size(res) %} +{% set resource_size = h.get_resource_size(res) %} {% set res_format = res.format.replace('_SRVC','') %} <li class="resource-item" data-id="{{ res.id }}"> diff --git a/ckanext/odsh/templates/snippets/organization.html b/ckanext/odsh/templates/snippets/organization.html index 3465d5cd16a241ea896ad76ae02db4a96479c4af..86e9203407ce2d9c79d58d40c9040059232172ce 100644 --- a/ckanext/odsh/templates/snippets/organization.html +++ b/ckanext/odsh/templates/snippets/organization.html @@ -34,7 +34,7 @@ Example: </div> <div class="information-organisation"> - {% set address = h.tpsh_get_address_org(organization) %} + {% set address = h.get_address_org(organization) %} {% set street = address.get('street') %} {% set location = address.get('location') %} {% set mail = address.get('mail') %} @@ -56,7 +56,7 @@ Example: {% if package %} {% set package_name = package.get('name') %} {% set betreff = "Open-Data-Portal Datensatz: "+ package_name%} - {% set body_mail = h.tpsh_get_body_mail(organization, package) %} + {% set body_mail = h.get_body_mail(organization, package) %} {% else %} {% set betreff = "Transparenzportal" %} {% endif %} {# package #} diff --git a/ckanext/odsh/templates/snippets/package_item.html b/ckanext/odsh/templates/snippets/package_item.html index 7130ddce2dbb567275c5259d1d1c2858a5aa451d..a96aa71c6f9c0db1b96acfdda72649fd9d4747e7 100644 --- a/ckanext/odsh/templates/snippets/package_item.html +++ b/ckanext/odsh/templates/snippets/package_item.html @@ -26,8 +26,8 @@ Example: {% set access_count=(package.tracking_summary.total if package.tracking_summary) or '-' %} {% set issued_extra = h.odsh_extract_value_from_extras(package.extras,'issued') %} {% set issued = h.odsh_render_datetime(issued_extra) if issued_extra else h.odsh_render_datetime(package.metadata_created)%} -{% set daterange = h.tpsh_get_daterange_prettified(package) %} -{% set language_of_package = h.tpsh_get_language_of_package(package) %} +{% set daterange = h.get_daterange_prettified(package) %} +{% set language_of_package = h.get_language_of_package(package) %} {% set language_icon = h.get_language_icon(package) %} {% set thumbnail = package.get('thumbnail') %} diff --git a/ckanext/odsh/templates/user/edit_user_form.html b/ckanext/odsh/templates/user/edit_user_form.html index 057a29155668ff269d187f13631828f1dc7cafca..3ed5777bdcc949c347d79c70391f12a5b9560b32 100644 --- a/ckanext/odsh/templates/user/edit_user_form.html +++ b/ckanext/odsh/templates/user/edit_user_form.html @@ -35,7 +35,7 @@ ) }} {{ form.input( - 'password1', type='password', label=_('Password'), id='field-password', value=data.password1, error=errors.password1, classes=['control-medium'], attrs={'autocomplete': 'off', 'data-module': 'tpsh_validate_password'} ) }} + 'password1', type='password', label=_('Password'), id='field-password', value=data.password1, error=errors.password1, classes=['control-medium'], attrs={'autocomplete': 'off', 'data-module': 'odsh_validate_password'} ) }} {{ form.input('password2', type='password', label=_('Confirm Password'), id='field-password-confirm', value=data.password2, error=errors.password2, classes=['control-medium'], attrs={'autocomplete': 'off'}) }} </fieldset> @@ -57,5 +57,5 @@ </form> {% block scripts %} - {% asset 'ckanext-odsh/tpsh_validate_password' %} + {% asset 'ckanext-odsh/odsh_validate_password' %} {% endblock scripts %} \ No newline at end of file diff --git a/ckanext/odsh/validation.py b/ckanext/odsh/validation.py index 8589ee8d9f7641644882af36e6122edc06c4e9ca..e3fa8e24ccd9092fc9d87f7a1e40fe532d72fcf7 100644 --- a/ckanext/odsh/validation.py +++ b/ckanext/odsh/validation.py @@ -318,6 +318,6 @@ def get_validators(): 'known_spatial_uri': known_spatial_uri, 'odsh_validate_extras': validate_extras, 'validate_licenseAttributionByText': validate_licenseAttributionByText, - 'tpsh_validate_relatedPackage': validate_relatedPackage, + 'validate_relatedPackage': validate_relatedPackage, 'odsh_validate_format': validate_formats, }