<!DOCTYPE html>
<html lang="en">
{% load staticfiles %}

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>SB Admin 2 - Dashboard</title>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
    <!-- Custom fonts for this template-->
    <link href="{% static 'vendor/fontawesome-free/css/all.min.css' %}" rel="stylesheet" type="text/css">
    <link
        href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
        rel="stylesheet">

    <!-- Custom styles for this template-->
    <link href="{% static 'css/sb-admin-2.min.css' %}" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
    <link href="/static/vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">
    <link rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/css/bootstrap-select.min.css">
    {% block staticcss %}

    {% endblock %}
</head>

<body id="page-top">
    <!-- Page Wrapper -->
    <div id="wrapper">

        <!-- Sidebar -->
        <ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">

            <!-- Sidebar - Brand -->
            <a class="sidebar-brand d-flex align-items-center justify-content-center" href="index.html">
                <div class="sidebar-brand-icon rotate-n-15">
                    <i class="fas fa-laugh-wink"></i>
                </div>
                <div class="sidebar-brand-text mx-3">微光任务管理</div>
            </a>

            <!-- Divider -->
            <hr class="sidebar-divider my-0">

            <!-- Nav Item - 首页 -->
            <li class="nav-item {% if page1 %} {{ page1 }} {% endif %}">
                <a class="nav-link" href="/">
                    <i class="fas fa-fw fa-tachometer-alt"></i>
                    <span>首页</span></a>
            </li>

            <!-- Divider -->
            <hr class="sidebar-divider">

            <!-- Heading -->
            <div class="sidebar-heading">
                任务相关
            </div>

            <!-- Nav Item - 任务相关 -->
            <li class="nav-item {% if page2 %} {{ page2 }} {% endif %}">
                <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapse_1"
                    aria-expanded="true" aria-controls="collapse_1">
                    <i class="fas fa-fw fa-cog"></i>
                    <span>我的待办</span>
                    <span class="badge badge-danger">{{ unall }}</span>
                </a>
                <div id="collapse_1" class="collapse {% if page2_s %} {{ page2_s }} {% endif %}"
                    aria-labelledby="headingTwo" data-parent="#accordionSidebar">
                    <div class="bg-white py-2 collapse-inner rounded">
                        <a class="collapse-item {% if page2_1 %} {{ page2_1 }} {% endif %}"
                            href="{% url 'baseitemlist' 'list'%}">计次任务<span
                                class="badge badge-danger">{{ uncount }}</span></a>
                        <a class="collapse-item {% if page2_2 %} {{ page2_2 }} {% endif %}"
                            href="{% url 'mytodo' 'list' %}">计时任务<span
                                class="badge badge-danger">{{ unclock }}</span></a>
                        <a class="collapse-item {% if page2_2 %} {{ page2_2 }} {% endif %}"
                            href="{% url 'projectlist' 'list' %}">项目任务<span
                                class="badge badge-danger">{{ unpro }}</span></a>
                    </div>
                </div>
            </li>
            <!-- Divider -->
            <hr class="sidebar-divider">

            <!-- Heading -->
            <div class="sidebar-heading">
                任务看表
            </div>

            <!-- Nav Item - 任务看表 -->
            <li class="nav-item {% if page_3 %} {{ page_3 }} {% endif %}">
                <a class="nav-link " href="{% url 'mygroup'%}">
                    <i class="fas fa-fw fa-cog"></i>
                    <span>本周任务</span>
                </a>

            </li>
            <li class="nav-item {% if page_4 %} {{ page_4 }} {% endif %}">
                <a class="nav-link " href="{% url 'taskstatistics'%}">
                    <i class="fas fa-fw fa-cog"></i>
                    <span>任务统计</span>
                </a>

            </li>
            <li class="nav-item {% if page_5 %} {{ page_5 }} {% endif %}">
                <a class="nav-link " href="{% url 'searchlist'%}">
                    <i class="fas fa-fw fa-cog"></i>
                    <span>任务搜索</span>
                </a>

            </li>
            <li class="nav-item {% if page6 %} {{ page6 }} {% endif %}">
                <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapse_2"
                    aria-expanded="true" aria-controls="collapse_2">
                    <i class="fas fa-fw fa-cog"></i>
                    <span>批量任务</span>

                </a>
                <div id="collapse_2" class="collapse {% if page6_s %} {{ page6_s }} {% endif %}"
                    aria-labelledby="headingTwo" data-parent="#accordionSidebar">
                    <div class="bg-white py-2 collapse-inner rounded">
                        <a class="collapse-item {% if page6_1 %} {{ page6_1 }} {% endif %}"
                            href="{% url 'multiaddtaskcount'%}">计次任务</a>
                        <a class="collapse-item {% if page6_2 %} {{ page6_2 }} {% endif %}"
                            href="{% url 'multiaddtask' %}">计时任务</a>

                    </div>
                </div>
            </li>
            <!-- Divider -->
            <hr class="sidebar-divider">

            <!-- Heading -->
            <div class="sidebar-heading">
                高级管理
            </div>
            <li class="nav-item {% if page_7 %} {{ page_7 }} {% endif %}">
                <a class="nav-link " href="{% url 'trashlist'%}">
                    <i class="fas fa-fw fa-cog"></i>
                    <span>回收站</span>
                </a>

            </li>
            <!-- Sidebar Toggler (Sidebar) -->
            <div class="text-center d-none d-md-inline">
                <button class="rounded-circle border-0" id="sidebarToggle"></button>
            </div>

        </ul>

        <!-- End of Sidebar -->

        <!-- Content Wrapper -->
        <div id="content-wrapper" class="d-flex flex-column">

            <!-- Main Content -->
            <div id="content">

                <!-- Topbar -->
                <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">

                    <!-- Sidebar Toggle (Topbar) -->
                    <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
                        <i class="fa fa-bars"></i>
                    </button>



                    <!-- Topbar Navbar -->
                    <ul class="navbar-nav ml-auto">



                        <!-- Nav Item - User Information -->
                        <li class="nav-item dropdown no-arrow">
                            <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button"
                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <span
                                    class="mr-2 d-none d-lg-inline text-gray-600 small">{{request.user.username}}</span>
                                <img class="img-profile rounded-circle"
                                    src="https://source.unsplash.com/QAB-WJcbgJk/60x60">
                            </a>
                            <!-- Dropdown - User Information -->
                            <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
                                aria-labelledby="userDropdown">
                                <a class="dropdown-item" href="#">
                                    <i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Profile
                                </a>
                                <a class="dropdown-item" href="#">
                                    <i class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Settings
                                </a>
                                <a class="dropdown-item" href="#">
                                    <i class="fas fa-list fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Activity Log
                                </a>
                                <div class="dropdown-divider"></div>
                                <a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">
                                    <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Logout
                                </a>
                            </div>
                        </li>

                    </ul>

                </nav>
                <!-- End of Topbar -->

                <!-- Begin Page Content -->
                <div class="container-fluid">
                    {% block content %}{% endblock %}
                </div>
                <!-- /.container-fluid -->

            </div>
            <!-- End of Main Content -->

            <!-- Footer -->
            <footer class="sticky-footer bg-white">
                <div class="container my-auto">
                    <div class="copyright text-center my-auto">
                        <span>Copyright &copy; Your Website 2019</span>
                    </div>
                </div>
            </footer>
            <!-- End of Footer -->

        </div>
        <!-- End of Content Wrapper -->

    </div>
    <!-- End of Page Wrapper -->

    <!-- Scroll to Top Button-->
    <a class="scroll-to-top rounded" href="#page-top">
        <i class="fas fa-angle-up"></i>
    </a>

    <!-- Logout Modal-->
    <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
                <div class="modal-footer">
                    <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
                    <a class="btn btn-primary" href="./logout">Logout</a>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
        aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    请确认下面操作
                </div>
                <div class="modal-body">
                    确认删除该记录吗？
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <a class="btn btn-danger btn-ok" id="delete">删除记录</a>
                </div>
            </div>
        </div>
    </div>

    <!-- Bootstrap core JavaScript-->
    {% block staticjs %}

    {% endblock %}
    <!-- <script src="/static/vendor/jquery/jquery.min.js"></script> -->
    <script src="/static/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

    <!-- Core plugin JavaScript-->
    <!-- <script src="/static/vendor/jquery-easing/jquery.easing.min.js"></script> -->

    <!-- Custom scripts for all pages-->
    <script src="/static/js/sb-admin-2.min.js"></script>

    <!-- Page level plugins -->
    <script src="/static/vendor/chart.js/Chart.min.js"></script>

    <script src="/static/vendor/datatables/jquery.dataTables.min.js"></script>
    <script src="/static/vendor/datatables/dataTables.bootstrap4.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/bootstrap-select.min.js"></script>
    <script type="text/javascript">
        $('#confirm-delete').on('show.bs.modal', function (e) {
            $(this).find('.btn-ok').attr('href', $(e.relatedTarget).data('href'));
        });

        $('button[name="mark"]').on('click', function (e) {
            var $form = $(this).closest('form');
            e.preventDefault();

            $('#confirm-delete').modal({
                    backdrop: 'static',
                    keyboard: false
                })
                .one('click', '#delete', function () {
                    $form.trigger('submit'); // submit the form
                });
            // .one() is NOT a typo of .on()
        });
    </script>
    <script>
        $(function () {
            $('input[name="due_date"]').daterangepicker({
                singleDatePicker: true,
                showDropdowns: true,
                minYear: 1901,
                locale: {
                    format: 'YYYY/MM/DD'
                }
            });
        });
        $(function () {
            $('select').selectpicker();
        });

        function dosubmit() {
            //获取表单提交按钮
            var btnSubmit = document.getElementById("submit");
            //将表单提交按钮设置为不可用，这样就可以避免用户再次点击提交按钮
            btnSubmit.disabled = "disabled";
            //返回true让表单可以正常提交
            return true;
        }
    </script>
    <script type="text/javascript">
        var isCommitted = false; //表单是否已经提交标识，默认为false
        function dosubmit() {
            if (isCommitted == false) {
                isCommitted = true; //提交表单后，将表单是否已经提交标识设置为true
                return true; //返回true让表单正常提交
            } else {
                return false; //返回false那么表单将不提交
            }
        }
    </script>

</body>

</html>