Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +14 -14
templates/index.html
CHANGED
|
@@ -10,18 +10,18 @@
|
|
| 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 id="user_text" name="user_text" maxlength="5000" rows="4" cols="50" required
|
| 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
|
| 21 |
<option value="none">--Select--</option>
|
| 22 |
-
<option value="summarization">Summarize Text</option>
|
| 23 |
-
<option value="keywords">Get Keywords</option>
|
| 24 |
-
<option value="Q&A">Ask Questions</option>
|
| 25 |
</select>
|
| 26 |
<br><br>
|
| 27 |
|
|
@@ -32,17 +32,17 @@
|
|
| 32 |
<br><br>
|
| 33 |
|
| 34 |
<button type="submit" id="submit_btn" disabled>Submit</button>
|
|
|
|
|
|
|
|
|
|
| 35 |
</form>
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
<
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
<div id="result" class="result-section" style="display: none;">
|
| 43 |
-
<h2>Result:</h2>
|
| 44 |
-
<p id="result_text"></p>
|
| 45 |
</div>
|
|
|
|
| 46 |
</div>
|
| 47 |
</body>
|
| 48 |
</html>
|
|
|
|
| 10 |
<body>
|
| 11 |
<div class="container">
|
| 12 |
<h1>Enter Details</h1>
|
| 13 |
+
<form id="textForm" action="/" method="POST">
|
| 14 |
<label for="user_text">Enter Your Text: </label>
|
| 15 |
+
<textarea id="user_text" name="user_text" maxlength="5000" rows="4" cols="50" 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>
|
| 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 |
|
|
|
|
| 32 |
<br><br>
|
| 33 |
|
| 34 |
<button type="submit" id="submit_btn" disabled>Submit</button>
|
| 35 |
+
|
| 36 |
+
<!-- Loading Spinner -->
|
| 37 |
+
<div id="loading" class="loading-spinner" style="display: none;"></div>
|
| 38 |
</form>
|
| 39 |
|
| 40 |
+
{% if text %}
|
| 41 |
+
<div class="result-section">
|
| 42 |
+
<h2>Result for {{ task }}:</h2>
|
| 43 |
+
<p>{{ text }}</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
</div>
|
| 45 |
+
{% endif %}
|
| 46 |
</div>
|
| 47 |
</body>
|
| 48 |
</html>
|