forked from ckan/ckanext-scheming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
organization.html
36 lines (31 loc) · 1.36 KB
/
organization.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{# This is specific to datasets' owner_org field and won't work #}
{# if used with other fields #}
{% macro organization_option_tag(organization, selected_org) %}
{% block organization_option scoped %}
<option value="{{ organization.id }}"{%
if selected_org %} selected="selected"{% endif
%}>{{ organization.display_name }}</option>
{% endblock %}
{% endmacro %}
<div data-module="dataset-visibility">
{% snippet "scheming/form_snippets/_organization_select.html",
field=field,
data=data,
errors=errors,
organizations_available=h.organizations_available('create_dataset'),
org_required=not h.check_config_permission('create_unowned_dataset')
or h.scheming_field_required(field),
organization_option_tag=organization_option_tag %}
{% block package_metadata_fields_visibility %}
<div class="control-group form-group control-medium">
<label for="field-private" class="control-label">{{ _('Visibility') }}</label>
<div class="controls">
<select id="field-private" name="private" class="form-control">
{% for option in [('True', _('Private')), ('False', _('Public'))] %}
<option value="{{ option[0] }}" {% if option[0] == data.private|trim %}selected="selected"{% endif %}>{{ option[1] }}</option>
{% endfor %}
</select>
</div>
</div>
{% endblock %}
</div>