{{/*
This file is part of SystemTestPortal.
Copyright (C) 2017  Institute of Software Technology, University of Stuttgart

SystemTestPortal is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

SystemTestPortal is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with SystemTestPortal.  If not, see <http://www.gnu.org/licenses/>.
*/}}

<!-- Translated to German -->
{{define "tab-content"}}
<div class="modal fade" id="helpModal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">{{T "Protocol List" .}}</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span>&times;</span>
                </button>
            </div>
            <div class="modal-body">

                {{T "Click on a row to display the protcol." .}}
                {{T "Protocols can be filtered by" .}}

                <table class="help-table">
                    <tr>
                        <td><strong>{{T "Type" .}}</strong></td>
                        <td>{{T "Select test cases or test sequences." .}}</td>
                    </tr>
                    <tr>
                        <td><strong>{{T "Result" .}}</strong></td>
                        <td>{{T "Hide and display protocols with the individual result." .}}</td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top;"><strong>{{T "Specific" .}}</strong></td>
                        <td>{{T "Choose test cases or test sequences to display the according protocols." .}}</td>
                    </tr>
                </table>

                <span class="mt-3 float-left">For more information visit our <a href="http://docs.systemtestportal.org" target="_blank">documentation</a>.</span>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">{{T "Close" .}}</button>
            </div>
        </div>
    </div>
</div>
<div class="tab-card card" id="tabTestProtocols">
    <div class="row tab-side-bar-row">
        <div class="col-md-9 p-3 table-responsive">
            <h4 class="mb-3">Protocols</h4>

            <table id="DataTable" class="table table-hover">
                <thead>
                <tr >
                    <th style="border-top: none;">{{T "Result" .}}</th>
                    <th style="border-top: none;">{{T "Test" .}}</th>
                    <th style="border-top: none;">{{T "Version" .}}</th>
                    <th style="border-top: none;">{{T "Variant" .}}</th>
                    <th style="border-top: none;">{{T "Tester" .}}</th>
                    <th style="border-top: none;">{{T "Date" .}}</th>
                </tr>
                </thead>
                <tbody>
                </tbody>
            </table>

        </div>
        <div class="col-md-3 p-3 tab-side-bar d-print-none">
            <div class="form-row">
                <div class="col-12">
                    <h4>
                        {{T "Filters" .}}
                    </h4>
                </div>

                <div class="col-12 mb-3">
                    {{ $selectedType := .SelectedType }}

                    <div class="mr-2 form-check-inline">
                        <label class="form-check-label">
                            <input class="form-check-input" type="radio" name="protocolType" id="testCases" value="testcases"
                                   onclick="ProtocolDataTable.onUserDropDownSelectedTestCase(document.getElementById('inputSelectTestCase').value);" {{ if eq "testcases" $selectedType }} checked {{ end }}> {{T "Test Cases" .}}
                        </label>
                    </div>
                    <div class="mr-2 form-check-inline">
                        <label class="form-check-label">
                            <input class="form-check-input" type="radio" name="protocolType" id="testsequences"
                                   value="testsequences" onclick="ProtocolDataTable.onUserDropDownSelectedTestSequences(document.getElementById('inputSelectTestSequence').value);" {{ if eq "testsequences" $selectedType }}
                                   checked {{ end }}> {{T "Test Sequences" .}}
                        </label>
                    </div>
                </div>

                <div class="col-12 mb-3">
                    <div class="form-check">
                        <label class="form-check-label text-success">
                            <input id="filterSuccessfulTest" name="filterTestResults"
                                   class="form-check-input" type="checkbox"
                                   value="Pass" onchange="ProtocolDataTable.onUserUpdatedFilter();" checked/>
                            {{T "Passed" .}}
                        </label>
                    </div>
                    <div class="form-check">
                        <label class="form-check-label text-warning">
                            <input id="filterPartiallySuccessfulTest" name="filterTestResults"
                                   class="form-check-input" type="checkbox"
                                   value="PartiallySuccessful" onchange="ProtocolDataTable.onUserUpdatedFilter();" checked/>
                            {{T "Partially Successful" .}}
                        </label>
                    </div>
                    <div class="form-check">
                        <label class="form-check-label text-danger">
                            <input id="filterFailedTest" name="filterTestResults"
                                   class="form-check-input" type="checkbox"
                                   value="Fail" onchange="ProtocolDataTable.onUserUpdatedFilter();" checked/>
                            {{T "Failed" .}}
                        </label>
                    </div>
                    <div class="form-check">
                        <label class="form-check-label text-muted">
                            <input id="filterNotAssessedTest" name="filterTestResults"
                                   class="form-check-input" type="checkbox"
                                   value="NotAssessed" onchange="ProtocolDataTable.onUserUpdatedFilter();" checked/>
                            {{T "Not assessed" .}}
                        </label>
                    </div>
                </div>

                <div class="col-12 mb-3">
                    <select class="mr-2 custom-select rounded" id="inputSelectTestCase" onChange="ProtocolDataTable.onUserDropDownSelectedTestCase(this.value);">
                        <option class="dropdown-item" value="none" selected>All Test Case Protocols</option>
                    {{ $selected := .SelectedTestCase }}
                    {{ range .TestCases }}
                        <option class="dropdown-item" value="{{ .Name }}" {{ if eq .Name $selected }}
                                selected {{ end }}>{{ .Name }}</option>
                    {{ end }}
                    </select>
                    <select class="mr-2 d-none custom-select rounded" id="inputSelectTestSequence" onChange="ProtocolDataTable.onUserDropDownSelectedTestSequences(this.value);">
                        <option class="dropdown-item" value="none" selected>All Test Sequence Protocols</option>
                    {{ $selected := .SelectedTestSequence }}
                    {{ range .TestSequences }}
                        <option class="dropdown-item" value="{{ .Name }}" {{ if eq .Name $selected }}
                                selected {{ end }}>{{ .Name }}</option>
                    {{ end }}
                    </select>
                </div>

            </div>

            {{/*<div class="form-row" data-toggle="tooltip" data-placement="bottom" title=""*/}}
                 {{/*data-original-title="This feature will be available in a future version">*/}}
                {{/*<div class="col-12">*/}}
                    {{/*<strong>{{T "System Version" .}}</strong>*/}}
                {{/*</div>*/}}
                {{/*<div class="col-12">*/}}
                    {{/*<select class="mt-2 custom-select" id="inputSelectTestVersion" onChange="updateFilter();">*/}}
                        {{/*<option class="dropdown-item" value="all">{{T "All" .}}</option>*/}}
                        {{/*<!--TODO: Add Versions-->*/}}
                    {{/*</select>*/}}
                {{/*</div>*/}}
            {{/*</div>*/}}
            {{/*<div class="form-row" data-toggle="tooltip" data-placement="bottom" title=""*/}}
                 {{/*data-original-title="This feature will be available in a future version">*/}}
                {{/*<div class="col-12">*/}}
                    {{/*<strong>{{T "System Variant" .}}</strong>*/}}
                {{/*</div>*/}}
                {{/*<div class="col-12">*/}}
                    {{/*<select class="mt-2 custom-select" id="inputSelectTestVariant" onChange="updateFilter();">*/}}
                        {{/*<option class="dropdown-item" value="all">{{T "All" .}}</option>*/}}
                        {{/*<!--TODO: Add Variants-->*/}}
                    {{/*</select>*/}}
                {{/*</div>*/}}
            {{/*</div>*/}}

        </div>
    </div>
</div>

<!-- Import Scripts here -->
<script src="/static/js/project/testprotocols.js"></script>
<script src="/static/js/project/project-tabs.js"></script>

<script>

    $("#printerIcon").addClass("d-none");
    $("#helpIcon").removeClass("d-none");

</script>
{{end}}


