portier/source/templates/base.html

118 lines
5.7 KiB
HTML
Raw Normal View History

{% load static %}
{% load i18n %}
{% load bootstrap4 %}
{% load fontawesome_5 %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>{% block 'title' %}portier{% endblock %}</title>
<link rel="stylesheet" href="{% static 'fonts/inter.css' %}"></link>
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}"></link>
{% fontawesome_5_static %}
<script src="{% static 'js/jquery.min.js' %}"></script>
<script src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
</head>
<body>
<header>
<nav class="navbar navbar-expand-md navbar-light bg-light mb-4 border boder-bottom-0">
2020-05-02 00:10:36 +02:00
<div class="container">
<span class="navbar-brand mb-0 h1">
<a href="{% url 'index' %}">portier</a>
</span>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<ul class="navbar-nav">
{% if user.is_authenticated %}
<li class="nav-item dropdown border-left">
<a class="nav-link dropdown-toggle" href="#" id="navbarAccountDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% blocktrans with username=user.get_username %}hello_{{ username }}{% endblocktrans %}
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarAccountDropdown">
<a class="dropdown-item" href="{% url 'password_change' %}">{% trans "navbar_account_password_change" %}</a>
<form method="post" action="{% url 'logout' %}?next={% url 'index' %}">{% csrf_token %}<button type="submit" class="dropdown-item">{% trans "navbar_account_logout" %}</button></form>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link login" href="{% url 'login' %}?next={% url 'index' %}">{% trans "navbar_login" %}</a>
</li>
{% endif %}
<li class="nav-item dropdown border-left">
<a class="nav-link dropdown-toggle" id="languageSelectDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% fa5_icon 'language' %}
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="languageSelectDropdown">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<a class="dropdown-item{% if language.code == LANGUAGE_CODE %} font-weight-bold{% endif %}" onclick="$('#languageSelectInput').val('{{ language.code }}'); $('#languageSelectForm').submit()">{{ language.name_local}} ({{ language.code }})</a>
{% endfor %}
</div>
<form action="{% url 'set_language' %}" method="post" id="languageSelectForm">
{% csrf_token %}
<input name="next" type="hidden" value="{{ redirect_to }}">
<input name="language" type="hidden" value="" id="languageSelectInput">
</form>
</li>
</ul>
</div>
2020-05-02 00:10:36 +02:00
</div>
</nav>
</header>
<main class="container" roles="main">
2024-02-25 23:19:01 +01:00
{% if user.is_authenticated %}
{% block 'sidenav' %}
<div class="row">
<div class="col-md-2 col-sm-4 border-right">
<nav>
<ul class="nav nav-pills flex-column">
<li class="nav-item">
2024-02-28 19:38:18 +01:00
<a class="nav-link{% if not perms.config.add_stream %} disabled{% endif %}{% if section == "stream" %} active {% endif %}" href="{% url 'config:stream_list' %}">{% fa5_icon 'dot-circle' %} {% trans "navbar_configuration_stream" %}</a>
2024-02-25 23:19:01 +01:00
</li>
<li class="nav-item">
2024-02-28 19:38:18 +01:00
<a class="nav-link{% if not perms.config.add_restream %} disabled{% endif %}{% if section == "restream" %} active {% endif %}" href="{% url 'config:restream_list' %}">{% fa5_icon 'expand-arrows-alt' %} {% trans "navbar_configuration_restream" %}</a>
2024-02-25 23:19:01 +01:00
</li>
<li class="nav-item">
2024-04-01 16:27:31 +02:00
<a class="nav-link{% if not perms.config.add_pull %} disable{% endif %}{% if section == "pull" %} active {% endif %}" href="{% url 'config:pull_list' %}">{% fa5_icon 'compress-arrows-alt' %} {% trans "navbar_configuration_pull" %}</a>
2024-02-25 23:19:01 +01:00
</li>
<li class="nav-item">
2024-02-28 19:38:18 +01:00
<a class="nav-link disabled" href="{% url 'config:stream_list' %}">{% fa5_icon 'broadcast-tower' %} {% trans "navbar_configuration_publish" %}</a>
2024-02-25 23:19:01 +01:00
</li>
<li class="nav-item">
2024-02-28 19:38:18 +01:00
<a class="nav-link disabled" href="{% url 'config:stream_list' %}">{% fa5_icon 'hdd' %} {% trans "navbar_configuration_record" %}</a>
2024-02-25 23:19:01 +01:00
</li>
<li class="nav-item">
2024-02-28 19:38:18 +01:00
<a class="nav-link disabled" href="{% url 'config:stream_list' %}">{% fa5_icon 'random' %} {% trans "navbar_configuration_switch" %}</a>
2024-02-25 23:19:01 +01:00
</li>
</ul>
</nav>
</div>
<div class="col">
{% endblock %}
{% endif %}
{% block 'content' %}
{% endblock %}
{% if user.is_authenticated %}
</div>
</div>
{% endif %}
</main>
<footer class="text-muted">
<div class="container">
</div>
</footer>
</body>
</html>