File size: 2,387 Bytes
deeb85c
 
 
 
 
 
 
 
 
 
 
 
2004aa8
deeb85c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2004aa8
deeb85c
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Edit Cables</title>
    <link rel="stylesheet" href="/static/styles.css">
</head>
<body>
    <header>
        <h1>Edit Cables</h1>
    </header>
    <main class="edit-cables-main">
        <section class="add-cable-section">
            <h2>Add Cable</h2>
            <form action="/add_cable" method="post" class="cable-form">
                <div class="form-row">
                    <label for="type">Cable Type:</label>
                    <input type="text" id="type" name="type" required>
                </div>
                <div class="form-row">
                    <label for="resistance">Resistance:</label>
                    <input type="number" step="0.01" id="resistance" name="resistance" required>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-add">Add Cable</button>
                </div>
            </form>
        </section>

        <hr class="section-divider">

        <section class="existing-cables-section">
            <h2>Existing Cables</h2>
            <div class="cable-list">
                {% for cable in cables %}
                <form action="/edit_cable/{{ cable.id }}" method="post" class="cable-form">
                    <div class="form-row">
                        <label for="type">Cable Type:</label>
                        <input type="text" id="type" name="type" value="{{ cable.type }}" required>
                    </div>
                    <div class="form-row">
                        <label for="resistance">Resistance:</label>
                        <input type="number" step="0.01" id="resistance" name="resistance" value="{{ cable.resistance }}" required>
                    </div>
                    <div class="btn-group">
                        <button type="submit" class="btn btn-save">Save</button>
                        <button formaction="/delete_cable/{{ cable.id }}" formmethod="post" class="btn btn-delete">Delete</button>
                    </div>
                </form>
                <hr class="cable-divider">
                {% endfor %}
            </div>
        </section>
        <a href="/" class="btn btn-back">Back to Calculator</a>
    </main>
</body>
</html>