Skip to content

Commit

Permalink
Improve schemas and templates
Browse files Browse the repository at this point in the history
- Add metadata elemnents to schemas.
- Fix templates.
- Fix spatial_uri icons.
  • Loading branch information
mjanez committed Oct 20, 2023
1 parent cdb0b9a commit 889d560
Show file tree
Hide file tree
Showing 38 changed files with 538 additions and 31,493 deletions.
16 changes: 15 additions & 1 deletion ckanext/scheming_dcat/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ def process_language_content(language_label):
return lang_text

lang_label = f"[#{current_lang}#]"
default_lang = p.toolkit.config.get('ckan.locale_default', 'en')
default_lang = schemingdct_get_default_lang()
default_lang_label = f"[#{default_lang}#]"

lang_text = process_language_content(lang_label)
Expand Down Expand Up @@ -767,3 +767,17 @@ def scheming_dct_get_localized_value_from_dict(package_or_package_dict, field_na
package_or_package_dict.get(field_name, None)

return value if value is not None else default

@helper
def scheming_dct_get_readable_file_size(num, suffix='B'):
if not num:
return False
try:
for unit in ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']:
num = float(num)
if abs(num) < 1024.0:
return "%3.1f%s%s" % (num, unit, suffix)
num /= 1024.0
return "%.1f%s%s" % (num, 'Y', suffix)
except ValueError:
return False
2,611 changes: 1 addition & 2,610 deletions ckanext/scheming_dcat/public/images/icons/spatial_uri/autonomia/andalucia.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,262 changes: 1 addition & 1,261 deletions ckanext/scheming_dcat/public/images/icons/spatial_uri/autonomia/aragon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Loading

0 comments on commit 889d560

Please sign in to comment.