<div class="modal-header">
    <h4>Add Report Template</h4>
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
            aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">

        <div class="container col-md-12">
        <form method="post" action="" id="form_new_report_template" enctype="multipart/form-data">
            <div class="col-md-12 col-lg-12 col-sm-12">
                {{ form.hidden_tag() }}
                <div class="form-group mt-3">
                    <label for="report_name" class="placeholder">Template name</label>
                    {{ form.report_name(class='form-control',  autocomplete="off") }}
                </div>
                <div class="form-group">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                            <label for="report_type" class="mr-4">Template type
                            </label>
                            {{ form.report_type(class='form-control',  autocomplete="off") }}
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                            <label for="report_language" class="mr-4">Template language
                            </label>
                            {{ form.report_language(class="selectpicker pl--6 col-md-12") }}
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group mt-3">
                    <label for="report_description" class="placeholder">Template description</label>
                    {{ form.report_description(class='form-control',  autocomplete="off") }}
                </div>
                <div class="form-group ml--2">
                    {{ form.report_language(class="selectpicker pl--6") }}
                </div>
                <div class="form-group mt-3">
                    <label for="report_name_format" class="placeholder">Template name format</label>
                    <br/>This is the name of the generated report file. Do not input extension.
                    Available tags:
                    <ul>
                        <li>%date% : date of generation</li>
                        <li>%customer% : customer name</li>
                        <li>%case_name% : name of the case</li>
                        <li>%code_name%: autogenerated enterprise code name</li>
                    </ul>
                    Example: <i>analysis_%customer%_%date%</i>

                    {{ form.report_name_format(class='form-control',  autocomplete="off") }}
                </div>
                <div class="form-group mt-3">
                    <label for="report_name_format" class="placeholder">Template file : </label>
                        <input type=file name=file>
                </div>

            {% if report_template.asset_id %}
                <button type="button" class="btn btn-outline-danger mt-5"
                onclick="delete_report_template('{{ assettype.asset_id }}');">Delete</button>
                <button type="button" class="btn btn-outline-success ml-4 mt-5 float-right"
                id="submit_new_report_template">Update</button>

            {% else %}

                <button type="submit" class="btn btn-outline-success ml-4 mt-5 float-right"
                id="submit_new_report_template">Save</button>

            {% endif %}
        </form>
    </div>

</div>
