mirror of
https://github.com/tchapi/davis.git
synced 2025-01-18 05:18:35 +01:00
Separate base page into partials
This commit is contained in:
parent
c14ed97ddd
commit
65076748a9
18
templates/_partials/flashes.html.twig
Normal file
18
templates/_partials/flashes.html.twig
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<div aria-live="polite" aria-atomic="true" class="flashes">
|
||||||
|
<div class="inner">
|
||||||
|
{% for label, messages in app.flashes %}
|
||||||
|
{% for message in messages %}
|
||||||
|
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true" data-delay="3000">
|
||||||
|
<div class="toast-header">
|
||||||
|
<span class="badge badge-pill badge-{{ label }} mr-2"> </span>
|
||||||
|
<strong class="mr-auto">{{ ("label." ~ label)|trans }}</strong>
|
||||||
|
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="{{ "close"|trans }}">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="toast-body">{{ message }}</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
20
templates/_partials/navigation.html.twig
Normal file
20
templates/_partials/navigation.html.twig
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light">
|
||||||
|
<div class="container">
|
||||||
|
<a class="navbar-brand" href="#">
|
||||||
|
<img src="/images/logo.png" width="30" height="30" alt=""> Davis
|
||||||
|
</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="{{ "toggle.navigation"|trans }}">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
|
<ul class="navbar-nav">
|
||||||
|
<li class="nav-item{% if menu == "dashboard" %} active{% endif %}">
|
||||||
|
<a class="nav-link" href="{{ path('dashboard') }}">{{ "title.dashboard"|trans }}</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item{% if menu == "resources" %} active{% endif %}">
|
||||||
|
<a class="nav-link" href="{{ path('users') }}">{{ "title.users_and_resources"|trans }}</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
@ -7,24 +7,8 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="/css/style.css">
|
<link rel="stylesheet" type="text/css" href="/css/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="navbar fixed-top navbar-expand-lg navbar-light bg-light">
|
{% include '_partials/navigation.html.twig' %}
|
||||||
<a class="navbar-brand" href="#">
|
{% include '_partials/flashes.html.twig' %}
|
||||||
<img src="/images/logo.png" width="30" height="30" alt=""> Davis
|
|
||||||
</a>
|
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
|
||||||
<ul class="navbar-nav">
|
|
||||||
<li class="nav-item{% if menu == "dashboard" %} active{% endif %}">
|
|
||||||
<a class="nav-link" href="{{ path('dashboard') }}">Dashboard</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item{% if menu == "resources" %} active{% endif %}">
|
|
||||||
<a class="nav-link" href="{{ path('users') }}">Users and resources</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{% block body %}{% endblock %}
|
{% block body %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user