<commit_before>{% set ofi = ofi or {} %}


{# button for modal is in snippets/resource_form.html #}
{#<a href="#ofi-results" role="button" class="btn btn-primary" data-toggle="modal">View OFI Results</a>#}

{# TODO: deal with bcgov.ofi.enable = false #}

<div id="ofi-results" class="modal hide fade" tabindex="-1" role="dialog"
  data-module="ofi_modal"
  data-module-ofi_results="{{ h.dump_json(ofi) }}"
  data-module-package_id="{{ pkg_id }}"
  data-module-object_name="{{ pkg_obj_name or false }}"
  data-module-ofi_geo_resource_form_url="{{ h.url_for('ofi api', call_action='geo_resource_form') }}"
  data-module-ofi_populate_dataset_url="{{ h.url_for('ofi api', call_action='populate_dataset_with_ofi') }}"
  data-module-ofi_remove_resources_url="{{ h.url_for('ofi api', call_action='remove_ofi_resources') }}"
  data-module-ofi_edit_resources_url="{{ h.url_for('ofi api', call_action='edit_ofi_resources') }}"
  data-module-to_dataset_page_url="{{ h.url_for('dataset_read', id=pkg_name) }}"
>

    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3>Manage OFI Resources</h3>
        <h4 id="modal-subtitle">
        {% if ofi['ofi_exists'] %}
            Manage
        {% elif pkg_obj_name == '' %}
            No Object Name
        {% else %}
            Checking Availability
        {% endif %}
        </h4>
    </div>

    <div class="modal-body">
        <form id="ofi-lookup-form" class="form-horizontal">
            <div id="resources">
                {% if ofi['ofi_exists'] %}
                    <div>OFI Resources are present in this dataset.</div>
                {% elif pkg_obj_name == '' %}
                    <h4 style="text-align:center;">No 'Object Name' exists for this dataset.</h4>
                    <h4 style="text-align:center;">Would you like to create the resources anyways?</h4>
                {% else %}
                    {% set content = ofi['content'] or false %}
                    {% if content['allowed'] %}
                        <h4 style="text-align:center;">Object is available, would you like to add all the resource links?</h4>
                    {% else %}
                        <div>Object is not available, please contact your administrator.</div>
                    {% endif %}
                {% endif %}
            </div>
        </form>
    </div>

    <div class="modal-footer">
        <button id="ofi-cancel" class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
        {% if ofi['ofi_exists'] %}
            <button id="ofi-delete" class="btn btn-danger pull-left">Delete</button>
            <button id="ofi-edit" class="btn btn-primary">Edit</button>
        {% elif pkg_obj_name == '' %}
            <button id="ofi-force-confirm" class="btn btn-primary">Yes</button>
        {% else %}
            {% set content = ofi['content'] or false %}
            {% if content['allowed'] %}
                <button id="ofi-confirm" class="btn btn-primary">Yes</button>
            {% endif %}
        {% endif %}
    </div>

    {# TODO: stop animation when not visible #}
    <div id="loading" class="overlay-wrap">
        <div class="add-data-loader">Loading...</div>
    </div>
</div><commit_msg>Reverting the UI for forcing ofi resources in datasets<commit_after>{% set ofi = ofi or {} %}


{# button for modal is in snippets/resource_form.html #}
{#<a href="#ofi-results" role="button" class="btn btn-primary" data-toggle="modal">View OFI Results</a>#}

{# TODO: deal with bcgov.ofi.enable = false #}

<div id="ofi-results" class="modal hide fade" tabindex="-1" role="dialog"
  data-module="ofi_modal"
  data-module-ofi_results="{{ h.dump_json(ofi) }}"
  data-module-package_id="{{ pkg_id }}"
  data-module-object_name="{{ pkg_obj_name or false }}"
  data-module-ofi_geo_resource_form_url="{{ h.url_for('ofi api', call_action='geo_resource_form') }}"
  data-module-ofi_populate_dataset_url="{{ h.url_for('ofi api', call_action='populate_dataset_with_ofi') }}"
  data-module-ofi_remove_resources_url="{{ h.url_for('ofi api', call_action='remove_ofi_resources') }}"
  data-module-ofi_edit_resources_url="{{ h.url_for('ofi api', call_action='edit_ofi_resources') }}"
  data-module-to_dataset_page_url="{{ h.url_for('dataset_read', id=pkg_name) }}"
>

    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3>Manage OFI Resources</h3>
        <h4 id="modal-subtitle">
        {% if ofi['ofi_exists'] %}
            Manage
        {% elif pkg_obj_name == '' %}
            No Object Name
        {% else %}
            Checking Availability
        {% endif %}
        </h4>
    </div>

    <div class="modal-body">
        <form id="ofi-lookup-form" class="form-horizontal">
            <div id="resources">
                {% if ofi['ofi_exists'] %}
                    <div>OFI Resources are present in this dataset.</div>
                {% elif pkg_obj_name == '' %}
                    <div>No 'Object Name' exists for this dataset. Add an 'Object Name' to the dataset, for OFI.</div>
                    {#<h4 style="text-align:center;">No 'Object Name' exists for this dataset.</h4>#}
                    {#<h4 style="text-align:center;">Would you like to create the resources anyways?</h4>#}
                {% else %}
                    {% set content = ofi['content'] or false %}
                    {% if content['allowed'] %}
                        <h4 style="text-align:center;">Object is available, would you like to add all the resource links?</h4>
                    {% else %}
                        <div>Object is not available, please contact your administrator.</div>
                    {% endif %}
                {% endif %}
            </div>
        </form>
    </div>

    <div class="modal-footer">
        <button id="ofi-cancel" class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
        {% if ofi['ofi_exists'] %}
            <button id="ofi-delete" class="btn btn-danger pull-left">Delete</button>
            <button id="ofi-edit" class="btn btn-primary">Edit</button>
        {#{% elif pkg_obj_name == '' %}
            <button id="ofi-force-confirm" class="btn btn-primary">Yes</button>
        {% else %}#}
        {% elif pkg_obj_name != '' %}
            {% set content = ofi['content'] or false %}
            {% if content['allowed'] %}
                <button id="ofi-confirm" class="btn btn-primary">Yes</button>
            {% endif %}
        {% endif %}
    </div>

    {# TODO: stop animation when not visible #}
    <div id="loading" class="overlay-wrap">
        <div class="add-data-loader">Loading...</div>
    </div>
</div>
{'fraction_non_alphanumeric': 0.1669626998223801, 'fraction_numerical': 0.003256364712847839, 'mean_word_length': 2.4474489795918366, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 93, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7237714', 'n_tokens_mistral': 2211, 'n_tokens_neox': 2057, 'n_words': 439}