forked from EnviDat/ckanext-restricted
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[!Not backwards compatible!] remove dependency on ckanext-scheming an…
…d ckanext-composite we get a more self-contained plugin that may work without additionnaly fiddling fixes EnviDat#15
- Loading branch information
1 parent
065a336
commit 89693f5
Showing
4 changed files
with
60 additions
and
90 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
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
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
22 changes: 22 additions & 0 deletions
22
ckanext/restricted/templates/package/snippets/resource_form.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% ckan_extends %} | ||
|
||
{% block metadata_fields %} | ||
|
||
{{ super() }} | ||
|
||
<div class="form-group control-full"> | ||
<label class="control-label" for="field-document_type">{{ _("Restriction") }}</label> | ||
<div class="controls"> | ||
<select id="field-restricted_level" name="restricted_level" class="form-control"> | ||
<option value="public"{% if data.get('restricted_level') == 'public' %} selected="selected"{% endif %}>public</option> | ||
<option value="registered"{% if data.get('restricted_level') == 'registered' %} selected="selected"{% endif %}>membre enregistrés</option> | ||
<option value="same_organization"{% if data.get('restricted_level') == 'same_organization' %} selected="selected"{% endif %}>membre de l'organisation</option> | ||
<option value="only_allowed_users"{% if data.get('restricted_level') == 'only_allowed_users' %} selected="selected"{% endif %}>personnes authorisées</option> | ||
</select> | ||
</div> | ||
</div> | ||
|
||
{% set tag_attrs = {'data-module': 'autocomplete', 'data-module-tags': '', 'data-module-source': '/api/2/util/user/autocomplete?q=?'} %} | ||
{{ form.input('restricted_allowed_users', id='field-restricted_allowed_users', label=_('Allowed users'), placeholder=_('Specific users who can access resources'), value=data.get('restricted_allowed_users'), error=errors.tags, classes=['control-full'], attrs=tag_attrs) }} | ||
|
||
{% endblock %} |