<div class="modal-header">
    <div class="col md-12">
        <div class="row">
            <div class="col align-self-center">
                <h4 class="modal-title mr-4">{% if rfile.id %}Edit evidence #{{rfile.id}}{% else %}Register evidence{% endif %}</h4>
                {% if rfile.id %}<small><i class="text-muted">#{{ rfile.file_uuid }}</i></small>{% endif %}
            </div>
            {% include 'modals/modal_attributes_nav.html' %}
            <div class="col">
                <div class="row float-right">
                    {% if rfile.id %}
                     <div class="dropdown">
                          <button class="btn bg-transparent pull-right" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                              <span aria-hidden="true"><i class="fas fa-ellipsis-v"></i></span>
                          </button>
                          <div class="dropdown-menu pull-right" id="evidence_modal_quick_actions" aria-labelledby="dropdownMenuButton">
                              <a class="dropdown-item" href="#" onclick='copy_object_link({{rfile.id}});return false;'><i class="fa fa-share mr-2"></i>Share</a>
                              <a class="dropdown-item" href="#" onclick='copy_object_link_md("evidence", {{rfile.id}});return false;'><i class="fa-brands fa-markdown mr-2"></i>Markdown Link</a>
                          </div>
                     </div>
                    <button type="button" class="btn bg-transparent btn-xs" onclick="comment_element({{ rfile.id }}, 'evidences')" title="Comments">
                        <span class="btn-label">
                            <i class="fa-solid fa-comments"></i><span class="notification" id="object_comments_number">{{ comments_map|length }}</span>
                        </span>
                    </button>
                    {% endif %}
                        <button class="float-right btn bg-transparent" title="Minimize" onclick="modal_minimized('modal_add_rfiles', 'Edit evidence #{{rfile.id}}');"> <i class='fa fa-minus'></i> </button>
                        <button type="button" class="pull-right btn bg-transparent" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true"><i class="fa fa-times"></i></span></button>
                    </div>
            </div>
        </div>
    </div>
</div>
<div class="modal-body">
    <div role="tabpanel">
          <div class="tab-content">
                <div class="tab-pane active" id="details">
                    <div class="container col-md-12">
                        <form method="post" action="" id="form_edit_rfile">
                            <div class="col-md-12 col-lg-12 col-sm-12">
                                <div class="form-group">
                                    <label for="rfile_filename" class="placeholder">Filename *</label>
                                    <input class="form-control" placeholder="Filename" id="filename" required name="filename" value="{{ rfile.filename }}"/>
                                </div>
                                <div class="form-group">
                                    <label for="rfile_size" class="placeholder">File size (bytes) *</label>
                                    <input class="form-control" placeholder="Size in bytes" id="file_size" name="file_size" value="{{ rfile.file_size }}"/>
                                </div>
                                <div class="form-group">
                                    <label for="rfile_hash" class="placeholder">File Hash</label>
                                    <input class="form-control" placeholder="Hash" id="file_hash" name="file_hash" value="{{ rfile.file_hash }}"/>
                                </div>
                                <div class="form-group">
                                    <label for="rfile_desc" class="placeholder">File description</label>
                                     <div class="md_description_field">
                                        <div class="form-group mt--2">
                                            <button type="button" class="float-right icon-note btn btn-circle btn-sm mt-2" onclick="edit_in_evidence_desc();" >
                                            </button>
                                            <button type="button" style="display: none;" class="btn btn-dark btn-sm float-right mr-2 mt-2"
                                                    onclick="preview_evidence_description();" id="evidence_preview_button"><i class="fa-solid fa-eye"></i></button>
                                        </div>
                                        <div class="row">
                                            <div class="col mb--2 ml--2" id="evidence_edition_btn" style="display:none;">
                                            </div>
                                        </div>
                                        <div class="row" style="margin-left:0px;">
                                            <div class="col-12" id="container_evidence_desc_content">
                                                <div id="evidence_description" class="mr-2" data-theme="{% if current_user.in_dark_mode %}dark{% else %}light{% endif %}">{% if rfile %}{{ rfile.file_description  }}{% endif %}</div>
                                                <textarea id="evidence_desc_content" rows="10" cols="82" style="display: none"></textarea>
                                            </div>
                                            <div class="col-12" id="container_evidence_description" style="display:none">
                                                <div id="target_evidence_desc"></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <p>Automatically compute file information by selecting it below. The file will not be uploaded nor saved.</p>
                                    <input id="input_autofill" type="file">
                                    <button class="btn btn-sm" type="button" onclick="get_hash()" id="btn_rfile_proc">Process</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
              {% include 'modals/modal_attributes_tabs.html' %}
          </div>
        {% if rfile.id %}
         <button type="button" class="btn btn-outline-danger mt-5"
                onclick="delete_rfile('{{ rfile.id }}');">Delete</button>
                <button type="button" class="btn btn-outline-success ml-4 mt-5 float-right"
                onclick="update_rfile('{{ rfile.id }}');" id="submit_new_rfiles">Update</button>
        {% else %}
            <button type="button" class="btn btn-outline-success float-right" onclick="add_rfile();">Register</button>
        {% endif %}
    </div>
</div>