youngtsai commited on
Commit
098ecc7
·
1 Parent(s): 92adabb

remove gallery_content

Browse files
Files changed (1) hide show
  1. app.py +27 -32
app.py CHANGED
@@ -1673,45 +1673,40 @@ def get_key_moments_html(key_moments):
1673
  key_moments_html = css
1674
 
1675
  for i, moment in enumerate(key_moments):
1676
- if "suggested_images" in moment:
1677
- images = moment['suggested_images']
1678
- else:
1679
- images = moment['images']
1680
- image_elements = ""
1681
 
1682
- for j, image in enumerate(images):
1683
- current_id = f"img_{i}_{j}"
1684
- prev_id = f"img_{i}_{j-1}" if j-1 >= 0 else f"img_{i}_{len(images)-1}"
1685
- next_id = f"img_{i}_{j+1}" if j+1 < len(images) else f"img_{i}_0"
1686
-
1687
- image_elements += f"""
1688
- <div id="{current_id}" class="gallery__item">
1689
- <a href="#{prev_id}" class="click-zone click-zone-prev">
1690
- <div class="arrow arrow-disabled arrow-prev"> ◀︎ </div>
1691
- </a>
1692
- <a href="#{next_id}" class="click-zone click-zone-next">
1693
- <div class="arrow arrow-next"> ▶︎ </div>
1694
- </a>
1695
- <img src="{image}">
1696
- </div>
1697
- """
1698
-
1699
- gallery_content = f"""
1700
- <div id="gallery-content">
1701
- {image_elements}
1702
- </div>
1703
- """
1704
 
1705
  keywords_html = ' '.join([f'<span class="keyword-label">{keyword}</span>' for keyword in moment['keywords']])
1706
 
1707
 
1708
  key_moments_html += f"""
1709
  <div class="gallery-container" id="gallery-main">
1710
- <div id="gallery"><!-- gallery start -->
1711
- <div id="gallery-container">
1712
- {gallery_content}
1713
- </div>
1714
- </div>
1715
  <div id="text-content">
1716
  <h3>{moment['start']} - {moment['end']}</h3>
1717
  <p><strong>摘要: {moment['text']} </strong></p>
 
1673
  key_moments_html = css
1674
 
1675
  for i, moment in enumerate(key_moments):
1676
+ # if "suggested_images" in moment:
1677
+ # images = moment['suggested_images']
1678
+ # else:
1679
+ # images = moment['images']
1680
+ # image_elements = ""
1681
 
1682
+ # for j, image in enumerate(images):
1683
+ # current_id = f"img_{i}_{j}"
1684
+ # prev_id = f"img_{i}_{j-1}" if j-1 >= 0 else f"img_{i}_{len(images)-1}"
1685
+ # next_id = f"img_{i}_{j+1}" if j+1 < len(images) else f"img_{i}_0"
1686
+
1687
+ # image_elements += f"""
1688
+ # <div id="{current_id}" class="gallery__item">
1689
+ # <a href="#{prev_id}" class="click-zone click-zone-prev">
1690
+ # <div class="arrow arrow-disabled arrow-prev"> ◀︎ </div>
1691
+ # </a>
1692
+ # <a href="#{next_id}" class="click-zone click-zone-next">
1693
+ # <div class="arrow arrow-next"> ▶︎ </div>
1694
+ # </a>
1695
+ # <img src="{image}">
1696
+ # </div>
1697
+ # """
1698
+
1699
+ # gallery_content = f"""
1700
+ # <div id="gallery-content">
1701
+ # {image_elements}
1702
+ # </div>
1703
+ # """
1704
 
1705
  keywords_html = ' '.join([f'<span class="keyword-label">{keyword}</span>' for keyword in moment['keywords']])
1706
 
1707
 
1708
  key_moments_html += f"""
1709
  <div class="gallery-container" id="gallery-main">
 
 
 
 
 
1710
  <div id="text-content">
1711
  <h3>{moment['start']} - {moment['end']}</h3>
1712
  <p><strong>摘要: {moment['text']} </strong></p>