<commit_before>{% extends eport_base|default:"reports/async/default.html" %}
{% load xforms_extras %}
{% load hq_shared_tags %}

{% block js %} {{ block.super }}
    <script type="text/javascript" src="{% static 'reports/javascripts/reports.download_export.js' %}"></script>
    <script type="text/javascript" src="{% static 'reports/ko/export.manager.js' %}"></script>
{% endblock %}
{% block js-inline %}{{ block.super }}
    <script type="text/javascript">
        var exportDownloader = new HQExportDownloader({});
        exportDownloader.init();

        var exportManager = new ExportManager( {
            domain: '{{ domain }}',
            exportFilters: '{{ get_filter_params.urlencode|safe }}',
            downloadUrl: '{% url download_cases domain %}'
        } );
        $('#full-case-export').one().each(function () {
            ko.applyBindings(exportManager, this);
        });

    </script>
{% endblock %}

{% block reportcontent %}
    <div id="full-case-export" class="form-horizontal hq-form-report">
        <fieldset style="margin-top: 2em;">
            <legend>Download Settings</legend>
            <div class="control-group">
                <label for="include-closed-select" class="control-label">Download</label>
                <div class="controls">
                    <select class="input-small" name="include_closed" id="include-closed-select">
                        <option value="false">all open</option>
                        <option value="true">all</option>
                    </select> cases, all referrals, and all CHW users.
                </div>
            </div>
        </fieldset>
        <div class="form-actions">
            <a data-toggle="modal" href="#export-download-status"
               data-bind="click: requestCaseDownload"
               class="btn btn-primary btn-large dl-export" ><i class="icon-download-alt icon-white"></i> Download</a>
        </div>
    </div>

    <div class="hq-generic-report form-horizontal">
        <h2>Saved Custom Exports</h2>

        {% if saved_exports %}
        <table class="export_data table table-striped">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Preview</th>
                    <th>Edit</th>
                    <th>Download</th>
                    <th>Delete</th>
                </tr>
            </thead>
            <tbody>
                {% for export in saved_exports %}
                <tr class="{% cycle "odd" "even" %}">
                    <td>{{ export.name|default:"[blank]" }}</td>
                    <td class="cell-vertical-centered">
                        <a class="btn" href='{% url export_custom_data domain export.get_id %}?type=case&format=html&{{ get_filter_params.urlencode|safe }}'>
                            HTML Preview
                        </a>
                    </td>
                    <td class="cell-vertical-centered">
                        <a class="btn btn-info" href='{% url corehq.apps.reports.views.edit_custom_export domain export.get_id %}?type=case'>
                            <i class="icon-pencil icon-white"></i> Edit
                        </a>
                    </td>
                    <td class="cell-vertical-centered">
                        <a data-toggle="modal" href="#export-download-status" data-formname="{{ export.name }}" data-dlocation='{% url export_custom_data domain export.get_id %}?type=case&{{ get_filter_params.urlencode|safe }}&async=true'
                           class="btn btn-primary export-action-download" ><i class="icon-download-alt icon-white"></i> Download</a>
                    </td>
                    <td class="cell-vertical-centered">
                        <a class="btn btn-danger" data-toggle="modal" class="delete_link" href="#delete-export-modal-{{ export.get_id }}"><i class="icon-remove icon-white"></i> Delete</a>
                        {% include "reports/dialogs/delete_custom_export_dialog.html" %}
                     </td>
                 </tr>
                {% endfor %}
            </tbody>
        </table>
        {% else %}
        <div class="alert alert-info">
            <strong>No Custom Exports yet!</strong> Click "Create Custom Export" on a form below to make one.
        </div>
        {% endif %}

        {% if case_types %}
            <h2>Export cases</h2>
            <table class="export_data table table-striped">
                <thead>
                <tr>
                    <th>Case Type</th>
                    <th>Custom Export</th>
                </tr>
                </thead>
                <tbody>
                {% for case in case_types %}
                    <tr class="{% cycle "odd" "even" %}">
                        <td>
                            {% ifchanged %}
                                {% if case %}
                                    {{ case }}
                                {% else %}
                                    Unknown Case <!---->
                                {% endif %}
                            {% endifchanged %}
                        </td>
                        <td class="cell-vertical-centered">
                            {% if case %}
                                <a class="btn" href='{% url corehq.apps.reports.views.custom_export domain %}?export_tag="{{ case }}"&type=case'><i class="icon-star-empty"></i> Create Custom Export</a>
                            {% endif %}
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        {% endif %}
<commit_msg>translate case export<commit_after>{% extends report_base|default:"reports/async/default.html" %}
{% load xforms_extras %}
{% load hq_shared_tags %}
{% load i18n %}

{% block js %} {{ block.super }}
    <script type="text/javascript" src="{% static 'reports/javascripts/reports.download_export.js' %}"></script>
    <script type="text/javascript" src="{% static 'reports/ko/export.manager.js' %}"></script>
{% endblock %}
{% block js-inline %}{{ block.super }}
    <script type="text/javascript">
        var exportDownloader = new HQExportDownloader({});
        exportDownloader.init();

        var exportManager = new ExportManager( {
            domain: '{{ domain }}',
            exportFilters: '{{ get_filter_params.urlencode|safe }}',
            downloadUrl: '{% url download_cases domain %}'
        } );
        $('#full-case-export').one().each(function () {
            ko.applyBindings(exportManager, this);
        });

    </script>
{% endblock %}

{% block reportcontent %}
    <div id="full-case-export" class="form-horizontal hq-form-report">
        <fieldset style="margin-top: 2em;">
            <legend>Download Settings</legend>
            <div class="control-group">
                <label for="include-closed-select" class="control-label">{% trans "Download" %}</label>
                <div class="controls">
                    <select class="input-small" name="include_closed" id="include-closed-select">
                        <option value="false">{% trans "all open" %}</option>
                        <option value="true">{% trans "all" %}</option>
                    </select> {% trans "cases, all referrals, and all CHW users." %}
                </div>
            </div>
        </fieldset>
        <div class="form-actions">
            <a data-toggle="modal" href="#export-download-status"
               data-bind="click: requestCaseDownload"
               class="btn btn-primary btn-large dl-export" ><i class="icon-download-alt icon-white"></i> {% trans "Download" %}</a>
        </div>
    </div>

    <div class="hq-generic-report form-horizontal">
        <h2>{% trans "Saved Custom Exports" %}</h2>

        {% if saved_exports %}
        <table class="export_data table table-striped">
            <thead>
                <tr>
                    <th>{% trans "Name" %}</th>
                    <th>{% trans "Preview" %}</th>
                    <th>{% trans "Edit" %}</th>
                    <th>{% trans "Download" %}</th>
                    <th>{% trans "Delete" %}</th>
                </tr>
            </thead>
            <tbody>
                {% for export in saved_exports %}
                <tr class="{% cycle "odd" "even" %}">
                    <td>{{ export.name|default:"[blank]" }}</td>
                    <td class="cell-vertical-centered">
                        <a class="btn" href='{% url export_custom_data domain export.get_id %}?type=case&format=html&{{ get_filter_params.urlencode|safe }}'>
                            {% trans "HTML Preview" %}
                        </a>
                    </td>
                    <td class="cell-vertical-centered">
                        <a class="btn btn-info" href='{% url corehq.apps.reports.views.edit_custom_export domain export.get_id %}?type=case'>
                            <i class="icon-pencil icon-white"></i> {% trans "Edit" %}
                        </a>
                    </td>
                    <td class="cell-vertical-centered">
                        <a data-toggle="modal" href="#export-download-status" data-formname="{{ export.name }}" data-dlocation='{% url export_custom_data domain export.get_id %}?type=case&{{ get_filter_params.urlencode|safe }}&async=true'
                           class="btn btn-primary export-action-download" ><i class="icon-download-alt icon-white"></i> {% trans "Download" %}</a>
                    </td>
                    <td class="cell-vertical-centered">
                        <a class="btn btn-danger" data-toggle="modal" class="delete_link" href="#delete-export-modal-{{ export.get_id }}"><i class="icon-remove icon-white"></i> {% trans "Delete" %}</a>
                        {% include "reports/dialogs/delete_custom_export_dialog.html" %}
                     </td>
                 </tr>
                {% endfor %}
            </tbody>
        </table>
        {% else %}
        <div class="alert alert-info">
            <strong>{% trans "No Custom Exports yet!" %}</strong> {% trans 'Click "Create Custom Export" on a form below to make one.' %}
        </div>
        {% endif %}

        {% if case_types %}
            <h2>{% trans "Export cases" %}</h2>
            <table class="export_data table table-striped">
                <thead>
                <tr>
                    <th>{% trans "Case Type" %}</th>
                    <th>{% trans "Custom Export" %}</th>
                </tr>
                </thead>
                <tbody>
                {% for case in case_types %}
                    <tr class="{% cycle "odd" "even" %}">
                        <td>
                            {% ifchanged %}
                                {% if case %}
                                    {{ case }}
                                {% else %}
                                    {% trans "Unknown Case" %}
                                {% endif %}
                            {% endifchanged %}
                        </td>
                        <td class="cell-vertical-centered">
                            {% if case %}
                                <a class="btn" href='{% url corehq.apps.reports.views.custom_export domain %}?export_tag="{{ case }}"&type=case'><i class="icon-star-empty"></i> {% trans "Create Custom Export" %}</a>
                            {% endif %}
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        {% endif %}

{'fraction_non_alphanumeric': 0.15272381939048607, 'fraction_numerical': 0.001036001036001036, 'mean_word_length': 1.449048625792812, 'pattern_counts': {'":': 0, '<': 214, '<?xml version=': 0, '>': 214, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 46, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6988630', 'n_tokens_mistral': 3293, 'n_tokens_neox': 2956, 'n_words': 648}