<!DOCTYPE html>
<html lang="ru-RU">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta content="ie=edge" http-equiv="X-UA-Compatible">
    <title>Jarvis</title>
    <link href="{{ url_for('static', filename = './css/main.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='./img/favicon.ico') }}" rel="icon" type="image/x-icon">
    <script src="{{ url_for('static', filename = './js/main.js') }}"></script>
</head>

<body>
<div class="wrapper">
    <!-- header-- -->
    <header class="header">
        <div class="container clearfix">
            <div class="header_left clearfix">
                <a class="logo-decor" href="/">
                    <img alt=""
                         class="logo_icon"
                         src="{{ url_for('static', filename='./img/815a836e51c6f20226cb07df7f32895c.png') }}">
                    <p class="logo-text">J.a.r.v.i.s </p>
                </a>
            </div>
            <div class="header_right">
                <div class="contacts">
                    <div class="drop">
                        <p class="contacts__schedule contacts__schedule_mod" href=""
                           onclick="activeClass();">{{ current_user.username }}</p>
                        <div class="dropdown dropdown_mod" id="dropdown">
                            <div class="drop-block drop-block_out">
                                <div class="triangle triangle_mod"></div>
                                <a class="input" href="/logout">
                                    <button class="header_btn" name="LogOut" type="submit" value="Выйти">Выход</button>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </header>
    <section class="container form_content">
        <!-- условия -->
        <section class="condition">
            <div class="form">
                <div class="form__title">
                    Создать новый
                </div>
                <form action="/workshop" method="POST" name="NewSceanrio">
                    <div class="form_condition">
                        <label class="form__log">
                            <div class="form__field-title">
                                Название
                            </div>
                            <input class="form__input-text" name="NewScenarioName"
                                   placeholder="Название нового сценария"
                                   type="text">
                        </label>
                        <label class="form__log">
                            <div class="form__field-title">
                                Условие:
                            </div>
                            <select class="form__input-text" name="TriggerID">
                                {% for trigger in triggers_list %}
                                    <option value="{{ trigger.id }}">{{ trigger.name }}</option>
                                {% endfor %}
                            </select>
                        </label>
                        <div class="form__row">
                            <label class="form__textaria-label">
                                <textarea class="form__texterea" name="TriggerArgs" placeholder="Параметры"></textarea>
                            </label>
                        </div>
                        <label class="form__log">
                            <div class="form__field-title">
                                Действие:
                            </div>
                            <select class="form__input-text" name="ActionID">
                                {% for action in actions_list %}
                                    <option value="{{ action.id }}">{{ action.name }}</option>
                                {% endfor %}
                            </select>
                        </label>
                        <div class="form__row">
                            <label class="form__textaria-label">
                                <textarea class="form__texterea" name="ActionArgs" placeholder="Параметры"></textarea>
                            </label>
                        </div>
                        <div class="form__btns">
                            <div class="form__controls">
                                <div class="form__controls-btns clearfix">
                                    <div class="form__controls-right">
                                        <button class="form__submit" name="SendScenario" type="submit" value="Добавить">
                                            Добавить
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </section>
        <!-- лист событий -->
        <section class="events">
            <section class="form">
                <div class="form__title">
                    Список сценариев
                </div>
                <form action="/workshop" method="POST" name="Scenarios">
                    <ul class="events_list">
                        {% if user_scripts_list %}
                            {% set count = 1 %}
                            {% for user_script in user_scripts_list %}
                                <li class="events_item">
                                    <p>• {{ user_script.scenario_name }}</p>
                                </li>
                            {% endfor %}
                        {% else %}
                            <p>У вас пока отсутствуют сценарии</p>
                        {% endif %}
                    </ul>
                </form>
            </section>
        </section>
        <!-- лист телеги -->
        <section class="telegram">
            <div class="form">
                <div class="form__title">
                    Ваш Telegram
                </div>
                <form action="/workshop" method="POST" name="Telegram">
                    <label class="form__log">
                        {% if tg_username %}
                            <input class="form__input-text" name="TGUsername" placeholder=@{{ tg_username }}
                                   type="text">
                        {% else %}
                            <input class="form__input-text" name="TGUsername" placeholder="@Логин" type="text">
                        {% endif %}
                    </label>
                    <div class="form__btns">
                        <div class="form__controls">
                            <div class="form__controls-btns clearfix">
                                <div class="form__controls-right">
                                    <button class="form__submit" name="TelegButton" type="submit" value="Отправить">
                                        Изменить
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="form">
                <div class="form__title">
                    Удалить сценарий
                </div>
                <form action="/workshop" method="POST" name="">
                    <label class="form__log">
                        <div class="form__field-title">
                            Выберите для удаления
                        </div>
                        <select class="form__input-text" name="ScenarioID">
                            {% for user_script in user_scripts_list %}
                                <option value="{{ user_script.id }}">{{ user_script.scenario_name }}</option>
                            {% endfor %}
                        </select>
                    </label>
                    <div class="form__btns">
                        <div class="form__controls">
                            <div class="form__controls-btns clearfix">
                                <div class="form__controls-right">
                                    <button class="form__submit" name="" type="submit" value="Удалить">Удалить</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </section>
    </section>
</div>

<!-- заглушка -->
<footer class="footer clearfix">
    <div class="container">
        <div class="footer-q clearfix">
            <p class="footer-full-text">Сделано с любовью и старанием на курсе ВГУ "Тестирование ПО" <b
                    class="footer-text_name"></b></p>
        </div>
        <div class="footer-q clearfix">
            <a class="logo-text" href="/">j.a.r.v.i.s</a>
        </div>
        <div class="footer-q clearfix">
            <p class="footer-messeger_text">Наши социальные сети</p>
            <ul class="footer-messeger">
                <li class="footer-messeger__item ">
                    <a class="footer-messeger__link" href="">
                        <img alt="" class="footer-messeger__icon"
                             src="{{ url_for('static', filename='./img/vk.png') }}">
                    </a>
                </li>
                <li class="footer-messeger__item">
                    <a class="footer-messeger__link " href="">
                        <img alt="" class="footer-messeger__icon"
                             src="{{ url_for('static', filename='./img/fb.png') }}">
                    </a>
                </li>
                <li class="footer-messeger__item">
                    <a class="footer-messeger__link" href="">
                        <img alt="" class="footer-messeger__icon"
                             src="{{ url_for('static', filename='./img/google.png') }}">
                    </a>
                </li>
                <li class="footer-messeger__item">
                    <a class="footer-messeger__link" href="">
                        <img alt="" class="footer-messeger__icon"
                             src="{{ url_for('static', filename='./img/twitter.png') }}">
                    </a>
                </li>
                <li class="footer-messeger__item">
                    <a class="footer-messeger__link" href="">
                        <img alt="" class="footer-messeger__icon"
                             src="{{ url_for('static', filename='./img/mail.png') }}">
                    </a>
                </li>
            </ul>
        </div>
    </div>
</footer>
</body>
</html>