-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#2750] Tweaks base package_metadata_fields.html and then {% ckan_ext…
…ends %} from it.
- Loading branch information
1 parent
fb09c31
commit 7111901
Showing
2 changed files
with
31 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 28 additions & 36 deletions
64
ckanext/example_idatasetform/templates/package/snippets/package_metadata_fields.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,34 @@ | ||
{% import 'macros/form.html' as form %} | ||
|
||
{% set groups_available = h.groups_available() %} | ||
{% if groups_available %} | ||
<div class="control-group"> | ||
{% set groups = h.dict_list_reduce(data.groups, 'id') %} | ||
<label for="field-groups" class="control-label">{{ _('Add to Groups') }}</label> | ||
<div class="controls"> | ||
<select id="field-groups" name="groups__{{ groups | count }}__id" data-module="autocomplete"> | ||
<option value="">{{ _('Select a group...') }}</option> | ||
{% for group in groups_available %} | ||
<option value="{{ group.id }}" {% if group.id in groups %}selected="selected"{% endif %}>{{ group.name }}</option> | ||
{% endfor %} | ||
</select> | ||
{% ckan_extends %} | ||
|
||
{% block package_metadata_fields %} | ||
|
||
{% set groups_available = h.groups_available() %} | ||
{% if groups_available %} | ||
<div class="control-group"> | ||
{% set groups = h.dict_list_reduce(data.groups, 'id') %} | ||
<label for="field-groups" class="control-label">{{ _('Add to Groups') }}</label> | ||
<div class="controls"> | ||
<select id="field-groups" name="groups__{{ groups | count }}__id" data-module="autocomplete"> | ||
<option value="">{{ _('Select a group...') }}</option> | ||
{% for group in groups_available %} | ||
<option value="{{ group.id }}" {% if group.id in groups %}selected="selected"{% endif %}>{{ group.name }}</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
{% endif %} | ||
|
||
{{ form.input('author', label=_('Author'), id='field-author', placeholder=_('Joe Bloggs'), value=data.author, error=errors.author, classes=['control-medium']) }} | ||
{% endif %} | ||
|
||
{{ form.input('author_email', label=_('Author Email'), id='field-author-email', placeholder=_('joe@example.com'), value=data.author_email, error=errors.author_email, classes=['control-medium']) }} | ||
{{ super() }} | ||
|
||
{{ form.input('maintainer', label=_('Maintainer'), id='field-maintainer', placeholder=_('Joe Bloggs'), value=data.maintainer, error=errors.maintainer, classes=['control-medium']) }} | ||
|
||
{{ form.input('maintainer_email', label=_('Maintainer Email'), id='field-maintainer-email', placeholder=_('joe@example.com'), value=data.maintainer_email, error=errors.maintainer_email, classes=['control-medium']) }} | ||
|
||
<label class="control-label" for="field-country_code">{{ _("Country Code") }}</label> | ||
<div class="controls"> | ||
<select id="field-country_code" name="country_code" data-module="autocomplete"> | ||
{% for country_code in h.country_codes() %} | ||
<option value="{{ country_code }}" {% if country_code in data.get('country_code', []) %}selected="selected"{% endif %}>{{ country_code }}</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
<label class="control-label" for="field-country_code">{{ _("Country Code") }}</label> | ||
<div class="controls"> | ||
<select id="field-country_code" name="country_code" data-module="autocomplete"> | ||
{% for country_code in h.country_codes() %} | ||
<option value="{{ country_code }}" {% if country_code in data.get('country_code', []) %}selected="selected"{% endif %}>{{ country_code }}</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
|
||
{{ form.input('custom_text', label=_('Custom Text'), id='field-custom_text', placeholder=_('custom text'), value=data.custom_text, error=errors.custom_text, classes=['control-medium']) }} | ||
{{ form.input('custom_text', label=_('Custom Text'), id='field-custom_text', placeholder=_('custom text'), value=data.custom_text, error=errors.custom_text, classes=['control-medium']) }} | ||
|
||
{# | ||
{% block custom_fields %} | ||
{% snippet 'snippets/custom_form_fields.html', extras=data.extras, errors=errors, limit=3 %} | ||
{% endblock %} | ||
#} |