<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <!-- Meta, title, CSS, favicons, etc. -->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
    	<title><%= pageTitle %></title>

        <!-- Bootstrap -->
        <link rel="stylesheet" href="assets/css/bootstrap.min.css">
        <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
        <script src="assets/js/html5shiv.min.js"></script>
        <script src="assets/js/respond.min.js"></script>
        <![endif]-->

        <link href="assets/css/font-awesome.min.css" rel="stylesheet">

        <!-- DataTables -->
        <link href="assets/css/dataTables.bootstrap.min.css" rel="stylesheet">
        <link href="assets/css/responsive.dataTables.min.css" rel="stylesheet">

        <!-- Custom Theme Style -->
        <style type="text/css">
            <%= styles %>
            <%= customStyle %>
        </style>
    </head>
    <body>

        <nav class="navbar">
            <div class="container-fluid">
                <p class="navbar-text"><%= reportName %></p>
            </div>
        </nav>

        <div class="main_conainer">

            <div class="row">
                <div class="col-md-6 col-lg-<% if (suite.customData) { %>4<% } else { %>6<% } %> col-xs-12">
                    <div class="x_panel fixed_height_320">
                        <%= featuresOverviewChart %>
                    </div>
                </div>

                <div class="col-md-6 col-lg-<% if (suite.customData) { %>4<% } else { %>6<% } %> col-xs-12">
                    <div class="x_panel fixed_height_320">
                        <%= featuresScenariosOverviewChart %>
                    </div>
                </div>

                <% if (suite.customData) { %>
                <div class="col-lg-<% if (suite.customData) { %>4<% } else { %>6<% } %> col-xs-12">
                    <div class="x_panel fixed_height_320">
                        <%= customDataOverview %>
                    </div>
                </div>
                <% } %>
            </div>

            <div class="row">
                <%= featuresOverview %>
            </div>
        </div>
         <% if (!pageFooter) { %>
            <div class="created-by">
                <p>Created by wswebcreation. Find me on:</p>
                <a href="http://www.wswebcreation.nl/" target="_blank"><i class="fa fa-rss-square fa-2x"></i></a>
                <a href="https://github.com/wswebcreation/" target="_blank"><i class="fa fa-github-square fa-2x"></i></a>
                <a href="http://nl.linkedin.com/in/wimselles" target="_blank"><i class="fa fa-linkedin-square fa-2x"></i></a>
                <a href="http://stackoverflow.com/users/5911978/wswebcreation" target="_blank"><i class="fa fa-stack-overflow fa-2x"></i></a>
            </div>
         <% } else { %>
                <%= pageFooter %>
         <% } %>

        <script src="assets/js/jquery-3.2.1.min.js" ></script>
        <script src="assets/js/bootstrap.min.js"></script>

        <!-- DataTables -->
        <script src="assets/js/jquery.dataTables.min.js"></script>
        <script src="assets/js/dataTables.bootstrap.min.js"></script>
        <script src="assets/js/dataTables.responsive.min.js"></script>

        <!-- Chart.js -->
        <script src="assets/js/Chart.min.js"></script>

        <!-- Custom -->
        <script>
            $(document).ready(function () {
                $('#features-table').dataTable({
                    "order": [[0, "asc"]],
                    "lengthMenu": [[50, 100, 150, -1], [50, 100, 150, "All"]],
                    "stateSave": true
                });

                var featureOptions = {
                    legend: false,
                    responsive: false
                };

                new Chart(document.getElementById("feature-chart"), {
                    type: 'doughnut',
                    tooltipFillColor: "rgba(51, 51, 51, 0.55)",
                    data: {
                        labels: [
                            "Passed",
                            "Failed",
                            "Ambiguous",
                            "Not Defined",
                            "Pending",
                            "Skipped"
                        ],
                        datasets: [{
                            data: [
                                <%= suite.featureCount.passed %>,
                                <%= suite.featureCount.failed %>,
                                <%= suite.featureCount.ambiguous %>,
                                <%= suite.featureCount.notDefined %>,
                                <%= suite.featureCount.pending %>,
                                <%= suite.featureCount.skipped %>
                            ],
                            backgroundColor: [
                                "#26B99A",
                                "#E74C3C",
                                "#b73122",
                                "#F39C12",
                                "#FFD119",
                                "#3498DB"
                            ]
                        }]
                    },
                    options: featureOptions
                });

                var scenarioOptions = {
                    legend: false,
                    responsive: false
                };

                new Chart(document.getElementById("scenario-chart"), {
                    type: 'doughnut',
                    tooltipFillColor: "rgba(51, 51, 51, 0.55)",
                    data: {
                        labels: [
                            "Passed",
                            "Failed",
                            "Ambiguous",
                            "Not Defined",
                            "Pending",
                            "Skipped"
                        ],
                        datasets: [{
                            data: [
                                <%= suite.scenarios.passed %>,
                                <%= suite.scenarios.failed %>,
                                <%= suite.scenarios.ambiguous %>,
                                <%= suite.scenarios.notDefined %>,
                                <%= suite.scenarios.pending %>,
                                <%= suite.scenarios.skipped %>
                            ],
                            backgroundColor: [
                                "#26B99A",
                                "#E74C3C",
                                "#b73122",
                                "#F39C12",
                                "#FFD119",
                                "#3498DB"
                            ]
                        }]
                    },
                    options: scenarioOptions
                });

                <%= genericScript %>
            });
        </script>
    </body>
</html>
