| """ |
| Capstone view component for SkillSync |
| """ |
|
|
| import gradio as gr |
| from datetime import datetime |
|
|
| def create_capstone_view(course_data, progress_manager): |
| """Create the capstone project view""" |
| |
| capstone = course_data['capstone'] |
| |
| gr.Markdown(f"## {capstone['title']}") |
| gr.Markdown(f"**Estimated Time:** {capstone['time_estimate']}") |
| gr.Markdown(capstone['description']) |
| |
| with gr.Accordion("π Requirements", open=True): |
| for i, req in enumerate(capstone['requirements']): |
| gr.Markdown(f"{i+1}. {req}") |
| |
| with gr.Accordion("π¦ Deliverables", open=True): |
| for item in capstone['deliverables']: |
| gr.Markdown(f"- {item}") |
| |
| gr.Markdown("### π Submit Your Project") |
| |
| with gr.Row(): |
| with gr.Column(): |
| project_title = gr.Textbox( |
| label="Project Title", |
| placeholder="Enter your project title" |
| ) |
| |
| project_description = gr.Textbox( |
| label="Project Description", |
| lines=5, |
| placeholder="Describe your project, approach, and key features" |
| ) |
| |
| project_url = gr.Textbox( |
| label="Demo URL (Optional)", |
| placeholder="https://your-demo-url.com" |
| ) |
| |
| project_file = gr.File( |
| label="Upload Project Files", |
| file_types=[".zip", ".pdf", ".ipynb"] |
| ) |
| |
| submit_btn = gr.Button("Submit Project", variant="primary") |
| submission_status = gr.Markdown() |
| |
| def submit_project(title, desc, url, file): |
| success, message = progress_manager.submit_capstone(title, desc, url, file) |
| |
| if success: |
| return f""" |
| β
**Project Submitted Successfully!** |
| |
| **Title:** {title} |
| |
| **Submitted at:** {progress_manager.progress['capstone_details']['submitted_at']} |
| |
| Your project will be reviewed within 5-7 business days. You will receive feedback via email. |
| """ |
| else: |
| return f"β {message}" |
| |
| submit_btn.click( |
| fn=submit_project, |
| inputs=[project_title, project_description, project_url, project_file], |
| outputs=[submission_status] |
| ) |
|
|