lokeshloki143 commited on
Commit
1275bdd
·
verified ·
1 Parent(s): ced5f86

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +43 -83
templates/index.html CHANGED
@@ -22,49 +22,16 @@
22
  border-radius: 8px;
23
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
24
  }
25
- .row {
26
- display: flex;
27
- justify-content: space-between;
28
- margin-bottom: 15px;
29
  }
30
- .row div {
31
- flex: 1;
32
- margin-right: 10px;
 
33
  }
34
- .row div:last-child {
35
- margin-right: 0;
36
- }
37
- label {
38
- display: block;
39
- margin-bottom: 5px;
40
- font-weight: bold;
41
- }
42
- select, input[type="text"], textarea {
43
- width: 100%;
44
- padding: 8px;
45
- border: 1px solid #ccc;
46
- border-radius: 4px;
47
- box-sizing: border-box;
48
- }
49
- textarea {
50
- height: 80px;
51
- resize: vertical;
52
- }
53
- .button-row {
54
- display: flex;
55
- justify-content: space-between;
56
- margin-top: 10px;
57
- }
58
- button {
59
- padding: 10px 20px;
60
- background-color: #555;
61
- color: white;
62
- border: none;
63
- border-radius: 4px;
64
- cursor: pointer;
65
- }
66
- button:hover {
67
- background-color: #666;
68
  }
69
  .output {
70
  margin-top: 20px;
@@ -73,56 +40,49 @@
73
  border-radius: 4px;
74
  background-color: #f9f9f9;
75
  }
 
 
 
 
 
 
 
 
 
76
  </style>
77
  </head>
78
  <body>
79
  <div class="container">
80
  <h1>Construction Supervisor AI Coach</h1>
81
- <form method="POST">
82
- <div class="row">
83
- <div>
84
- <label for="role">Role</label>
85
- <select name="role" id="role">
86
- <option value="Supervisor" {% if role == "Supervisor" %}selected{% endif %}>Supervisor</option>
87
- <option value="Foreman" {% if role == "Foreman" %}selected{% endif %}>Foreman</option>
88
- <option value="Project Manager" {% if role == "Project Manager" %}selected{% endif %}>Project Manager</option>
89
- </select>
90
- </div>
91
- <div>
92
- <label for="project_id">Project ID</label>
93
- <input type="text" name="project_id" id="project_id" value="{{ project_id }}" placeholder="e.g., PROJ-123">
94
- </div>
95
- </div>
96
- <div>
97
- <label for="milestones">Milestones (comma-separated)</label>
98
- <input type="text" name="milestones" id="milestones" value="{{ milestones }}" placeholder="e.g., Foundation complete, Framing started, Roof installed">
 
 
99
  </div>
100
- <div>
101
- <label for="reflection">Reflection</label>
102
- <textarea name="reflection" id="reflection" placeholder="e.g., Facing delays due to weather and equipment issues.">{{ reflection }}</textarea>
103
  </div>
104
- <div class="button-row">
105
- <button type="submit" name="action" value="generate">Generate</button>
106
- <button type="submit" name="action" value="clear">Clear</button>
107
- <button type="submit" name="action" value="process_salesforce">Process Salesforce Data</button>
108
  </div>
109
- </form>
110
-
111
- <div class="output">
112
- <h3>Checklist</h3>
113
- <p>{{ checklist }}</p>
114
- </div>
115
- <div class="output">
116
- <h3>Suggestions</h3>
117
- <p>{{ suggestions }}</p>
118
- </div>
119
- <div class="output">
120
- <h3>Quote</h3>
121
- <p>{{ quote }}</p>
122
- </div>
123
- <div class="output">
124
- <h3>Salesforce Processing Result</h3>
125
- <p>{{ sf_result }}</p>
126
  </div>
127
  </div>
128
  </body>
 
22
  border-radius: 8px;
23
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
24
  }
25
+ .section {
26
+ margin-bottom: 20px;
 
 
27
  }
28
+ .section h2 {
29
+ color: #555;
30
+ border-bottom: 1px solid #ccc;
31
+ padding-bottom: 5px;
32
  }
33
+ .section p {
34
+ margin: 5px 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
  .output {
37
  margin-top: 20px;
 
40
  border-radius: 4px;
41
  background-color: #f9f9f9;
42
  }
43
+ .output p:empty::before {
44
+ content: "No data available";
45
+ color: #888;
46
+ }
47
+ .error {
48
+ color: red;
49
+ margin-top: 10px;
50
+ text-align: center;
51
+ }
52
  </style>
53
  </head>
54
  <body>
55
  <div class="container">
56
  <h1>Construction Supervisor AI Coach</h1>
57
+
58
+ {% if error %}
59
+ <div class="error">{{ error }}</div>
60
+ {% endif %}
61
+
62
+ <div class="section">
63
+ <h2>Input Data from Salesforce</h2>
64
+ <p><strong>Supervisor ID:</strong> {{ form_data.supervisor_id | default('') }}</p>
65
+ <p><strong>Role:</strong> {{ form_data.role | default('') }}</p>
66
+ <p><strong>Project ID:</strong> {{ form_data.project_id | default('') }}</p>
67
+ <p><strong>Weather:</strong> {{ form_data.weather | default('') }}</p>
68
+ <p><strong>Milestones:</strong> {{ form_data.milestones | join(', ') | default('') }}</p>
69
+ <p><strong>Reflection:</strong> {{ form_data.reflection | default('') }}</p>
70
+ </div>
71
+
72
+ <div class="section">
73
+ <h2>Generated Output</h2>
74
+ <div class="output">
75
+ <h3>Checklist</h3>
76
+ <p>{{ output.checklist | join('<br>') | default('') | safe }}</p>
77
  </div>
78
+ <div class="output">
79
+ <h3>Suggestions</h3>
80
+ <p>{{ output.tips | join('<br>') | default('') | safe }}</p>
81
  </div>
82
+ <div class="output">
83
+ <h3>Quote</h3>
84
+ <p>{{ output.quote | default('') }}</p>
 
85
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  </div>
87
  </div>
88
  </body>