Spaces:
Running
Running
Update templates/index.html
Browse files- templates/index.html +44 -43
templates/index.html
CHANGED
@@ -1,44 +1,45 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
-
<html lang="en">
|
3 |
-
<head>
|
4 |
-
<meta charset="UTF-8">
|
5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>Knowledge Assistant</title>
|
7 |
-
<link rel="stylesheet" href="static/style.css">
|
8 |
-
<script src="static/script.js" defer></script>
|
9 |
-
</head>
|
10 |
-
<body>
|
11 |
-
<div class="container">
|
12 |
-
<h1>Enter Details</h1>
|
13 |
-
<form action="/" method="POST">
|
14 |
-
<label for="user_text">Enter Your Text: </label>
|
15 |
-
<textarea name="user_text" rows="4" cols="50" required>{{ user_text if user_text else '' }}</textarea>
|
16 |
-
<
|
17 |
-
|
18 |
-
|
19 |
-
<
|
20 |
-
|
21 |
-
<option value="
|
22 |
-
<option value="
|
23 |
-
<option value="
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
<
|
29 |
-
<
|
30 |
-
<
|
31 |
-
<
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
<
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
</
|
|
|
44 |
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Knowledge Assistant</title>
|
7 |
+
<link rel="stylesheet" href="static/style.css">
|
8 |
+
<script src="static/script.js" defer></script>
|
9 |
+
</head>
|
10 |
+
<body>
|
11 |
+
<div class="container">
|
12 |
+
<h1>Enter Details</h1>
|
13 |
+
<form action="/" method="POST">
|
14 |
+
<label for="user_text">Enter Your Text: </label>
|
15 |
+
<textarea name="user_text" maxlength="5000" rows="4" cols="50" oninput="updateCount()" required>{{ user_text if user_text else '' }}</textarea>
|
16 |
+
<p id="charCount">5000 characters remaining</p>
|
17 |
+
<br><br>
|
18 |
+
|
19 |
+
<label for="tasks">Choose a Task:</label>
|
20 |
+
<select name="tasks" required onchange="toggleElements()">
|
21 |
+
<option value="none">--Select--</option>
|
22 |
+
<option value="summarization" {% if task == 'summarization' %}selected{% endif %}>Summarize Text</option>
|
23 |
+
<option value="keywords" {% if task == 'keywords' %}selected{% endif %}>Get Keywords</option>
|
24 |
+
<option value="Q&A" {% if task == 'Q&A' %}selected{% endif %}>Ask Questions</option>
|
25 |
+
</select>
|
26 |
+
<br><br>
|
27 |
+
|
28 |
+
<label id="number_label" for="user_number" style="display: none;"></label>
|
29 |
+
<input type="number" id="number" name="user_number" style="display: none;">
|
30 |
+
<label id="question_label" for="user_question" style="display: none;">Enter Your Question:</label>
|
31 |
+
<input type="text" id="question" name="user_question" style="display: none;">
|
32 |
+
<br><br>
|
33 |
+
|
34 |
+
<button type="submit" id="submit_btn" disabled>Submit</button>
|
35 |
+
</form>
|
36 |
+
|
37 |
+
{% if text %}
|
38 |
+
<div class="result-section">
|
39 |
+
<h2>Result for {{ task }}:</h2>
|
40 |
+
<p>{{ text }}</p>
|
41 |
+
</div>
|
42 |
+
{% endif %}
|
43 |
+
</div>
|
44 |
+
</body>
|
45 |
</html>
|