CCockrum commited on
Commit
e4cc465
·
verified ·
1 Parent(s): e8f0d4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -12
app.py CHANGED
@@ -313,18 +313,29 @@ def display_pet_details(pet_id):
313
  col1, col2 = st.columns(2)
314
 
315
  with col1:
316
- st.markdown("### Details")
317
- details = [
318
- f"**Type:** {pet['type']}",
319
- f"**Breed:** {pet['breeds']['primary']}{f' & {pet['breeds']['secondary']}' if pet['breeds']['secondary'] else ''}{' (Mixed)' if pet['breeds']['mixed'] else ''}",
320
- f"**Age:** {pet['age']}",
321
- f"**Gender:** {pet['gender']}",
322
- f"**Size:** {pet['size']}",
323
- f"**Colors:** {', '.join([c for c in [pet['colors']['primary'], pet['colors']['secondary'], pet['colors']['tertiary']] if c])}"
324
- ]
325
-
326
- for detail in details:
327
- st.markdown(detail)
 
 
 
 
 
 
 
 
 
 
 
328
 
329
  with col2:
330
  st.markdown("### Compatibility")
 
313
  col1, col2 = st.columns(2)
314
 
315
  with col1:
316
+ st.markdown("### Details")
317
+ # Fix the breed line
318
+ breed_text = pet['breeds']['primary']
319
+ if pet['breeds']['secondary']:
320
+ breed_text += f" & {pet['breeds']['secondary']}"
321
+ if pet['breeds']['mixed']:
322
+ breed_text += " (Mixed)"
323
+
324
+ details = [
325
+ f"**Type:** {pet['type']}",
326
+ f"**Breed:** {breed_text}",
327
+ f"**Age:** {pet['age']}",
328
+ f"**Gender:** {pet['gender']}",
329
+ f"**Size:** {pet['size']}"
330
+ ]
331
+
332
+ # Fix the colors line as well, to be safe
333
+ colors = [c for c in [pet['colors']['primary'], pet['colors']['secondary'], pet['colors']['tertiary']] if c]
334
+ if colors:
335
+ details.append(f"**Colors:** {', '.join(colors)}")
336
+
337
+ for detail in details:
338
+ st.markdown(detail)
339
 
340
  with col2:
341
  st.markdown("### Compatibility")