{{/*
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/>.
*/}}

{{define "tab-content"}}
<div class="modal fade" id="deleteModal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title"><i class="fa fa-trash"></i> Delete Project</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span>&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <p>Do you really want to delete the project? This is irreversible!</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" id="buttonDeleteConfirmed">Delete</button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
{{template "modal-wrong-file" .}}
<div class="tab-card card">
    <div class="navbar navbar-light action-bar p-3">
        <button type="button" class="btn btn-success ml-2" id="SaveChangesProjectSettingsButton" data-toggle="modal">
            <i class="fa fa-floppy-o" aria-hidden="true"></i>
            <span class="d-none d-sm-inline"> Save </span>
        </button>
    </div>
    <div class="row tab-side-bar-row">
        <div class="col-md-3 p-3">
            <ul class=" list-group">
                <a href="" class="list-group-item list-group-item-action active" aria-hidden="false">Project
                    settings</a>
                <a class="list-group-item list-group-item disabled cursor-not-clickable" data-toggle="tooltip"
                   data-placement="bottom" title=""
                   data-original-title="This feature will be available in a future version"
                   aria-hidden="false">Permission settings</a>
            </ul>
        </div>
        <div class="col-md-9 p-3 tab-side-bar">
            <div class="row tab-side-bar-row">
                <div class="col-md-4">
                    <div class="d-none d-sm-block">
                        <div class="d-flex project-small-thumbnail">
                            <img id="inputProjectImage" alt="project image"
                                    src="/{{ .Project.Image }}">
                        </div>
                    </div>
                </div>
                <div class="col-md-3 tab-side-bar d-flex">
                    <label class="btn btn-secondary btn-file mt-auto">Upload file
                        <input style="display: none;" class="" type="file" accept=".png,.jpg">
                    </label>
                </div>
            </div>
            <div class="row-md-8 p-2 tab-side-bar-row">
                <div class="form-group p-3">
                    <label for="inputProjectName"><strong>Project name</strong></label>
                    <div data-toggle="tooltip"
                         title="" data-placement="top"
                         data-original-title="This feature will be available in a future version">
                        <input disabled class="form-control" id="inputProjectName"
                               value="{{ .Project.Name }}"/>
                    </div>
                </div>
                <div class="form-group p-3">
                    <label for="inputProjectDesc"><strong>Project description</strong></label>
                    <input class="form-control" id="inputProjectDescription" placeholder=""
                           value="{{ .Project.Description }}"/>
                </div>
                <label>Visibility</label>
                <div class="form-check">
                    <label class="form-check-label">
                        <input type="radio" class="form-check-input" name="optionsProjectVisibility"
                               id="optionPublic"
                               value="public"
                        {{ if eq .Project.Visibility 1 }}
                               checked
                        {{ end }}
                        >
                        <b>public</b> &mdash; public projects are visible to everyone
                    </label>
                </div>
                <div class="form-check">
                    <label class="form-check-label">
                        <input type="radio" class="form-check-input" name="optionsProjectVisibility"
                               id="optionInternal"
                               value="internal"
                        {{ if eq .Project.Visibility 2 }}
                               checked
                        {{ end }}
                        >
                        <b>internal</b> &mdash; internal projects are visible to all signed in users
                    </label>
                </div>
                <div class="form-check">
                    <label class="form-check-label">
                        <input type="radio" class="form-check-input" name="optionsProjectVisibility"
                               id="optionPrivate"
                               value="private"
                        {{ if eq .Project.Visibility 3 }}
                               checked
                        {{ end }}
                        >
                        <b>private</b> &mdash; private projects are only visible to members of these projects
                    </label>
                </div>
                <button type="button" class="btn btn-danger" id="ProjectDeleteButton" data-toggle="modal"
                        data-target="#deleteModal">
                    <i class="fa fa-trash-o" aria-hidden="true"></i>
                    <span class="d-none d-sm-inline">Delete project</span>
                </button>
            </div>
        </div>
    </div>
    <script src="/static/js/project/project-settings.js"></script>
    <script>
        //Initializes Buttons
        initializeSettingsClickListener();

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

        $(function () {
            $('[data-toggle="tooltip"]').tooltip()
        })
    </script>
</div>
{{end}}