Skip to content

Commit 9855509

Browse files
committed
feat: show collaborations in projects dashboard and more info
1 parent 325dbae commit 9855509

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

backend/podium/routers/projects.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def get_projects(
1717
current_user: Annotated[CurrentUser, Depends(get_current_user)],
1818
) -> list[PrivateProject]:
1919
"""
20-
Get the current user's projects.
20+
Get the current user's projects and projects they are collaborating on.
2121
"""
2222

2323
user_id = db.user.get_user_record_id_by_email(current_user.email)
@@ -29,7 +29,9 @@ def get_projects(
2929
for project in [
3030
db.projects.get(project_id)
3131
for project_id in db.users.get(user_id)["fields"].get("projects", [])
32-
]
32+
] +
33+
[db.projects.get(project_id)
34+
for project_id in db.users.get(user_id)["fields"].get("collaborations", [])]
3335
]
3436
return projects
3537

frontend/src/lib/components/Collapse.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
</div>
6565
<!-- <div class="collapse-content" onmousedown={handleFocusIn} role="button"> -->
6666
<!-- <div class="collapse-content" onfocusin={handleFocusIn} onblur={handleFocusOut} role="button" tabindex="0"> -->
67-
<div class="collapse-content" role="button" tabindex="0">
67+
<div class="collapse-content overflow-x-auto" role="button" tabindex="0">
6868
{@render children?.()}
6969
</div>
7070
</div>

frontend/src/lib/components/UpdateProject.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
await ProjectsService.updateProjectProjectsProjectIdPut({
9898
path: { project_id: chosenProject.id },
9999
body: project,
100-
throwOnError: true,
100+
throwOnError: true,
101101
});
102102
toast("Project updated successfully");
103103
// Reset the fields
@@ -130,6 +130,9 @@
130130
<label class="form-control">
131131
<div class="label">
132132
<span class="label-text text-primary">Choose a project to update</span>
133+
<span class="label-text-alt">
134+
This will only show projects you own
135+
</span>
133136
</div>
134137
<select
135138
bind:value={chosenProject}

frontend/src/routes/projects/+page.svelte

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,34 @@ import Collapse from "$lib/components/Collapse.svelte";
1717
<thead>
1818
<tr>
1919
<th>Project Name</th>
20-
<th>Description</th>
2120
<th>Join Code</th>
21+
<th>Description</th>
22+
<th>Repository</th>
23+
<th>Demo</th>
2224
</tr>
2325
</thead>
2426
<tbody>
2527
{#each data.projects as project}
2628
<tr>
2729
<td>{project.name}</td>
28-
<td>{project.description}</td>
2930
<td
3031
><a
3132
href={`/projects/?join_code=${project.join_code}`}
3233
data-sveltekit-noscroll>{project.join_code}</a
3334
></td
3435
>
36+
<td>{project.description}</td>
37+
<td
38+
><a
39+
href={project.repo}
40+
data-sveltekit-noscroll>{project.repo}</a
41+
></td
42+
>
43+
<td
44+
><a
45+
href={project.demo}
46+
data-sveltekit-noscroll>{project.demo}</a
47+
></td>
3548
</tr>
3649
{/each}
3750
</tbody>

0 commit comments

Comments
 (0)