File size: 3,847 Bytes
4a7a70e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html>
<head>
    <title>Upload Documents CSV</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
    <style>
        .upload-container {
            max-width: 600px;
            margin: 50px auto;
            padding: 30px;
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
        }
        
        .upload-form {
            text-align: center;
        }
        
        .file-input-wrapper {
            margin: 30px 0;
            padding: 20px;
            border: 2px dashed #ddd;
            border-radius: 10px;
            background-color: #f9f9f9;
        }
        
        .file-input {
            margin: 10px 0;
        }
        
        .upload-btn {
            background-color: #28a745;
            color: white;
            padding: 12px 30px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            margin: 20px 10px;
        }
        
        .upload-btn:hover {
            background-color: #218838;
        }
        
        .back-btn {
            background-color: #6c757d;
            color: white;
            padding: 12px 30px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            text-decoration: none;
            display: inline-block;
            margin: 20px 10px;
        }
        
        .back-btn:hover {
            background-color: #5a6268;
        }
        
        .instructions {
            background-color: #e9ecef;
            padding: 20px;
            border-radius: 5px;
            margin: 20px 0;
            text-align: left;
        }
        
        .instructions h3 {
            margin-top: 0;
            color: #495057;
        }
        
        .instructions ul {
            margin: 10px 0;
            padding-left: 20px;
        }
        
        .warning {
            background-color: #fff3cd;
            border: 1px solid #ffeaa7;
            padding: 15px;
            border-radius: 5px;
            margin: 20px 0;
        }
    </style>
</head>
<body>
    <div class="upload-container">
        <h1>Upload Documents CSV File</h1>
        
        <div class="warning">
            <strong>Alternative Upload Method:</strong> Use this if you're having permission issues with the HF Spaces file upload interface.
        </div>
        
        <div class="instructions">
            <h3>File Requirements:</h3>
            <ul>
                <li>File must be in CSV format</li>
                <li>Required columns: filename, note, description, mrn</li>
                <li>Each row represents one document to be evaluated</li>
                <li>Use UTF-8 encoding for best compatibility</li>
            </ul>
        </div>
        
        <form method="POST" enctype="multipart/form-data" class="upload-form">
            <div class="file-input-wrapper">
                <h3>Select your documents.csv file:</h3>
                <div class="file-input">
                    <input type="file" name="file" accept=".csv" required>
                </div>
                <p><em>Only CSV files are accepted</em></p>
            </div>
            
            <div class="form-buttons">
                <button type="submit" class="upload-btn">Upload Documents</button>
                <a href="{{ url_for('index') }}" class="back-btn">Back to Home</a>
            </div>
        </form>
        
        {% with messages = get_flashed_messages() %}
            {% if messages %}
                {% for message in messages %}
                    <div class="alert">{{ message }}</div>
                {% endfor %}
            {% endif %}
        {% endwith %}
    </div>
</body>
</html>