Skip to content

Commit

Permalink
[#953] Move new dataset visibility to first stage
Browse files Browse the repository at this point in the history
Move the visibility option (public or private) when creating a dataset
to the first stage of the dataset creation form. This fixes the issue
(#953) that an activity is emitted when creating private datasets. Since
the dataset is actually created when the first form is submitted, and
the public/private setting is not chosen until the third form, the
dataset is public at the moment when it's created and an activity is
emitted.

It seems to make a lot more sense fo the visibility option to be on the
first form next to the organization option anyway.

Fixes #953.
  • Loading branch information
Sean Hammond authored and amercader committed Jul 1, 2013
1 parent ce12b3c commit 2dfe7b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
14 changes: 14 additions & 0 deletions ckan/templates/package/snippets/package_basic_fields.html
Expand Up @@ -71,4 +71,18 @@
</div>
{% endif %}
{% endif %}

{% block package_metadata_fields_visibility %}
<div class="control-group">
<label for="field-private" class="control-label">{{ _('Visibility') }}</label>
<div class="controls">
<select id="field-private" name="private" data-module="autocomplete">
{% for option in [(true, _('Private')), (false, _('Public'))] %}
<option value="{{ option[0] }}" {% if option[0] == data.private %}selected="selected"{% endif %}>{{ option[1] }}</option>
{% endfor %}
</select>
</div>
</div>
{% endblock %}

{% endblock %}
15 changes: 0 additions & 15 deletions ckan/templates/package/snippets/package_metadata_fields.html
Expand Up @@ -2,21 +2,6 @@

{% block package_metadata_fields %}

{% block package_metadata_fields_visibility %}
{% if data.owner_org %}
<div class="control-group">
<label for="field-private" class="control-label">{{ _('Visibility') }}</label>
<div class="controls">
<select id="field-private" name="private" data-module="autocomplete">
{% for option in [(true, _('Private')), (false, _('Public'))] %}
<option value="{{ option[0] }}" {% if option[0] == data.private %}selected="selected"{% endif %}>{{ option[1] }}</option>
{% endfor %}
</select>
</div>
</div>
{% endif %}
{% endblock %}

{% block package_metadata_author %}
{{ form.input('author', label=_('Author'), id='field-author', placeholder=_('Joe Bloggs'), value=data.author, error=errors.author, classes=['control-medium']) }}

Expand Down

0 comments on commit 2dfe7b6

Please sign in to comment.