<div class="modal-header">
    <h4>Upload case 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_upload_case_template">

          <div class="modal-content">
            <div class="modal-body">
                <div class="accordion accordion-primary">
                        <p>Case templates allow to prefill case objects such as tasks, tags, and notes.<br/>
                            It could be used to add procedures defining how to react against a specific kind of incident (phishing, ransomware, APT...)</p>
                        <div class="alert-std alert-warning" role="alert">
                             Case templates can be uploaded as JSON files, or they can be added and edited in the Add/Edit case template UI.<br/>
                        </div>
                        <label class="placeholder">JSON File format example</label>
                        <div class="card">
                            <div class="card-header collapsed" id="drop_up_case_template_taxonomy" data-toggle="collapse" data-target="#drop_up_tax_case_template" aria-expanded="false" aria-controls="drop_up_tax_attr" role="button">
                                <div class="span-icon">
                                    <div class="flaticon-pencil"></div>
                                </div>
                                <div class="span-title">
                                    Case Template taxonomy
                                </div>
                                <div class="span-mode"></div>
                            </div>

                            <div id="drop_up_tax_case_template" class="collapse" aria-labelledby="drop_up_tax_case_template" style="">
                                <div class="card-body">
                                    A case template is defined as below.
                                    <pre>

{
    "name": "ransomware_infection",
    "display_name": "Ransomware Infection Template",
    "description": "This case template describes first-response tasks to handle information system compromised by a ransomware.",
    "author": "DFIR-IRIS",
    "title_prefix": "RANS",
    "summary": "# Context \n\n\n # Contact \n\n\n # Actions \n\n\n",
    "tags": ["ransomware","malware"],
    "tasks": [
        {
            "title": "Identify the perimeter",
            "description": "The perimeter of compromise must be identified",
            "tags": ["identify"]
        },
        {
            "title": "Collect compromised hosts",
            "description": "Deploy Velociraptor and start collecting evidence",
            "tags": ["collect", "velociraptor"]
        },
        {
            "title": "Contain"
        }
    ],
    "note_directories": [
        {
            "title": "Identify",
            "notes": [
                {
                    "title": "Identify the compromised accounts",
                    "content": "# Observations\n\n"
                }
            ]
        },
        {
            "title": "Collect",
            "notes": [
                {
                    "title": "Velociraptor deployment"
                },
                {
                    "title": "Assets collected",
                    "content": "# Assets collected\n\n# Assets not collected"
                }
            ]
        }
    ]
}
                                </pre>

                                <h4>Field types</h4>
                                The supported fields types are:
                                <ul>
                                    <li>name: The name of the case template (required).</li>
                                    <li>display_name: The displayed name of the case template.</li>
                                    <li>description: The description of the case template.</li>
                                    <li>author: The author of the case template (not related to the current user).</li>
                                    <li>title_prefix: A prefix to add to case title.</li>
                                    <li>summary: content to prefill the summary.</li>
                                    <li>tags: A list of case tags.</li>
                                    <li>tasks: A list of dictionaries defining tasks. Tasks are defined by title (required), description, and list of tags.</li>
                                    <li>note_groups: A list of dictionaries defining note groups. Note groups are defined by title (required), and list of notes. Notes have title (required) and content</li>
                                </ul>
                            </div>
                        </div>
                     </div>
                </div>
                <div class="form-group">
                      <label class="placeholder">Choose JSON file to import : </label>
                      <input id="input_upload_case_template" type="file" accept="text/json">
                </div>
            </div>
            <div class='invalid-feedback' id='ctempl-invalid-msg'></div>
          </div><!-- /.modal-content -->
        </form>
    </div>
    <div class="alert alert-warning" style="display:none;" role="alert" id="alert_upload_case_template_details">
        <span id="alert_upload_case_template"></span><br/>
        <b>Logs:</b>
        <ul id="upload_case_template_err_details_list">
        </ul>
    </div>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-outline-success" onclick="upload_case_template();">Upload</button>
</div>

