File size: 4,697 Bytes
b51fd38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
147
148
149
150
151
152
153
154
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Responsive Layout</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f0f0f0;
        }

        .dropdown-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: center;
            background-color: #ccc;
            padding: 10px;
        }

        .dropdown {
            flex: 1;
            margin: 5px;
        }

        .image-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: center;
            padding: 20px;
            min-height: calc(100vh - 60px); /* 60px is the height of the dropdown container */
        }

        .image-box {
            flex: 0 0 calc(50% - 20px);
            max-width: calc(50% - 20px);
            margin: 10px;
            overflow: auto;
            max-height: calc(100vh - 100px); /* Adjust as needed */
        }

        .image-box img,
        .image-box .data-frame {
            max-width: 100%;
            height: auto;
            display: block;
        }

        .column-container {
            display: flex;
            background-color: #333;
        }

        .column {
            flex: 1;
            padding: 20px;
        }

        .column a {
            display: block;
            text-align: center;
            padding: 10px;
            text-decoration: none;
            color: #fff;
            font-weight: bold;
        }

        /* Add styles for the data frame */
        .data-frame {
            /* Add your styles for the data frame here */
            /* For example: */
            width: 100%;
            height: 100%;
            overflow: auto;
            white-space: nowrap; /* Prevent line breaks */
        }

        @media only screen and (max-width: 600px) {
            /* Adjust styles for smaller screens */
            .dropdown {
                flex: 100%;
            }

            .image-box {
                flex: 0 0 100%;
                max-width: 100%;
            }
        }
    </style>
</head>
<body>
    <div class="dropdown-container">
        <div class="dropdown">
            <label for="docId">DocID:</label>
            <select id="docId">
                <option value="" disabled selected>Select DocID</option>
                <!-- Add your DocID options dynamically using JavaScript -->
            </select>
        </div>
        <div class="dropdown">
            <label for="pageNumber">Page Number:</label>
            <select id="pageNumber">
                <option value="" disabled selected>Select Page Number</option>
                <!-- Add your Page Number options dynamically using JavaScript -->
            </select>
        </div>
    </div>
    <div class="image-container">
        <div class="image-box">
            <img src="{{ url_for('static', filename='upload_input/tmp.png') }}" alt="Document">
        </div>
        <div class="image-box">
            {{ data.to_html(classes='data-frame', render_links=True, escape=False) | safe }}
        </div>
    </div>

    <!-- Include your JavaScript for fetching dropdown options and updating them here -->
    <script>
        // Example JavaScript for fetching dropdown options from API
        // Replace this with your actual API logic

        // Fetch DocID options
        fetch('your_doc_id_api_url')
            .then(response => response.json())
            .then(data => {
                const docIdSelect = document.getElementById('docId');
                data.forEach(option => {
                    const optionElement = document.createElement('option');
                    optionElement.value = option.value;
                    optionElement.textContent = option.label;
                    docIdSelect.appendChild(optionElement);
                });
            });

        // Fetch Page Number options
        fetch('your_page_number_api_url')
            .then(response => response.json())
            .then(data => {
                const pageNumberSelect = document.getElementById('pageNumber');
                data.forEach(option => {
                    const optionElement = document.createElement('option');
                    optionElement.value = option.value;
                    optionElement.textContent = option.label;
                    pageNumberSelect.appendChild(optionElement);
                });
            });
    </script>
</body>
</html>