Первая попытка модельки
This commit is contained in:
26
templates/_navbar.html
Normal file
26
templates/_navbar.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="{% url 'part-list' %}">BOM Manager</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="{% url 'part-list' %}">Список деталей</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Структура изделия</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="d-flex">
|
||||
<a href="{% url 'admin:index' %}" class="btn btn-outline-secondary me-2">
|
||||
<i class="fas fa-tools"></i> Админка
|
||||
</a>
|
||||
<a href="#" class="btn btn-outline-secondary">
|
||||
<i class="fas fa-sign-out-alt"></i> Выйти
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
22
templates/base.html
Normal file
22
templates/base.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{% block title %}{% endblock %}</title>
|
||||
<!-- Bootstrap 5 CDN -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<!-- FontAwesome CDN -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
|
||||
{% include '_navbar.html' %}
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-4">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% include '_footer.html' %}
|
||||
<!-- Bootstrap 5 JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
45
templates/parts_list.html
Normal file
45
templates/parts_list.html
Normal file
@@ -0,0 +1,45 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Список деталей{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<h4>Фильтры</h4>
|
||||
<form method="get">
|
||||
{{ filter.form.as_p }}
|
||||
<button type="submit" class="btn btn-primary">Применить</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<h4>Результаты</h4>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Наименование</th>
|
||||
<th>Децимальный номер</th>
|
||||
<th>Тип</th>
|
||||
<th>Толщина</th>
|
||||
<th>Длина</th>
|
||||
<th>Вес</th>
|
||||
<th>Длина реза</th>
|
||||
<th>Число проколов</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for part in filter.qs %}
|
||||
<tr>
|
||||
<td>{{ part.name }}</td>
|
||||
<td>{{ part.decimal_number }}</td>
|
||||
<td>{{ part.get_type_display }}</td>
|
||||
<td>{{ part.thickness }}</td>
|
||||
<td>{{ part.length }}</td>
|
||||
<td>{{ part.weight }}</td>
|
||||
<td>{{ part.cut_length }}</td>
|
||||
<td>{{ part.number_of_punches }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user