{% extends "layouts/default.html" %}

{% block title %} Activities {% endblock title %}

{% block stylesheets %}
<link href="/static/assets/css/dataTables.buttons.min.css" rel="stylesheet">
{% endblock stylesheets %}

{% block content %}

{% if current_user.is_authenticated %}
<div class="page-inner">
    <div class="row">
        <div class="col-md-12">
            <div class="loader1 text-center ml-mr-auto" id="loading_msg">Loading...</div>
            <div class="card" id="card_main_load" style="display:none;">
                <div class="card-header">
                    <div class="card-title">User activities ( max 10k entries + unbound )
                        <button type="button" class="btn btn-sm btn-outline-dark float-right ml-2" onclick="refresh_activities();">
                                Refresh
                        </button>
                    </div>
                </div>
                <div class="card-body">
                   <div class="form-check">
                            <label class="form-check-label">
                                <input class="form-check-input" type="checkbox" value="" id="non_case_related_act">
                                <span class="form-check-sign">Show non case related activity</span>
                            </label>
                    </div>
                    <div class="table-responsive" id="activities_table_wrapper">
                        <div class="selectgroup">
                            <span id="table_buttons"></span>
                        </div>
                      <table class="table display table-striped table-hover" width="100%" cellspacing="0" id="activities_table" >
                        <thead>
                          <tr>
                            <th>Date</th>
                            <th>User</th>
                            <th>Case</th>
                            <th>Manual input</th>
                            <th>From API</th>
                            <th>Activity</th>
                          </tr>
                        </thead>
                        <tfoot>
                          <tr>
                            <th>Date</th>
                            <th>User</th>
                            <th>Case</th>
                            <th>Manual input</th>
                            <th>From API</th>
                            <th>Activity</th>
                          </tr>
                        </tfoot>
                      </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{{ form.hidden_tag() }}
{% endif %}

{% endblock content %}

{% block javascripts %}
    <script src="/static/assets/js/plugin/datatables/dataTables.cellEdit.js"></script>
    <script src="/static/assets/js/plugin/datatables/dataTables.buttons.min.js"></script>
    <script src="/static/assets/js/plugin/datatables/buttons.html5.min.js"></script>
    <script src="/static/assets/js/plugin/datatables/buttons.print.min.js"></script>

    <script src="/static/assets/js/iris/datatablesUtils.js"></script>
    <script src="/static/assets/js/iris/activities.js"></script>
{% endblock javascripts %}