Skip to content

Commit f5b485c

Browse files
committed
ui: improve config.提出した人
1 parent 4472a68 commit f5b485c

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

web/src/routes/[projectId]/config/+page.svelte

+10-17
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,12 @@
195195
プロジェクトの読み込みに失敗しました
196196
{/await}
197197
</div>
198-
{#await data.participants}
198+
{#await Promise.all([data.project, data.participants])}
199199
<span>
200200
<span class="loading loading-xl loading-bars"></span>
201-
提出した人を読込中...
201+
読込中...
202202
</span>
203-
{:then participants}
203+
{:then [project, participants]}
204204
<ul class="list bg-base-100 rounded-box shadow-md">
205205
<li class="p-4 pb-2 text-xs opacity-60 tracking-wide">提出した人</li>
206206

@@ -211,27 +211,20 @@
211211
>
212212
提出者がいません
213213
</div>
214-
{#each participants as participant}
215-
{#if participant.roles_count !== null}
216-
<div class="text-xs opacity-60 list-col-grow border-b-base-200">
217-
{participant.roles_count} roles
218-
</div>
219-
{/if}
220-
{#if participant.is_admin}
221-
<span class="badge badge-soft badge-info"> admin! </span>
222-
{/if}
223-
{/each}
224214
</li>
225215
{:else}
226216
{#each participants as participant}
227217
<li class="list-row">
228-
<div
229-
class="text-xs font-semibold opacity-60 list-col-grow border-b-base-200"
230-
>
218+
<div class="text-xs font-semibold opacity-60 border-b-base-200">
231219
{participant.name}
232220
</div>
221+
<div class="text-xs opacity-60 list-col-grow border-b-base-200">
222+
{#if !project.ok || project.data.project.multiple_roles}
223+
wants {participant.roles_count} roles
224+
{/if}
225+
</div>
233226
{#if participant.is_admin}
234-
<span class="badge badge-soft badge-info"> admin! </span>
227+
<span class="badge badge-soft badge-info"> 管理者 </span>
235228
{/if}
236229
</li>
237230
{/each}

web/src/routes/[projectId]/submit/+page.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
// TODO: ローディング中の UI を追加
1414
let participantName = $state<string>(data.prev?.name ?? "");
15-
let rolesCount = $state<number>(data.prev?.roles_count ?? 1);
15+
let rolesCount = $state<number>(data.prev?.roles_count || 1); // including 0
1616
let ratings = $state(
1717
data.roles.map((role) => {
1818
const score = role.prev ?? undefined;

0 commit comments

Comments
 (0)