Update app.py
Browse files
app.py
CHANGED
|
@@ -246,22 +246,20 @@ def display_bookmarks():
|
|
| 246 |
summary = bookmark.get('summary', '')
|
| 247 |
category = bookmark.get('category', 'Uncategorized')
|
| 248 |
|
| 249 |
-
#
|
| 250 |
if bookmark.get('dead_link'):
|
| 251 |
-
|
| 252 |
-
text_style = "color: #D32F2F;"
|
| 253 |
else:
|
| 254 |
-
|
| 255 |
-
text_style = "color: #000000;"
|
| 256 |
|
| 257 |
card_html = f'''
|
| 258 |
-
<div class="
|
| 259 |
<div class="card-content">
|
| 260 |
-
<h3
|
| 261 |
-
<p
|
| 262 |
-
<p
|
| 263 |
-
<p
|
| 264 |
-
<p
|
| 265 |
</div>
|
| 266 |
</div>
|
| 267 |
'''
|
|
@@ -453,15 +451,7 @@ Please identify the most relevant bookmarks that match the user's query. Provide
|
|
| 453 |
def build_app():
|
| 454 |
try:
|
| 455 |
logger.info("Building Gradio app")
|
| 456 |
-
with gr.Blocks(theme=gr.themes.Default(), css=""
|
| 457 |
-
.card {
|
| 458 |
-
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
|
| 459 |
-
transition: 0.3s;
|
| 460 |
-
}
|
| 461 |
-
.card:hover {
|
| 462 |
-
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
|
| 463 |
-
}
|
| 464 |
-
""") as demo:
|
| 465 |
# General Overview
|
| 466 |
gr.Markdown("""
|
| 467 |
# 📚 SmartMarks - AI Browser Bookmarks Manager
|
|
|
|
| 246 |
summary = bookmark.get('summary', '')
|
| 247 |
category = bookmark.get('category', 'Uncategorized')
|
| 248 |
|
| 249 |
+
# Assign CSS classes based on bookmark status
|
| 250 |
if bookmark.get('dead_link'):
|
| 251 |
+
card_classes = "card dead-link"
|
|
|
|
| 252 |
else:
|
| 253 |
+
card_classes = "card active-link"
|
|
|
|
| 254 |
|
| 255 |
card_html = f'''
|
| 256 |
+
<div class="{card_classes}" style="padding: 10px; margin: 10px; border-radius: 5px;">
|
| 257 |
<div class="card-content">
|
| 258 |
+
<h3>{index}. {title} {status}</h3>
|
| 259 |
+
<p><strong>Category:</strong> {category}</p>
|
| 260 |
+
<p><strong>URL:</strong> <a href="{url}" target="_blank">{url}</a></p>
|
| 261 |
+
<p><strong>ETag:</strong> {etag}</p>
|
| 262 |
+
<p><strong>Summary:</strong> {summary}</p>
|
| 263 |
</div>
|
| 264 |
</div>
|
| 265 |
'''
|
|
|
|
| 451 |
def build_app():
|
| 452 |
try:
|
| 453 |
logger.info("Building Gradio app")
|
| 454 |
+
with gr.Blocks(theme=gr.themes.Default(), css="app.css") as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 455 |
# General Overview
|
| 456 |
gr.Markdown("""
|
| 457 |
# 📚 SmartMarks - AI Browser Bookmarks Manager
|