dodanie szablonów

This commit is contained in:
Mateusz779 2023-04-19 12:58:31 +02:00
parent bfd11c6d7d
commit 63951315c9
4 changed files with 50 additions and 46 deletions

36
templates/base.html Normal file
View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<style>
{% block style %}{% endblock %}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Panel administracyjny</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarNav" >
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/">Lista maszyn</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/create/conf">Tworzenie obrazu</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/logout">Wyloguj</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
{% block content %}{% endblock %}
</div>
</body>
</html>

View File

@ -1,10 +1,6 @@
<!DOCTYPE html> {% extends "base.html" %}
<html> {% block title %}Tworzenie obrazu{% endblock %}
<head> {% block style %}
<meta charset="UTF-8">
<title>Formularz</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<style>
/* styl dla całej strony */ /* styl dla całej strony */
body { body {
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
@ -66,10 +62,9 @@ form button[type="submit"] {
form button[type="submit"]:hover { form button[type="submit"]:hover {
background-color: #3e8e41; background-color: #3e8e41;
} }
</style> {% endblock %}
</head>
<body> {% block content %}
{% extends 'navbar.html' %}
<h1>Formularz tworzenia pliku konfiguracyjnego</h1> <h1>Formularz tworzenia pliku konfiguracyjnego</h1>
<form method="POST" action="/api/createconf" enctype="multipart/form-data"> <form method="POST" action="/api/createconf" enctype="multipart/form-data">
<label>Nazwa konfiguracji:</label><br> <label>Nazwa konfiguracji:</label><br>
@ -82,5 +77,4 @@ form button[type="submit"]:hover {
<textarea name="authorized_keys_config" rows="4" cols="50"></textarea><br><br> <textarea name="authorized_keys_config" rows="4" cols="50"></textarea><br><br>
<input type="submit" value="Wyślij"> <input type="submit" value="Wyślij">
</form> </form>
</body> {% endblock %}
</html>

View File

@ -1,9 +1,6 @@
<!DOCTYPE html> {% extends "base.html" %}
<html> {% block title %}Panel administracyjny{% endblock %}
<head> {% block style %}
<title>Panel administracyjny</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<style>
body { body {
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
background-color: #f5f5f5; background-color: #f5f5f5;
@ -57,10 +54,9 @@
background-color: #3e8e41; background-color: #3e8e41;
} }
</style> {% endblock %}
</head>
<body> {% block content %}
{% extends 'navbar.html' %}
<div class="container"> <div class="container">
<h1 class="my-5">Lista maszyn</h1> <h1 class="my-5">Lista maszyn</h1>
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
@ -96,5 +92,4 @@
window.open(newUrl,"_blank"); window.open(newUrl,"_blank");
} }
</script> </script>
</body> {% endblock %}
</html>

View File

@ -1,21 +0,0 @@
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Panel administracyjny</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarNav" >
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/">Lista maszyn</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/create/conf">Tworzenie obrazu</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/logout">Wyloguj</a>
</li>
</ul>
</div>
</div>
</nav>