JSenkCC commited on
Commit
d1403b6
Β·
verified Β·
1 Parent(s): 590bc63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -7
app.py CHANGED
@@ -194,12 +194,12 @@ def workspace_page():
194
  def project_view_page():
195
  # Sidebar with logout and return buttons
196
  st.sidebar.title(f"Project: {st.session_state.current_project}")
197
- if st.sidebar.button("Back to Workspace"):
198
- st.session_state.page = "workspace"
199
- if st.sidebar.button("Log Out"):
200
  st.session_state.authenticated = False
201
  st.session_state.username = None
202
  st.session_state.page = "login"
 
 
203
 
204
  # Display project file structure
205
  st.subheader(f"Project: {st.session_state.current_project}")
@@ -207,13 +207,22 @@ def project_view_page():
207
  project_folder = os.path.join(user_folder, st.session_state.current_project)
208
 
209
  st.write("File structure:")
 
210
  for root, dirs, files in os.walk(project_folder):
211
  level = root.replace(project_folder, "").count(os.sep)
212
  indent = " " * 4 * level
213
- st.text(f"{indent}{os.path.basename(root)}/")
214
- sub_indent = " " * 4 * (level + 1)
215
- for file in files:
216
- st.text(f"{sub_indent}{file}")
 
 
 
 
 
 
 
 
217
 
218
 
219
  if __name__ == "__main__":
 
194
  def project_view_page():
195
  # Sidebar with logout and return buttons
196
  st.sidebar.title(f"Project: {st.session_state.current_project}")
197
+ if st.sidebar.button("Log Out"):
 
 
198
  st.session_state.authenticated = False
199
  st.session_state.username = None
200
  st.session_state.page = "login"
201
+ if st.sidebar.button("Back to Workspace"):
202
+ st.session_state.page = "workspace"
203
 
204
  # Display project file structure
205
  st.subheader(f"Project: {st.session_state.current_project}")
 
207
  project_folder = os.path.join(user_folder, st.session_state.current_project)
208
 
209
  st.write("File structure:")
210
+
211
  for root, dirs, files in os.walk(project_folder):
212
  level = root.replace(project_folder, "").count(os.sep)
213
  indent = " " * 4 * level
214
+
215
+ # Display the folder name
216
+ if level == 0:
217
+ st.write(f"πŸ“‚ {os.path.basename(root)}")
218
+ else:
219
+ with st.expander(f"{indent}πŸ“‚ {os.path.basename(root)}"):
220
+ sub_indent = " " * 4 * (level + 1)
221
+
222
+ # List files in the folder
223
+ for file in files:
224
+ st.write(f"{sub_indent}πŸ“„ {file}")
225
+
226
 
227
 
228
  if __name__ == "__main__":