diff --git a/ckanext/odsh/fanstatic/odsh_form.js b/ckanext/odsh/fanstatic/odsh_form.js index 0562849c43075ed6efff88ae05605d625f6c8e5a..768655b18f731b019b846fdf21500961114c318b 100644 --- a/ckanext/odsh/fanstatic/odsh_form.js +++ b/ckanext/odsh/fanstatic/odsh_form.js @@ -30,13 +30,14 @@ ckan.module('odsh_form', function ($) // TODO: this implementation should be more generic var id = '#field-license'; var id_name = '#field-licenseAttributionByText-value'; + var autofill=this.options.autofill var toggle = function () { let text = $(id + ' option:selected').text() if (text.indexOf('Namensnennung') !== -1) { $(id_name).prop('disabled', false); - if (!$(id_name).val()) + if (!$(id_name).val()&&autofill) $(id_name).val($('#field-organizations option:selected').text()); } else { diff --git a/ckanext/odsh/helpers.py b/ckanext/odsh/helpers.py index 92ee251f9a24963ab2c2607ae0f8db6b62ac9787..1627d920e3e3c8b622badbcbfe064c21d8ed0a60 100644 --- a/ckanext/odsh/helpers.py +++ b/ckanext/odsh/helpers.py @@ -165,7 +165,8 @@ def odsh_extract_error_new(key, errors): if not errors or not ('__extras' in errors): return None error = errors['__extras'][0].get(key,None) - return error + if error: + return key + ': ' + error def odsh_extract_value_from_extras(extras, key): if not extras: diff --git a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo index 621d249dadacd7b628fc15fa6ccd6f87096605a4..f6ea89603905f9e8c34163ed34e4c37f6745d5fb 100644 Binary files a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo and b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.mo differ diff --git a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po index 65fedcd30ec440290573a2481989e0ff9dbb1b8b..9fc567af469450a0bf3b26b233e2450c43976f33 100644 --- a/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po +++ b/ckanext/odsh/i18n/de/LC_MESSAGES/ckanext-odsh.po @@ -235,9 +235,14 @@ msgstr "Bitte geben Sie ein Format an" msgid "odsh_licence_text_missing_error_label" msgstr "Bitte geben Sie einen Namen an" +msgid "licenseAttributionByText: empty not allowed" +msgstr "Bitte geben Sie einen Namen an" + msgid "odsh_licence_text_not_allowed_error_label" msgstr "Ein Name ist bei dieser Lizenz nicht zulässig" +msgid "licenseAttributionByText: text not allowed for this license" +msgstr "Ein Name ist bei dieser Lizenz nicht zulässig" msgid "Followers" msgstr "Abonennten" @@ -351,5 +356,5 @@ msgstr "verwendet URIs" msgid "4LD" msgstr "Linked Data" -msgid "at least one group needed" +msgid "groups: at least one group needed" msgstr "Bitte geben Sie mindestens eine Kategorie an" \ No newline at end of file diff --git a/ckanext/odsh/templates/package/snippets/package_basic_fields.html b/ckanext/odsh/templates/package/snippets/package_basic_fields.html index 29ba4e244271eadd5fa17428093b6ddc8a261fc0..8371d5d73f5175b54e670773ce6bcbd2fa3dcaac 100644 --- a/ckanext/odsh/templates/package/snippets/package_basic_fields.html +++ b/ckanext/odsh/templates/package/snippets/package_basic_fields.html @@ -59,7 +59,7 @@ is_required=true,placeholder=_('Enter title')) }} <!-- field license --> - {% set error_missing_attr = h.odsh_extract_error('licenseAttributionByText', errors) %} + {% set error_missing_attr = h.odsh_extract_error_new('licenseAttributionByText', errors) %} <label class="control-label" for="field-license"> {{ _("License") }}: <span title="{{ _("This field is required") }}" class="control-required">*</span> @@ -88,7 +88,7 @@ is_required=true,placeholder=_('Enter title')) }} <div class="control-group {{ " error" if error_missing_attr }} control-full"> <div class="controls"> {{ form.input_extra(field, value=value, index=h.odsh_create_checksum(field), type='text', attrs={'disabled':true, - 'data-module':"odsh_form", 'data-module-licensetoggle':'true' }, placeholder=_('enter name')) }} + 'data-module':"odsh_form", 'data-module-licensetoggle':'true', 'data-module-autofill':'true'}, placeholder=_('enter name')) }} </div> </div> </div> @@ -172,7 +172,7 @@ is_required=true,placeholder=_('Enter title')) }} </div> <div class="span6 inline-error"> {% if error %} - {{_('issued: ' + error)}} + {{_(error)}} {% endif %} </div> </div>