Update app.py
Browse files
app.py
CHANGED
@@ -164,17 +164,24 @@ if st.session_state.content_plan:
|
|
164 |
for day in range(10):
|
165 |
current_date = start_date + timedelta(days=day)
|
166 |
with st.expander(f"Day {day+1} - {current_date.strftime('%b %d')}", expanded=True if day==0 else False):
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
|
179 |
# Download button
|
180 |
st.download_button(
|
|
|
164 |
for day in range(10):
|
165 |
current_date = start_date + timedelta(days=day)
|
166 |
with st.expander(f"Day {day+1} - {current_date.strftime('%b %d')}", expanded=True if day==0 else False):
|
167 |
+
# Use .split('\n') instead of f-string splitting
|
168 |
+
plan_lines = st.session_state.content_plan.split('\n')
|
169 |
+
|
170 |
+
# Calculate start index, accounting for potential inconsistent line counts
|
171 |
+
start_index = day * 5
|
172 |
+
if start_index + 4 < len(plan_lines):
|
173 |
+
st.markdown(
|
174 |
+
f"""
|
175 |
+
<div class="day-card">
|
176 |
+
<h3>{plan_lines[start_index] if start_index < len(plan_lines) else 'No Topic'}</h3>
|
177 |
+
<p>π― Objective: {plan_lines[start_index+1] if start_index+1 < len(plan_lines) else 'N/A'}</p>
|
178 |
+
<p>πΉ Format: {plan_lines[start_index+2] if start_index+2 < len(plan_lines) else 'N/A'}</p>
|
179 |
+
<p>π‘ Engagement Strategy: {plan_lines[start_index+3] if start_index+3 < len(plan_lines) else 'N/A'}</p>
|
180 |
+
<p>π Success Metrics: {plan_lines[start_index+4] if start_index+4 < len(plan_lines) else 'N/A'}</p>
|
181 |
+
</div>
|
182 |
+
""",
|
183 |
+
unsafe_allow_html=True
|
184 |
+
)
|
185 |
|
186 |
# Download button
|
187 |
st.download_button(
|