Init rocket backend, base layout to be extended by other html
This commit is contained in:
@@ -1,4 +1,14 @@
|
||||
{# vim: set filetype=html #}
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
This file is part of Inventory.
|
||||
|
||||
Inventory is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
Foobar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with Inventory. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta name="author" content="Johannes Randerath" />
|
||||
@@ -6,30 +16,18 @@
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Inventory</title>
|
||||
<title>Inventory - {% block pagename %}{% endblock pagename %}</title>
|
||||
<script type="text/javascript">
|
||||
let ncol = 1;
|
||||
document.addEventListener("DOMContentLoaded", (event) => {
|
||||
for (let row of document.getElementById("content_table").getElementsByTagName('tbody')[0].rows) {
|
||||
let createClickHandler = function(r) {
|
||||
return function() {
|
||||
$('#edit_item').modal('show');
|
||||
};
|
||||
};
|
||||
row.onclick = createClickHandler(row);
|
||||
}
|
||||
let caller = "";
|
||||
document.getElementsByClassName('mdl').forEach((btn) => {
|
||||
btn.addEventListener('click', (event) => {
|
||||
caller = btn.id;
|
||||
});
|
||||
});
|
||||
function add_column() {
|
||||
ncol += 1;
|
||||
document.getElementById('dynamic_columns').innerHTML += "<div class='row mt-3' id='columns'><div class='col-auto align-bottom'><div class='form-text me-1' id='field_index'><strong>" + ncol + "</strong></div></div><div class='col-auto'><input type='text' class='form-control' id='field_name' aria-describedby='field_name_label'></div><div class='col-auto'><select class='form-select' aria-label='data type'><option value='text' selected>Text</option><option value='number'>Number</option><option value='date'>Date</option></select></div></div>"
|
||||
}
|
||||
function create_table() {
|
||||
document.getElementById('dynamic_columns').innerHTML = "";
|
||||
ncol = 1;
|
||||
}
|
||||
</script>
|
||||
{% block script %}{% endblock script %}
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav class='navbar navbar-expand-lg bg-body bg-body-tertiary'>
|
||||
<div class='container-fluid'>
|
||||
<a class='navbar-brand' href='#'>Inventory</a>
|
||||
@@ -57,98 +55,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto">
|
||||
<h1>Inventory table <button class="btn" type="button"><i class="bi bi-pencil"></i></button></h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn-toolbar mt-2" role="toolbar">
|
||||
<div class="btn-group me-2">
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#new_item"><i class="bi bi-plus-lg"></i></button>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<div class="input-group-text dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="bi bi-search"></i>
|
||||
</div>
|
||||
<ul class="dropdown-menu">
|
||||
<select class="form-select" multiple>
|
||||
<li><option disabled class="dropdown-header">Search in</option></li>
|
||||
<li><option class="dropdown-item" value="1" selected>1</option></li>
|
||||
<li><option class="dropdown-item" value="2" selected>2</option></li>
|
||||
</select>
|
||||
</ul>
|
||||
<input type="text" placeholder="Search" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<table id="content_table" class="table table-striped table-hover table-responsive table-bordered mt-2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:7%">
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto">
|
||||
#
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn-toolbar">
|
||||
<button class="btn p-0 me-2" type="button" data-bs-toggle="modal" data-bs-target="#filter"><i class="bi bi-filter"></i></button>
|
||||
<button class="btn p-0" type="button" onclick="console.log('click');"><i class="bi bi-sort-down"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto">
|
||||
name
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn-toolbar">
|
||||
<button class="btn p-0 me-2" type="button" data-bs-toggle="modal" data-bs-target="#filter"><i class="bi bi-filter"></i></button>
|
||||
<button class="btn p-0" type="button" onclick="console.log('click');"><i class="bi bi-sort-down"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto">
|
||||
sdakjhf
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn-toolbar">
|
||||
<button class="btn p-0 me-2" type="button" data-bs-toggle="modal" data-bs-target="#filter"><i class="bi bi-filter"></i></button>
|
||||
<button class="btn p-0" type="button" onclick="console.log('click');"><i class="bi bi-sort-down"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto">
|
||||
drtr
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn-toolbar">
|
||||
<button class="btn p-0 me-2" type="button" data-bs-toggle="modal" data-bs-target="#filter"><i class="bi bi-filter"></i></button>
|
||||
<button class="btn p-0" type="button" onclick="console.log('click');"><i class="bi bi-sort-down"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>one</td>
|
||||
<td>fhsad</td>
|
||||
<td>fsdud</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% block body %}{% endblock body %}
|
||||
|
||||
<!-- Modals -->
|
||||
<!-- Create new table -->
|
||||
@@ -185,24 +93,26 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dynamic_columns">
|
||||
<!-- Columns added using plus button -->
|
||||
</div>
|
||||
<div class="row justify-content-center mb-3 mt-3">
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-primary" type="button" onclick="add_column()"><i class="bi bi-plus-lg"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dynamic_columns">
|
||||
<!-- Columns added using plus button -->
|
||||
</div>
|
||||
<div class="row justify-content-center mb-3 mt-3">
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-primary" type="button" onclick="add_column()"><i class="bi bi-plus-lg"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary" data-bs-dismiss="modal" type="button">Close</button>
|
||||
<button class="btn btn-primary" type="button" onclick="create_table()">Create</button>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Import new table -->
|
||||
<div class="modal fade" id="import_table" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
@@ -220,6 +130,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add new item -->
|
||||
<div class="modal fade" id="new_item" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
@@ -237,6 +148,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Edit item -->
|
||||
<div class="modal fade" id="edit_item" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
@@ -254,12 +166,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Filter column -->
|
||||
<div class="modal fade" id="filter" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5">Edit filter on</h1>
|
||||
<h1 class="modal-title fs-5">Edit filter on <div id="modal_caller"></div></h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@@ -271,7 +184,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
147
templates/home.html
Normal file
147
templates/home.html
Normal file
@@ -0,0 +1,147 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta name="author" content="Johannes Randerath" />
|
||||
<meta charset="utf-8" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Inventory</title>
|
||||
</head>
|
||||
<body>
|
||||
<nav class='navbar navbar-expand-lg bg-body bg-body-tertiary'>
|
||||
<div class='container-fluid'>
|
||||
<a class='navbar-brand' href='#'>Inventory</a>
|
||||
<button class='navbar-toggler' type='button' data-bs-toggle='collapse' data-bs-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 me-auto mb-2 mb-lg-0'>
|
||||
<li class='nav-item dropdown'>
|
||||
<a class='nav-link dropdown-toggle' role='button' data-bs-toggle='dropdown' aria-expanded='false'>
|
||||
Choose Table
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" role="button" data-bs-toggle="modal" data-bs-target="#new_table">
|
||||
<i class="bi bi-plus-lg"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" role="button" data-bs-toggle="modal" data-bs-target="#import_table">
|
||||
<i class="bi bi-folder2-open"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="accordion" id="my_tables">
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header">
|
||||
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#first" aria-expanded="false" aria-controls="first">
|
||||
First
|
||||
</button>
|
||||
</h2>
|
||||
<div id="first" class="accordion-collapse collapse" data-bs-parent="#my_tables">
|
||||
<div class="accordion-body">
|
||||
<h3>Name of first table <a class="btn btn-primary" href="table.html">Open</a></h3>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>name</th>
|
||||
<th>...</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>one</td>
|
||||
<td>...</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Modals -->
|
||||
<!-- Create new table -->
|
||||
<div class="modal fade" id="new_table" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5">New table</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="new_table_name" class="form-label">Name</label>
|
||||
<input type="text" class="form-control" id="new_table_name" aria-describedby="new_table_name_label">
|
||||
<div id="new_table_name_label" class="form-text">Name of the new table</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="row" id="columns">
|
||||
<div class="col-auto align-bottom me-1">
|
||||
<label for="field_index" class="form-label">#</label>
|
||||
<div class="form-text" id="field_index"><strong>1</strong></div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label for="field_name" class="form-label">Column name</label>
|
||||
<input type="text" class="form-control" id="field_name" aria-describedby="field_name_label">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label for="field_name" class="form-label">Data type</label>
|
||||
<select class="form-select" aria-label="data type">
|
||||
<option value="text" selected>Text</option>
|
||||
<option value="number">Number</option>
|
||||
<option value="date">Date</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dynamic_columns">
|
||||
<!-- Columns added using plus button -->
|
||||
</div>
|
||||
<div class="row justify-content-center mb-3 mt-3">
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-primary" type="button" onclick="add_column()"><i class="bi bi-plus-lg"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary" data-bs-dismiss="modal" type="button">Close</button>
|
||||
<button class="btn btn-primary" type="button" onclick="create_table()">Create</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Import new table -->
|
||||
<div class="modal fade" id="import_table" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5">Import new table</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary" data-bs-dismiss="modal" type="button">Close</button>
|
||||
<button class="btn btn-primary" type="button">Import</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
30
templates/index.html
Normal file
30
templates/index.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta name="author" content="Johannes Randerath" />
|
||||
<meta charset="utf-8" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Inventory - Index</title>
|
||||
</head>
|
||||
<body>
|
||||
<nav class='navbar navbar-expand-lg bg-body bg-body-tertiary'>
|
||||
<div class="container-fluid">
|
||||
<a class='navbar-brand' href='base.html'>Inventory</a>
|
||||
<button class='navbar-toggler' type='button' data-bs-toggle='collapse' data-bs-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 ms-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item"><a class="nav-link" href="login.html">Login <i class="bi bi-box-arrow-in-right"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
41
templates/login.html
Normal file
41
templates/login.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta name="author" content="Johannes Randerath" />
|
||||
<meta charset="utf-8" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Inventory - Index</title>
|
||||
</head>
|
||||
<body>
|
||||
<nav class='navbar navbar-expand-lg bg-body bg-body-tertiary'>
|
||||
<div class="container-fluid">
|
||||
<a class='navbar-brand' href='base.html'>Inventory</a>
|
||||
<button class='navbar-toggler' type='button' data-bs-toggle='collapse' data-bs-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 ms-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item"><a class="nav-link" href="register.html">Register <i class="bi bi-person-plus"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<h2>Login to Inventory</h2>
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="login_email" class="form-label">Email</label>
|
||||
<input id="login_email" class="form-control" placeholder="me@member.fsf.org" type="email">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="login_password" class="form-label">Password</label>
|
||||
<input id="login_password" class="form-control" placeholder="123456789" type="password">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Login</button>
|
||||
</form>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
46
templates/register.html
Normal file
46
templates/register.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta name="author" content="Johannes Randerath" />
|
||||
<meta charset="utf-8" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Inventory - Index</title>
|
||||
</head>
|
||||
<body>
|
||||
<nav class='navbar navbar-expand-lg bg-body bg-body-tertiary'>
|
||||
<div class="container-fluid">
|
||||
<a class='navbar-brand' href='base.html'>Inventory</a>
|
||||
<button class='navbar-toggler' type='button' data-bs-toggle='collapse' data-bs-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 ms-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item"><a class="nav-link" href="login.html">Login <i class="bi bi-box-arrow-in-right"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<h2>Register for Inventory</h2>
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="register_email" class="form-label">Email</label>
|
||||
<input id="register_email" type="email" class="form-control" placeholder="me@member.fsf.org">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="register_password" class="form-label">Password</label>
|
||||
<input id="register_password" type="password" class="form-control" placeholder="123456789">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="confirm_password" class="form-label">Confirm password</label>
|
||||
<input id="confirm_password" type="password" class="form-control" placeholder="123456789">
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit">Register</button>
|
||||
</form>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
98
templates/table.html.tera
Normal file
98
templates/table.html.tera
Normal file
@@ -0,0 +1,98 @@
|
||||
{# vim: set filetype=html: #}
|
||||
|
||||
{% extends "base" %}
|
||||
{% block pagename %}Table{% endblock pagename %}
|
||||
{% block script %}
|
||||
<script type="text/javascript">
|
||||
let ncol = 1;
|
||||
document.addEventListener("DOMContentLoaded", (event) => {
|
||||
for (let row of document.getElementById("content_table").getElementsByTagName('tbody')[0].rows) {
|
||||
let createClickHandler = function(r) {
|
||||
return function() {
|
||||
$('#edit_item').modal('show');
|
||||
};
|
||||
};
|
||||
row.onclick = createClickHandler(row);
|
||||
}
|
||||
});
|
||||
function add_column() {
|
||||
ncol += 1;
|
||||
document.getElementById('dynamic_columns').innerHTML += "<div class='row mt-3' id='columns'><div class='col-auto align-bottom'><div class='form-text me-1' id='field_index'><strong>" + ncol + "</strong></div></div><div class='col-auto'><input type='text' class='form-control' id='field_name' aria-describedby='field_name_label'></div><div class='col-auto'><select class='form-select' aria-label='data type'><option value='text' selected>Text</option><option value='number'>Number</option><option value='date'>Date</option></select></div></div>"
|
||||
}
|
||||
function create_table() {
|
||||
document.getElementById('dynamic_columns').innerHTML = "";
|
||||
ncol = 1;
|
||||
}
|
||||
</script>
|
||||
{% endblock script %}
|
||||
{% block body %}
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto">
|
||||
<h1>Inventory table <button class="btn" type="button"><i class="bi bi-pencil"></i></button></h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn-toolbar mt-2" role="toolbar">
|
||||
<div class="btn-group me-2">
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#new_item"><i class="bi bi-plus-lg"></i></button>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<div class="input-group-text dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="bi bi-search"></i>
|
||||
</div>
|
||||
<ul class="dropdown-menu">
|
||||
<select class="form-select" multiple>
|
||||
<li><option disabled class="dropdown-header">Search in</option></li>
|
||||
<li><option class="dropdown-item" value="1" selected>1</option></li>
|
||||
<li><option class="dropdown-item" value="2" selected>2</option></li>
|
||||
</select>
|
||||
</ul>
|
||||
<input type="text" placeholder="Search" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<table id="content_table" class="table table-striped table-hover table-responsive table-bordered mt-2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:7%">
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto">
|
||||
#
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn-toolbar">
|
||||
<button class="btn p-0 me-2 mdl" type="button" data-bs-toggle="modal" data-bs-target="#filter"><i class="bi bi-filter"></i></button>
|
||||
<button class="btn p-0" type="button" onclick="console.log('click');"><i class="bi bi-sort-down"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
{% for column in columns %}
|
||||
<th>
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto">
|
||||
{{ column }}
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn-toolbar">
|
||||
<button class="btn p-0 me-2" type="button" data-jr-column="{{ column }}" data-bs-toggle="modal" data-bs-target="#filter"><i class="bi bi-filter"></i></button>
|
||||
<button class="btn p-0" type="button" onclick="console.log('click');"><i class="bi bi-sort-down"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in rows %}
|
||||
<tr>
|
||||
{% for column in row %}
|
||||
<td>{{ column }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock body %}
|
||||
3
templates/test.html.tera
Normal file
3
templates/test.html.tera
Normal file
@@ -0,0 +1,3 @@
|
||||
{% extends "base" %}
|
||||
{% block pagename %}Test{% endblock pagename%}
|
||||
{% block body %}{% endblock body %}
|
||||
Reference in New Issue
Block a user