diff options
Diffstat (limited to 'localwebsite/templates-web')
-rw-r--r-- | localwebsite/templates-web/auth.twig | 24 | ||||
-rw-r--r-- | localwebsite/templates-web/bc.twig | 12 | ||||
-rw-r--r-- | localwebsite/templates-web/cams.twig | 11 | ||||
-rw-r--r-- | localwebsite/templates-web/index.twig | 6 | ||||
-rw-r--r-- | localwebsite/templates-web/inverter_page.twig | 11 | ||||
-rw-r--r-- | localwebsite/templates-web/modem_status_page.twig | 11 | ||||
-rw-r--r-- | localwebsite/templates-web/pump.twig | 11 | ||||
-rw-r--r-- | localwebsite/templates-web/routing_header.twig | 11 | ||||
-rw-r--r-- | localwebsite/templates-web/sensors.twig | 11 | ||||
-rw-r--r-- | localwebsite/templates-web/sms_page.twig | 11 |
10 files changed, 77 insertions, 42 deletions
diff --git a/localwebsite/templates-web/auth.twig b/localwebsite/templates-web/auth.twig new file mode 100644 index 0000000..a0107b3 --- /dev/null +++ b/localwebsite/templates-web/auth.twig @@ -0,0 +1,24 @@ +{% include 'bc.twig' with { + history: [ + {text: "Авторизация" } + ] +} %} + +{% if error %} + <div class="mt-4 alert alert-danger"><b>Ошибка:</b> {{ error }}</div> +{% endif %} + + +<form method="post" action="/auth/"> + <div class="mt-2"> + <input type="text" name="username" placeholder="Логин" class="form-control"> + </div> + + <div class="mt-2"> + <input type="password" name="password" placeholder="Пароль" class="form-control"> + </div> + + <div class="mt-2"> + <button type="submit" class="btn btn-outline-primary">Войти</button> + </div> +</form>
\ No newline at end of file diff --git a/localwebsite/templates-web/bc.twig b/localwebsite/templates-web/bc.twig new file mode 100644 index 0000000..b74ad40 --- /dev/null +++ b/localwebsite/templates-web/bc.twig @@ -0,0 +1,12 @@ +<nav aria-label="breadcrumb"> + <ol class="breadcrumb"> + <li class="breadcrumb-item"><a href="/">Главная</a></li> + {% for item in history %} + <li class="breadcrumb-item"{% if loop.last %} aria-current="page"{% endif %}> + {% if item.link %}<a href="{{ item.link }}">{% endif %} + {{ item.html ? item.html|raw : item.text }} + {% if item.link %}</a>{% endif %} + </li> + {% endfor %} + </ol> +</nav>
\ No newline at end of file diff --git a/localwebsite/templates-web/cams.twig b/localwebsite/templates-web/cams.twig index eb9e6d0..4fc815d 100644 --- a/localwebsite/templates-web/cams.twig +++ b/localwebsite/templates-web/cams.twig @@ -1,9 +1,8 @@ -<nav aria-label="breadcrumb"> - <ol class="breadcrumb"> - <li class="breadcrumb-item"><a href="/">Главная</a></li> - <li class="breadcrumb-item active" aria-current="page">Камеры</li> - </ol> -</nav> +{% include 'bc.twig' with { + history: [ + {text: "Камеры" } + ] +} %} <div id="videos" class="camfeeds"></div> diff --git a/localwebsite/templates-web/index.twig b/localwebsite/templates-web/index.twig index 1635459..8a0bdaf 100644 --- a/localwebsite/templates-web/index.twig +++ b/localwebsite/templates-web/index.twig @@ -5,6 +5,12 @@ </ol> </nav> + {% if auth_user %} + <div class="mb-4 alert alert-secondary"> + Вы авторизованы как <b>{{ auth_user.username }}</b>. <a href="/deauth/">Выйти</a> + </div> + {% endif %} + <h6>Интернет</h6> <ul class="list-group list-group-flush"> <li class="list-group-item"><a href="/modem/status/">Состояние</a></li> diff --git a/localwebsite/templates-web/inverter_page.twig b/localwebsite/templates-web/inverter_page.twig index 2b0af90..2c3f8dd 100644 --- a/localwebsite/templates-web/inverter_page.twig +++ b/localwebsite/templates-web/inverter_page.twig @@ -1,9 +1,8 @@ -<nav aria-label="breadcrumb"> - <ol class="breadcrumb"> - <li class="breadcrumb-item"><a href="/">Главная</a></li> - <li class="breadcrumb-item active" aria-current="page">Инвертор</li> - </ol> -</nav> +{% include 'bc.twig' with { + history: [ + {text: "Инвертор" } + ] +} %} <h6 class="text-primary">Статус</h6> <div id="inverter_status"> diff --git a/localwebsite/templates-web/modem_status_page.twig b/localwebsite/templates-web/modem_status_page.twig index 1aa5cf8..f2b999b 100644 --- a/localwebsite/templates-web/modem_status_page.twig +++ b/localwebsite/templates-web/modem_status_page.twig @@ -1,9 +1,8 @@ -<nav aria-label="breadcrumb"> - <ol class="breadcrumb"> - <li class="breadcrumb-item"><a href="/">Главная</a></li> - <li class="breadcrumb-item active" aria-current="page">Модемы</li> - </ol> -</nav> +{% include 'bc.twig' with { + history: [ + {text: "Модемы" } + ] +} %} {% for modem_key, modem in modems %} <h6 class="text-primary{% if not loop.first %} mt-4{% endif %}">{{ modem.label }}</h6> diff --git a/localwebsite/templates-web/pump.twig b/localwebsite/templates-web/pump.twig index 4a8cad5..3bce0e2 100644 --- a/localwebsite/templates-web/pump.twig +++ b/localwebsite/templates-web/pump.twig @@ -1,9 +1,8 @@ -<nav aria-label="breadcrumb"> - <ol class="breadcrumb"> - <li class="breadcrumb-item"><a href="/">Главная</a></li> - <li class="breadcrumb-item active" aria-current="page">Насос</li> - </ol> -</nav> +{% include 'bc.twig' with { + history: [ + {text: "Насос" } + ] +} %} <form action="/pump/" method="get"> <input type="hidden" name="set" value="{{ status == 'on' ? 'off' : 'on' }}" /> diff --git a/localwebsite/templates-web/routing_header.twig b/localwebsite/templates-web/routing_header.twig index f7322f9..8cb5f47 100644 --- a/localwebsite/templates-web/routing_header.twig +++ b/localwebsite/templates-web/routing_header.twig @@ -1,9 +1,8 @@ -<nav aria-label="breadcrumb"> - <ol class="breadcrumb"> - <li class="breadcrumb-item"><a href="/">Главная</a></li> - <li class="breadcrumb-item active" aria-current="page">Маршрутизация</li> - </ol> -</nav> +{% include 'bc.twig' with { + history: [ + {text: "Маршрутизация" } + ] +} %} {% set routing_tabs = [ {tab: 'smallhome', url: '/routing/', label: 'Маленький дом'}, diff --git a/localwebsite/templates-web/sensors.twig b/localwebsite/templates-web/sensors.twig index 354e4e7..14f8454 100644 --- a/localwebsite/templates-web/sensors.twig +++ b/localwebsite/templates-web/sensors.twig @@ -1,9 +1,8 @@ -<nav aria-label="breadcrumb"> - <ol class="breadcrumb"> - <li class="breadcrumb-item"><a href="/">Главная</a></li> - <li class="breadcrumb-item active" aria-current="page">Датчики</li> - </ol> -</nav> +{% include 'bc.twig' with { + history: [ + {text: "Датчики" } + ] +} %} {% for key, sensor in sensors %} <h6 class="text-primary{% if not loop.first %} mt-4{% endif %}">{{ sensor.name }}</h6> diff --git a/localwebsite/templates-web/sms_page.twig b/localwebsite/templates-web/sms_page.twig index b6551a3..f60d223 100644 --- a/localwebsite/templates-web/sms_page.twig +++ b/localwebsite/templates-web/sms_page.twig @@ -1,9 +1,8 @@ -<nav aria-label="breadcrumb"> - <ol class="breadcrumb"> - <li class="breadcrumb-item"><a href="/">Главная</a></li> - <li class="breadcrumb-item active" aria-current="page">SMS-сообщения</li> - </ol> -</nav> +{% include 'bc.twig' with { + history: [ + {text: "SMS-сообщения" } + ] +} %} <nav> <div class="nav nav-tabs" id="nav-tab"> |