Skip to content
Snippets Groups Projects
Commit ae9cf483 authored by Thorge Petersen's avatar Thorge Petersen
Browse files

Started removing controllers from url_for

parent cb16673c
No related branches found
No related tags found
2 merge requests!41Version 2.0.0,!38Merge py3 into dev
......@@ -50,7 +50,7 @@
<div class="form-actions">
{% block delete_button %}
{% if h.check_access('organization_delete', {'id': data.id}) %}
<a class="btn btn-danger pull-left" href="{% url_for controller='organization', action='delete', id=data.id %}" data-module="confirm-action" data-module-content="{{ _('Are you sure you want to delete this Organization? This will delete all the public and private datasets belonging to this organization.') }}">{% block delete_button_text %}{{ _('Delete') }}{% endblock %}</a>
<a class="btn btn-danger pull-left" href="{% url_for group_type+'.delete', id=data.id %}" data-module="confirm-action" data-module-content="{{ h.humanize_entity_type('organization', group_type, 'delete confirmation') or _('Are you sure you want to delete this Organization? Note*: Deleting cannot be performed while public or private datasets belong to this organization.') }}">{% block delete_button_text %}{{ _('Delete') }}{% endblock %}</a>
{% endif %}
{% endblock %}
<button class="btn btn-primary" name="save" type="submit">{% block save_text %}{{ _('Save Organization') }}{% endblock %}</button>
......
......@@ -5,8 +5,7 @@
{% set active = data and data.state=='active' %}
{% set action = form_action or h.url_for(controller='resource', action='new', id=pkg_name) %}
<form id="resource-edit" class="dataset-form dataset-resource-form {%if(data)%}resource-edit-form{%endif%}" method="post" action="{{ action }}" data-module="basic-form resource-form"
enctype="multipart/form-data" novalidate>
<form id="resource-edit" class="dataset-form dataset-resource-form {%if(data)%}resource-edit-form{%endif%}" method="post" action="{{ action }}" data-module="basic-form resource-form" enctype="multipart/form-data" novalidate>
{% block stages %}
<div class='search-form'>
<h2>{{ _('odsh Create Dataset') }}</h2>
......@@ -38,8 +37,7 @@
value=data.name, error=error_string, classes=['control-full'], is_required=false) }}
{% endblock %}
{% block basic_fields_description %}
{% endblock %}
{% block basic_fields_description %}{% endblock %}
{% endblock basic_fields %}
......@@ -69,13 +67,13 @@
{% set format_attrs = {} %}
{% set error_string = _('odsh_resource_format_error_label') if errors.format %}
{% call form.input('format', id='field-format', label=_('Format'), placeholder=_('eg. CSV, XML or JSON'), value=data.format, error=error_string, is_required=true, classes=['control-full'],attrs=format_attrs) %}
{% call form.input('format', id='field-format', label=_('Format'), placeholder=_('eg. CSV, XML or JSON'),
value=data.format, error=error_string, is_required=true, classes=['control-full'],attrs=format_attrs) %}
{% endcall %}
{% endblock %}
{% endblock %}
<div class='row-fluid'>
<div class="span6">
<div class='row-fluid'> <div class="span6">
<div class="form-actions resource-buttons">
{% if stage %}
......@@ -83,7 +81,8 @@
<button class="btn btn-arrow-right" name="save" value="go-dataset" type="submit">{{ _('Back') }}</button>
{% endblock %}
{% block again_button %}
<button class="btn float-right btn-arrow-right" name="save" value="again" type="submit">{{_('Another dataset')}}</button>
<button class="btn float-right btn-arrow-right" name="save" value="again" type="submit">{{_('Another
dataset')}}</button>
{% endblock %}
{% endif %}
</div>
......@@ -91,19 +90,26 @@
{% block delete_button %}
{% if data.id %}
{% if h.check_access('resource_delete', {'id': data.id}) %}
<a class="btn btn-danger pull-left" href="{% url_for controller='dataset', action='resource_delete', resource_id=data.id, id=pkg_name %}"
data-module="confirm-action" data-module-content="{{ _('Are you sure you want to delete this resource?') }}">{%
block delete_button_text %}{{ _('Delete') }}{% endblock %}</a>
<a class="btn btn-danger pull-left" href="{% url_for dataset_type ~ '_resource.delete', resource_id=data.id, id=pkg_name %}" data-module="confirm-action" data-module-content="{{ _('Are you sure you want to delete this resource?') }}">
{% block delete_button_text
%}
{{ _('Delete') }}
{% endblock %}
</a>
{% endif %}
{% endif %}
{% endblock %}
{% if stage %}
{% block save_button %}
<input type='hidden' name='save' value='go-metadata'/>
<div id='form-submit-button' data-module="odsh_form" data-module-validateformat='true' class="btn btn-primary btn-arrow-right" name="save" value="go-metadata">{% block
<div id='form-submit-button' data-module="odsh_form" data-module-validateformat='true' class="btn btn-primary btn-arrow-right" name="save" value="go-metadata">
{% block
save_button_text
%}{{
_('Upload dataset') }}{% endblock %}</div>
%}
{{
_('Upload dataset') }}
{% endblock %}
</div>
{% endblock %}
{% else %}
{% block add_button %}
......
......@@ -43,12 +43,12 @@
<div class="form-actions">
{% block delete_button %}
{% if h.check_access('user_delete', {'id': data.id}) %}
<a class="btn btn-danger pull-left" href="{% url_for controller='user', action='delete', id=data.id %}" data-module="confirm-action" data-module-content="{{ _('Are you sure you want to delete this User?') }}">{% block delete_button_text %}{{ _('Delete') }}{% endblock %}</a>
<a class="btn btn-danger pull-left" href="{% url_for 'user_delete', id=data.id %}" data-module="confirm-action" data-module-content="{{ _('Are you sure you want to delete this User?') }}">{% block delete_button_text %}{{ _('Delete') }}{% endblock %}</a>
{% endif %}
{% endblock %}
{% block generate_button %}
{% if h.check_access('user_generate_apikey', {'id': data.id}) %}
<a class="btn btn-warning" href="{% url_for controller='user', action='generate_apikey', id=data.id %}" data-module="confirm-action" data-module-content="{{ _('Are you sure you want to regenerate the API key?') }}">{% block generate_button_text %}{{ _('Regenerate API Key') }}{% endblock %}</a>
<a class="btn btn-warning" href="{% url_for 'user_generate_apikey', id=data.id %}" data-module="confirm-action" data-module-content="{{ _('Are you sure you want to regenerate the API key?') }}">{% block generate_button_text %}{{ _('Regenerate API Key') }}{% endblock %}</a>
{% endif %}
{% endblock %}
{{ form.required_message() }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment