card editing, keeping order, fixes

This commit is contained in:
2019-12-30 11:43:39 +01:00
parent ed65215723
commit 1f4af57b6e
10 changed files with 323 additions and 83 deletions
+3 -3
View File
@@ -3,9 +3,9 @@
<head>
<meta charset="UTF-8">
<title>{% block title %}{% endblock title %} &bull; Inventory</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="taggle.css">
<script src="taggle.min.js"></script>
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="/taggle.css">
<script src="/taggle.min.js"></script>
</head>
<body>
<nav class="top-nav">
+1 -1
View File
@@ -2,7 +2,7 @@
{% import "_form_macros" as form %}
{% block title -%}
Add Record
New
{%- endblock %}
{% block nav -%}
+22
View File
@@ -0,0 +1,22 @@
{% extends "_layout" %}
{% import "_form_macros" as form %}
{% block title -%}
Edit
{%- endblock %}
{% block nav -%}
<a href="/">Index</a>
{%- endblock %}
{% block content -%}
<form action="/edit/{{id}}" method="POST" class="Form">
<div class="Row indented">
<h1>Edit Record</h1>
</div>
{% include "_fields" %}
<div class="Row indented">
<button type="submit">Save</button>
</div>
</form>
{%- endblock %}
+2
View File
@@ -13,6 +13,7 @@
<table class="cards-table">
<thead>
<tr>
<th>Actions</th>
{%- for field in fields %}
<th>{{ field.label }}</th>
{%- endfor %}
@@ -21,6 +22,7 @@
<tbody>
{%- for card in cards %}
<tr>
<td><a href="/edit/{{card.id}}">Edit</a></td>
{%- for field in card.fields %}
<td>
{%- if field.kind == "bool" -%}