Skip to content

Commit 66649ee

Browse files
committed
Put the remove project button in the project page istead of top page
1 parent cff1344 commit 66649ee

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

svelte/App.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import Projects from './Projects.svelte';
66
import Main from './Main.svelte';
77
import Welcome from './Welcome.svelte';
8+
import Remove from './Remove.svelte';
89
910
export let status;
1011
@@ -64,7 +65,12 @@
6465
{#if status.currentProject}
6566
<Lock {status}></Lock>
6667
{/if}
68+
6769
<Projects {status}></Projects>
70+
71+
{#if status.currentProject}
72+
<Remove {status}></Remove>
73+
{/if}
6874
</aside>
6975

7076
{/if}

svelte/Remove.svelte

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<script>
2+
export let status;
3+
</script>
4+
5+
<form action="./{status.currentProject.name}/remove" method="post" class="sidebar-section bg-light p-3 mb-3">
6+
<h4>Remove project</h4>
7+
8+
<p>Please lock this project in order to remove.</p>
9+
10+
<button class="btn btn-danger" disabled={!status.currentProject.lock || status.currentProject.lock.user !== status.currentUser}>
11+
&#x2620; Remove this project
12+
</button>
13+
</form>

svelte/Welcome.svelte

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,4 @@
1616
<button class="btn btn-success" type="submit">git clone</button>
1717
</span>
1818
</div>
19-
</form>
20-
21-
{#if status.allProjects.length > 0}
22-
<h3 class="p-1">Remove a project</h3>
23-
24-
<table class="table table-striped">
25-
{#each status.allProjects as project}
26-
<tr>
27-
<td>
28-
<form action="./{project.name}/remove" method="post" class="form-inline">
29-
<button class="btn btn-sm btn-outline-danger confirm" data-confirm-text="Are you sure to remove {project.name}?">{project.name}</button>
30-
</form>
31-
</td>
32-
</tr>
33-
{/each}
34-
</table>
35-
{/if}
19+
</form>

0 commit comments

Comments
 (0)