Spaces:
Running
Running
Improve UI with black background for metadata and content headers
Browse files
app.py
CHANGED
@@ -1155,24 +1155,19 @@ with main_tab1:
|
|
1155 |
|
1156 |
# Document results will be shown in the right column
|
1157 |
with right_col:
|
1158 |
-
# Initial placeholder for the document title/heading
|
1159 |
-
st.markdown(f"## Document: {result.get('file_name', uploaded_file.name)}")
|
1160 |
|
1161 |
-
#
|
1162 |
-
st.
|
1163 |
|
1164 |
-
#
|
1165 |
-
|
1166 |
-
|
1167 |
-
# Create metadata card with clean styling
|
1168 |
-
metadata_html = '<div class="metadata-card" style="background:#f8f9fa; border:1px solid #e0e0e0; border-radius:4px; padding:15px; margin-bottom:20px;">'
|
1169 |
|
1170 |
# File info
|
1171 |
metadata_html += f'<p><strong>File Name:</strong> {result.get("file_name", uploaded_file.name)}</p>'
|
1172 |
|
1173 |
-
# Info about limited pages
|
1174 |
if 'limited_pages' in result:
|
1175 |
-
metadata_html += f'<p style="background:#
|
1176 |
|
1177 |
# Languages
|
1178 |
if 'languages' in result:
|
@@ -1195,8 +1190,11 @@ with main_tab1:
|
|
1195 |
# Render the metadata HTML
|
1196 |
st.markdown(metadata_html, unsafe_allow_html=True)
|
1197 |
|
|
|
|
|
|
|
1198 |
# Start document content div with consistent styling class
|
1199 |
-
st.markdown('<div class="document-content">', unsafe_allow_html=True)
|
1200 |
if 'ocr_contents' in result:
|
1201 |
# Check for has_images in the result
|
1202 |
has_images = result.get('has_images', False)
|
|
|
1155 |
|
1156 |
# Document results will be shown in the right column
|
1157 |
with right_col:
|
|
|
|
|
1158 |
|
1159 |
+
# Add Document Metadata section - use direct HTML with black background and white text
|
1160 |
+
st.markdown('<h3 style="margin-bottom:0; padding-bottom:0; color:#ffffff; background-color:#212121; padding:10px; border-radius:4px 4px 0 0;">Document Metadata</h3>', unsafe_allow_html=True)
|
1161 |
|
1162 |
+
# Create metadata card with clean styling - black background with white text
|
1163 |
+
metadata_html = '<div class="metadata-card" style="background:#212121; color:#ffffff; border:1px solid #333333; border-radius:0 0 4px 4px; padding:15px; margin-bottom:20px;">'
|
|
|
|
|
|
|
1164 |
|
1165 |
# File info
|
1166 |
metadata_html += f'<p><strong>File Name:</strong> {result.get("file_name", uploaded_file.name)}</p>'
|
1167 |
|
1168 |
+
# Info about limited pages - dark theme
|
1169 |
if 'limited_pages' in result:
|
1170 |
+
metadata_html += f'<p style="background:#37474f; padding:8px; border-radius:4px; color:#e0f7fa;"><strong>Pages:</strong> {result["limited_pages"]["processed"]} of {result["limited_pages"]["total"]} processed</p>'
|
1171 |
|
1172 |
# Languages
|
1173 |
if 'languages' in result:
|
|
|
1190 |
# Render the metadata HTML
|
1191 |
st.markdown(metadata_html, unsafe_allow_html=True)
|
1192 |
|
1193 |
+
# Add content section heading - black background to match metadata
|
1194 |
+
st.markdown('<h3 style="margin-top:20px; margin-bottom:0; padding-bottom:0; color:#ffffff; background-color:#212121; padding:10px; border-radius:4px;">Document Content</h3>', unsafe_allow_html=True)
|
1195 |
+
|
1196 |
# Start document content div with consistent styling class
|
1197 |
+
st.markdown('<div class="document-content" style="margin-top:10px;">', unsafe_allow_html=True)
|
1198 |
if 'ocr_contents' in result:
|
1199 |
# Check for has_images in the result
|
1200 |
has_images = result.get('has_images', False)
|