lanna_lalala;- commited on
Commit
1f8721e
Β·
1 Parent(s): f4da33f

lesson css try

Browse files
Files changed (1) hide show
  1. phase/Student_view/lesson.py +31 -36
phase/Student_view/lesson.py CHANGED
@@ -570,46 +570,41 @@ def _render_lesson():
570
  t_title, t_text = topics[topic_idx]
571
 
572
  st.markdown(f"""
573
- <div class="lesson-card">
574
- <div class="unit-header">
575
- <span class="unit-info">Unit {topic_idx + 1} of {len(topics)}</span>
576
- <div class="read-time">
577
- <span>πŸ•</span>
578
- <span>5-8 min read</span>
579
- </div>
580
  </div>
581
- <div class="lesson-content">
582
- """, unsafe_allow_html=True)
 
 
 
583
 
584
- if t_text:
585
- st.markdown(t_text.strip(), unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
586
  else:
587
- st.info("Content coming soon.")
588
-
589
- st.markdown("</div>", unsafe_allow_html=True)
590
-
591
- if t_text:
592
- takeaways = _extract_takeaways(t_text)
593
- if takeaways:
594
- st.markdown("""
595
- <div class="takeaways-section" style="min-height: 150px;">
596
- <div class="takeaways-header">
597
- <span style="color: #10b981;">●</span>
598
- <span>Key Takeaways</span>
599
- </div>
600
- """, unsafe_allow_html=True)
601
-
602
- for takeaway in takeaways:
603
- st.markdown(f"""
604
- <div class="takeaway-item">
605
- <span class="takeaway-check">βœ“</span>
606
- <span>{takeaway}</span>
607
- </div>
608
- """, unsafe_allow_html=True)
609
-
610
- st.markdown("</div>", unsafe_allow_html=True)
611
 
612
- st.markdown("</div>", unsafe_allow_html=True)
613
 
614
  st.markdown('<div class="nav-buttons">', unsafe_allow_html=True)
615
 
 
570
  t_title, t_text = topics[topic_idx]
571
 
572
  st.markdown(f"""
573
+ <div class="lesson-card">
574
+ <div class="unit-header">
575
+ <span class="unit-info">Unit {topic_idx + 1} of {len(topics)}</span>
576
+ <div class="read-time">
577
+ <span>πŸ•</span>
578
+ <span>5-8 min read</span>
 
579
  </div>
580
+ </div>
581
+ <div class="lesson-content">
582
+ {t_text.strip() if t_text else "<p>Content coming soon.</p>"}
583
+ </div>
584
+ """, unsafe_allow_html=True)
585
 
586
+ # Conditionally render takeaways inside the card
587
+ if t_text:
588
+ takeaways = _extract_takeaways(t_text)
589
+ if takeaways:
590
+ st.markdown(f"""
591
+ <div class="takeaways-section">
592
+ <div class="takeaways-header">
593
+ <span style="color: #10b981;">●</span>
594
+ <span>Key Takeaways</span>
595
+ </div>
596
+ {''.join([
597
+ f'<div class="takeaway-item"><span class="takeaway-check">βœ“</span><span>{tk}</span></div>'
598
+ for tk in takeaways
599
+ ])}
600
+ </div>
601
+ </div> <!-- Closing lesson-card -->
602
+ """, unsafe_allow_html=True)
603
  else:
604
+ st.markdown("</div>", unsafe_allow_html=True) # Close .lesson-card
605
+ else:
606
+ st.markdown("</div>", unsafe_allow_html=True) # Close .lesson-card if no takeaways
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
 
 
608
 
609
  st.markdown('<div class="nav-buttons">', unsafe_allow_html=True)
610