siddhartharya commited on
Commit
c8aa33a
·
verified ·
1 Parent(s): a2f03c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -20
app.py CHANGED
@@ -246,22 +246,20 @@ def display_bookmarks():
246
  summary = bookmark.get('summary', '')
247
  category = bookmark.get('category', 'Uncategorized')
248
 
249
- # Apply inline styles for dead links
250
  if bookmark.get('dead_link'):
251
- card_style = "border: 2px solid #D32F2F;"
252
- text_style = "color: #D32F2F;"
253
  else:
254
- card_style = "border: 2px solid #4CAF50;"
255
- text_style = "color: #000000;"
256
 
257
  card_html = f'''
258
- <div class="card" style="{card_style}; padding: 10px; margin: 10px; border-radius: 5px;">
259
  <div class="card-content">
260
- <h3 style="{text_style}">{index}. {title} {status}</h3>
261
- <p style="{text_style}"><strong>Category:</strong> {category}</p>
262
- <p style="{text_style}"><strong>URL:</strong> <a href="{url}" target="_blank" style="{text_style}">{url}</a></p>
263
- <p style="{text_style}"><strong>ETag:</strong> {etag}</p>
264
- <p style="{text_style}"><strong>Summary:</strong> {summary}</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