File size: 3,284 Bytes
4f591e5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a87acfa
 
 
 
 
 
 
4f591e5
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
{% extends 'base.html' %}

{% block title %}Home Page{% endblock %}

{% block content %}
<div class="container mt-4">
    <!-- Sidebar with Toggle Button Inside -->
    <div id="sidebar" class="sidebar">
        <!-- Sidebar Toggle Button -->
        <button class="btn btn-primary" id="toggle-sidebar" style="position: absolute; top: 350px; right: -45px; z-index: 999;"></button>

        <!-- Sidebar Content -->
        <div class="sidebar-content">
            <h3 id="countdown-timer" contenteditable="true">5:00</h3> <!-- Starting value -->
            <button class="btn btn-info mt-2 mr-2" id="start-countdown">Start</button>
            <button class="btn btn-danger mt-2" id="stop-countdown">Stop</button>
            <div class="mt-4">
                <label for="draft-text">Draft Text:</label>
                <textarea id="draft-text" class="form-control" rows="8" placeholder="Type your draft here..."></textarea>
            </div>
        </div>
    </div>

    <!-- Main Content: Essay Topic and Essay Content -->
    <div style="margin-left: 30px;"> <!-- Adjust based on sidebar width -->
        <h1 class="center-text">Enter Topic and Essay for Prediction</h1>
        <form method="post" class="mt-4" id="essayForm">
            <div class="mb-3">
                <label for="topic" class="form-label">Essay Topic:</label>
                <input type="text" id="topic" name="topic" class="form-control" autocomplete="off">
            </div>
            <div class="mb-3">
                <label for="essay" class="form-label">Essay Content:</label>
                <textarea style="background-color:rgba(10, 9, 9, 0.5); color:rgb(255, 255, 255); border: 1px solid #100f0f;" id="essay" name="essay" class="form-control" rows="8" autocomplete="off"></textarea>
            </div>
            <div class="btn-center">
                <button type="submit" class="btn btn-primary">Submit</button>
            </div>
            <input type="hidden" id="isempty" value="{{ isempty }}">
        </form>
    </div>

    <!-- Alert Modal -->
    <div class="modal fade" id="alertModal" tabindex="-1" role="dialog" aria-labelledby="alertModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="alertModalLabel">Alert</h5>
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    Please provide both a topic and an essay text.
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">OK</button>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}

{% block extra_scripts %}
<script src="{{ url_for('static', filename='js/home_page.js') }}"></script>
<script>
document.getElementById('essayForm').addEventListener('submit', function(e) {
    // This ensures the form submits properly in all environments
    e.preventDefault();
    this.submit();
});
</script>
{% endblock %}