yashm commited on
Commit
c33529b
·
verified ·
1 Parent(s): 0f008f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -7
app.py CHANGED
@@ -20,6 +20,28 @@ templates = {
20
  {"title": "Budget", "content": ["Estimated Costs", "Resource Allocation", "Justification"]},
21
  {"title": "Conclusion", "content": ["Summary of Key Points", "Reiteration of Research Importance", "Next Steps"]},
22
  {"title": "Questions and Discussion", "content": ["Anticipated Questions", "Potential Answers", "Further Clarifications"]}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  ]
24
  }
25
 
@@ -53,9 +75,21 @@ def create_presentation(title_slide_info, sections):
53
  prs.save(filename)
54
  return filename
55
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  # Streamlit UI setup
57
  st.sidebar.title('Presentation Settings')
58
- presentation_type = st.sidebar.selectbox('Select Presentation Type', ['Research Presentation', 'Proposal Defense'])
59
  selected_template = templates[presentation_type]
60
 
61
  # Title slide configuration with expander
@@ -76,9 +110,7 @@ if 'sections' not in st.session_state:
76
 
77
  # Option to add more sections dynamically
78
  if st.sidebar.button("Add More Section"):
79
- new_section_title = f"New Section {st.session_state.section_counter}"
80
- st.session_state.sections[new_section_title] = OrderedDict({"New Subsection": []})
81
- st.session_state.section_counter += 1
82
 
83
  # Main page for sections and subsections configuration
84
  st.title('Customize Your Presentation')
@@ -100,9 +132,7 @@ for section_title, subsections in list(st.session_state.sections.items()):
100
 
101
  # Add new subsection to the current section
102
  if st.button(f"Add Subsection to {section_title}", key=f"add_subsection_{section_title}"):
103
- new_subsection_title = st.text_input(f"New Subsection Title for {section_title}", "New Subsection", key=f"new_subsection_{section_title}")
104
- if new_subsection_title and new_subsection_title not in st.session_state.sections[section_title]:
105
- st.session_state.sections[section_title][new_subsection_title] = []
106
 
107
  # Generate and download presentation
108
  if st.button('Generate Presentation'):
 
20
  {"title": "Budget", "content": ["Estimated Costs", "Resource Allocation", "Justification"]},
21
  {"title": "Conclusion", "content": ["Summary of Key Points", "Reiteration of Research Importance", "Next Steps"]},
22
  {"title": "Questions and Discussion", "content": ["Anticipated Questions", "Potential Answers", "Further Clarifications"]}
23
+ ],
24
+ 'Project Update': [
25
+ {"title": "Overview", "content": ["Project Background", "Current Status", "Objectives"]},
26
+ {"title": "Progress", "content": ["Tasks Completed", "Milestones Achieved", "Challenges Faced"]},
27
+ {"title": "Next Steps", "content": ["Upcoming Tasks", "Milestones", "Deadlines"]},
28
+ {"title": "Risks and Issues", "content": ["Current Risks", "Mitigation Strategies", "Dependencies"]},
29
+ {"title": "Summary", "content": ["Key Takeaways", "Action Items", "Follow-up Dates"]}
30
+ ],
31
+ 'Thesis Defense': [
32
+ {"title": "Introduction", "content": ["Research Topic", "Research Questions", "Hypotheses"]},
33
+ {"title": "Methodology", "content": ["Research Design", "Data Collection Methods", "Data Analysis Procedures"]},
34
+ {"title": "Results", "content": ["Key Findings", "Data Interpretation", "Implications"]},
35
+ {"title": "Conclusion", "content": ["Summary of Findings", "Research Contributions", "Future Research"]},
36
+ {"title": "Questions and Discussion", "content": ["Common Questions", "Clarifications", "Further Explanations"]}
37
+ ],
38
+ 'Business Pitch': [
39
+ {"title": "Company Overview", "content": ["Company Background", "Mission and Vision", "Team"]},
40
+ {"title": "Market Analysis", "content": ["Industry Overview", "Target Market", "Competitor Analysis"]},
41
+ {"title": "Product/Service", "content": ["Product Description", "Unique Selling Points", "Value Proposition"]},
42
+ {"title": "Business Model", "content": ["Revenue Streams", "Pricing Strategy", "Sales Channels"]},
43
+ {"title": "Financial Plan", "content": ["Revenue Projections", "Cost Structure", "Funding Requirements"]},
44
+ {"title": "Conclusion", "content": ["Summary", "Call to Action", "Contact Information"]}
45
  ]
46
  }
47
 
 
75
  prs.save(filename)
76
  return filename
77
 
78
+ # Function to handle dynamic section addition
79
+ def add_new_section(section_counter):
80
+ new_section_title = f"Section {section_counter}"
81
+ st.session_state.sections[new_section_title] = OrderedDict({"Subsection": []})
82
+ st.session_state.section_counter += 1
83
+
84
+ # Function to handle dynamic subsection addition
85
+ def add_new_subsection(section_title):
86
+ new_subsection_title = f"Subsection {len(st.session_state.sections[section_title]) + 1}"
87
+ if new_subsection_title not in st.session_state.sections[section_title]:
88
+ st.session_state.sections[section_title][new_subsection_title] = []
89
+
90
  # Streamlit UI setup
91
  st.sidebar.title('Presentation Settings')
92
+ presentation_type = st.sidebar.selectbox('Select Presentation Type', list(templates.keys()))
93
  selected_template = templates[presentation_type]
94
 
95
  # Title slide configuration with expander
 
110
 
111
  # Option to add more sections dynamically
112
  if st.sidebar.button("Add More Section"):
113
+ add_new_section(st.session_state.section_counter)
 
 
114
 
115
  # Main page for sections and subsections configuration
116
  st.title('Customize Your Presentation')
 
132
 
133
  # Add new subsection to the current section
134
  if st.button(f"Add Subsection to {section_title}", key=f"add_subsection_{section_title}"):
135
+ add_new_subsection(section_title)
 
 
136
 
137
  # Generate and download presentation
138
  if st.button('Generate Presentation'):