File size: 5,065 Bytes
e1551f7
 
 
 
 
2a05fac
e1551f7
 
13b8640
 
 
2a05fac
13b8640
 
 
8a37466
13b8640
 
 
 
2a05fac
 
13b8640
8a37466
13b8640
2a05fac
 
 
8a37466
13b8640
 
 
2a05fac
13b8640
 
2a05fac
13b8640
 
 
 
8a37466
13b8640
8a37466
13b8640
 
 
 
8a37466
13b8640
2a05fac
13b8640
8a37466
13b8640
2a05fac
13b8640
 
8a37466
 
2a05fac
13b8640
 
8a37466
13b8640
8a37466
 
 
13b8640
e1551f7
13b8640
 
 
 
 
 
8a37466
13b8640
 
 
8a37466
13b8640
 
 
 
e1551f7
 
 
8a37466
13b8640
 
 
 
2a05fac
13b8640
 
2a05fac
 
13b8640
 
 
 
 
 
2a05fac
8a37466
13b8640
2a05fac
13b8640
 
2a05fac
 
13b8640
 
2a05fac
 
13b8640
 
 
8a37466
13b8640
 
 
2a05fac
13b8640
 
e1551f7
13b8640
8a37466
13b8640
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a37466
 
e1551f7
 
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Construction Supervisor AI Coach</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
            background-color: #f4f4f4;
        }
        h1 {
            text-align: center;
            color: #333;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            background: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 15px;
        }
        .row div {
            flex: 1;
            margin-right: 10px;
        }
        .row div:last-child {
            margin-right: 0;
        }
        label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        select, input[type="text"], textarea {
            width: 100%;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
        }
        textarea {
            height: 80px;
            resize: vertical;
        }
        .button-row {
            display: flex;
            justify-content: center;
            margin-top: 10px;
        }
        button {
            padding: 10px 20px;
            background-color: #555;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        button:hover {
            background-color: #666;
        }
        .output {
            margin-top: 20px;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
            background-color: #f9f9f9;
        }
        .output p:empty::before {
            content: "No data available";
            color: #888;
        }
        .error {
            color: red;
            margin-top: 10px;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Construction Supervisor AI Coach</h1>
        <form method="POST" action="{{ url_for('ui') }}">
            <div class="row">
                <div>
                    <label for="supervisor_id">Supervisor ID</label>
                    <input type="text" name="supervisor_id" id="supervisor_id" value="{{ form_data.supervisor_id | default('') }}" placeholder="e.g., SUP-001">
                </div>
                <div>
                    <label for="role">Role</label>
                    <select name="role" id="role">
                        <option value="Supervisor" {% if form_data.role == 'Supervisor' %}selected{% endif %}>Supervisor</option>
                        <option value="Foreman" {% if form_data.role == 'Foreman' %}selected{% endif %}>Foreman</option>
                        <option value="Project Manager" {% if form_data.role == 'Project Manager' %}selected{% endif %}>Project Manager</option>
                    </select>
                </div>
            </div>
            <div class="row">
                <div>
                    <label for="project_id">Project ID</label>
                    <input type="text" name="project_id" id="project_id" value="{{ form_data.project_id | default('') }}" placeholder="e.g., PROJ-123">
                </div>
                <div>
                    <label for="weather">Weather</label>
                    <input type="text" name="weather" id="weather" value="{{ form_data.weather | default('') }}" placeholder="e.g., Sunny, 25°C">
                </div>
            </div>
            <div>
                <label for="milestones">Milestones (comma-separated)</label>
                <input type="text" name="milestones" id="milestones" value="{{ form_data.milestones | default('') }}" placeholder="e.g., Foundation complete, Framing started, Roof installed">
            </div>
            <div>
                <label for="reflection">Reflection</label>
                <textarea name="reflection" id="reflection" placeholder="e.g., Facing delays due to weather and equipment issues.">{{ form_data.reflection | default('') }}</textarea>
            </div>
            <div class="button-row">
                <button type="submit" name="action" value="generate">Generate</button>
            </div>
        </form>

        {% if error %}
        <div class="error">{{ error }}</div>
        {% endif %}

        <div class="output">
            <h3>Checklist</h3>
            <p>{{ output.checklist | join('<br>') | default('') | safe }}</p>
        </div>
        <div class="output">
            <h3>Suggestions</h3>
            <p>{{ output.tips | join('<br>') | default('') | safe }}</p>
        </div>
        <div class="output">
            <h3>Quote</h3>
            <p>{{ output.quote | default('') }}</p>
        </div>
    </div>
</body>
</html>