<commit_before>{% extends "app_manager/v1/apps_base.html" %}
{% load i18n %}
{% load hq_shared_tags %}

{% block js-inline %}{{ block.super }}
    <script src="{% static 'hqwebapp/js/lib/compression.js' %}"></script>
    <script>
        $(function () {
            $(".historyBack").click(function () {
                history.back();
                return false;
            });
        });

        function CompressionViewModel(source, post_url){
            var self = this;
            self.name = ko.observable("");
            self.source = ko.observable(source);
            self.save = function(formElement) {
                $.postGo(post_url,
                         {name : self.name(),
                          compressed: LZW.compress(self.source())}
                        );
                return false;
            };
        }
        var source = {{ app.export_json|JSON }};
        var post_url = "{% url "corehq.apps.app_manager.views.import_app" domain %}";
        $('#app-import-form').koApplyBindings(new CompressionViewModel(source, post_url));
    </script>
{% endblock %}

{% block breadcrumbs %}
    <li>{% trans 'Import Application' %}</li>
{% endblock %}

{% block page_content %}
    <form action="{% url "corehq.apps.app_manager.views.import_app" domain %}" id="app-import-form" method="post" data-bind="submit: save">
        {% csrf_token %}
{% if app %}
        <p>Import application <strong>{{ app.name }}</strong> from domain <strong>{{ app.domain }}</strong>?</p>
{% else %}
        <div class="form-horizontal{% if not is_superuser %} hide{% endif %}">
{% endif %}
            <div class="form-group">
                <label class="col-sm-2 control-label">Name</label>
                <div class="col-sm-10">
                    <input class="form-control" type="text" name="name" data-bind="value: name"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">Source</label><commit_msg>import_app<commit_after>{% extends "app_manager/v1/apps_base.html" %}
{% load i18n %}
{% load hq_shared_tags %}

{% block js-inline %}{{ block.super }}
    <script src="{% static 'hqwebapp/js/lib/compression.js' %}"></script>
    <script>
        $(function () {
            $(".historyBack").click(function () {
                history.back();
                return false;
            });
        });

        function CompressionViewModel(source, post_url){
            var self = this;
            self.name = ko.observable("");
            self.source = ko.observable(source);
            self.save = function(formElement) {
                $.postGo(post_url,
                         {name : self.name(),
                          compressed: LZW.compress(self.source())}
                        );
                return false;
            };
        }
        var source = {{ app.export_json|JSON }};
        var post_url = "{% url "import_app" domain %}";
        $('#app-import-form').koApplyBindings(new CompressionViewModel(source, post_url));
    </script>
{% endblock %}

{% block breadcrumbs %}
    <li>{% trans 'Import Application' %}</li>
{% endblock %}

{% block page_content %}
    <form action="{% url "import_app" domain %}" id="app-import-form" method="post" data-bind="submit: save">
        {% csrf_token %}
{% if app %}
        <p>Import application <strong>{{ app.name }}</strong> from domain <strong>{{ app.domain }}</strong>?</p>
{% else %}
        <div class="form-horizontal{% if not is_superuser %} hide{% endif %}">
{% endif %}
            <div class="form-group">
                <label class="col-sm-2 control-label">Name</label>
                <div class="col-sm-10">
                    <input class="form-control" type="text" name="name" data-bind="value: name"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">Source</label>
{'fraction_non_alphanumeric': 0.17066397374400405, 'fraction_numerical': 0.0035344609946983086, 'mean_word_length': 1.9722430607651913, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, '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': '2014278', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1135, 'n_words': 227}