Skip to content

Commit

Permalink
Merge pull request #607 from okfn/607-allow-reactivating-datasets
Browse files Browse the repository at this point in the history
Can not reactivate a deleted dataset from the UI
  • Loading branch information
johnmartin committed Dec 10, 2013
2 parents fde7020 + bf11648 commit 210ecae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions ckan/templates/package/snippets/package_basic_fields.html
Expand Up @@ -99,4 +99,17 @@
</div>
{% endif %}


{% if data.id and h.check_access('package_delete', {'id': data.id}) and data.state != 'active' %}
<div class="control-group">
<label for="field-state" class="control-label">{{ _('State') }}</label>
<div class="controls">
<select id="field-state" name="state">
<option value="active" {% if data.get('state', 'none') == 'active' %} selected="selected" {% endif %}>{{ _('Active') }}</option>
<option value="deleted" {% if data.get('state', 'none') == 'deleted' %} selected="selected" {% endif %}>{{ _('Deleted') }}</option>
</select>
</div>
</div>
{% endif %}

{% endblock %}
2 changes: 1 addition & 1 deletion ckan/templates/package/snippets/package_form.html
Expand Up @@ -33,7 +33,7 @@
</p>
{% endblock %}
{% block delete_button %}
{% if h.check_access('package_delete', {'id': data.id}) %}
{% if h.check_access('package_delete', {'id': data.id}) and not data.state == 'deleted' %}
{% set locale = h.dump_json({'content': _('Are you sure you want to delete this dataset?')}) %}
<a class="btn btn-danger pull-left" href="{% url_for controller='package', action='delete', id=data.id %}" data-module="confirm-action" data-module-i18n="{{ locale }}">{% block delete_button_text %}{{ _('Delete') }}{% endblock %}</a>
{% endif %}
Expand Down

0 comments on commit 210ecae

Please sign in to comment.