|
4 | 4 | import Head from '$lib/components/Head.svelte'; |
5 | 5 | import Project from '$lib/components/Project.svelte'; |
6 | 6 | import { calculateCurrencyPayout, calculateMinutes } from '$lib/currency'; |
| 7 | + import { END_DATE } from '$lib/defs'; |
7 | 8 | import { MAX_UPLOAD_SIZE } from '../config'; |
8 | 9 | import type { PageProps } from './$types'; |
9 | 10 | import { Ship, SquarePen } from '@lucide/svelte'; |
|
16 | 17 | let editorUrl = $state(data.project.editorUrl); |
17 | 18 | let editorUploadFile = $state(null); |
18 | 19 | let modelFile = $state(null); |
19 | | - let submitAsClub = $state(false); |
| 20 | + let submitAsClub = $state( |
| 21 | + END_DATE <= new Date() && data.project.status === 'building' && data.clubMembership |
| 22 | + ? true |
| 23 | + : false |
| 24 | + ); |
20 | 25 |
|
21 | 26 | let hasEditorFile = $derived((editorUrl || editorUploadFile) && !(editorUrl && editorUploadFile)); |
22 | 27 |
|
|
33 | 38 | <Head title="Ship project" /> |
34 | 39 |
|
35 | 40 | <h1 class="mt-5 mb-3 font-hero text-2xl font-medium">Ship project</h1> |
| 41 | + |
| 42 | +{#if END_DATE <= new Date() && data.project.status == 'building'} |
| 43 | + <div |
| 44 | + class="mt-3 mb-3 flex flex-col gap-0.5 rounded-lg border-3 border-primary-700 bg-primary-900 p-3" |
| 45 | + > |
| 46 | + <h2 class="text-xl font-bold text-primary-400">New non-clubs submissions are now closed!</h2> |
| 47 | + <p> |
| 48 | + Construct has ended for non-clubs projects. The market is still open and you can re-ship |
| 49 | + rejected projects, however you can't ship new projects. |
| 50 | + </p> |
| 51 | + <p class="mt-1">You can still ship new projects as normal for clubs.</p> |
| 52 | + </div> |
| 53 | +{/if} |
| 54 | + |
36 | 55 | <Project |
37 | 56 | id={data.project.id} |
38 | 57 | name={data.project.name} |
|
169 | 188 | <div class="mt-1"> |
170 | 189 | <p class="mb-1 font-bold">Submit as</p> |
171 | 190 | <div class="themed-box flex flex-col gap-2 p-3"> |
172 | | - <label class="flex cursor-pointer items-center gap-2"> |
| 191 | + <label |
| 192 | + class="flex items-center gap-2" |
| 193 | + class:opacity-50={END_DATE <= new Date() && data.project.status === 'building'} |
| 194 | + class:cursor-pointer={!(END_DATE <= new Date() && data.project.status === 'building')} |
| 195 | + class:cursor-not-allowed={END_DATE <= new Date() && data.project.status === 'building'} |
| 196 | + > |
173 | 197 | <input |
174 | 198 | type="radio" |
175 | 199 | name="submission_type" |
176 | 200 | value="individual" |
177 | 201 | checked={!submitAsClub} |
178 | 202 | onchange={() => (submitAsClub = false)} |
| 203 | + disabled={END_DATE <= new Date() && data.project.status === 'building'} |
179 | 204 | class="radio" |
180 | 205 | /> |
181 | 206 | <span>Individual submission</span> |
|
239 | 264 | </div> |
240 | 265 | <div class="mb-1"> |
241 | 266 | {#if data.project.timeSpent >= 60 && data.project.description != '' && data.project.url != ''} |
242 | | - <p class="text-primary-300"> |
243 | | - Are you sure you want to ship "{data.project.name}"? |
244 | | - <span class="font-bold">You won't be able to edit it or journal again</span> unless it gets rejected. |
245 | | - </p> |
| 267 | + {#if !submitAsClub && END_DATE <= new Date() && data.project.status === 'building'} |
| 268 | + <p class="text-red-400">Non-clubs submissions are now closed!</p> |
| 269 | + {:else} |
| 270 | + <p class="text-primary-300"> |
| 271 | + Are you sure you want to ship "{data.project.name}"? |
| 272 | + <span class="font-bold">You won't be able to edit it or journal again</span> unless it gets |
| 273 | + rejected. |
| 274 | + </p> |
| 275 | + {/if} |
246 | 276 | {/if} |
247 | 277 | </div> |
248 | 278 | <div class="flex flex-row gap-2"> |
|
258 | 288 | data.project.description == '' || |
259 | 289 | !printablesUrl || |
260 | 290 | !hasEditorFile || |
261 | | - !modelFile} |
| 291 | + !modelFile || |
| 292 | + (!submitAsClub && END_DATE <= new Date())} |
262 | 293 | > |
263 | 294 | <Ship /> |
264 | 295 | Ship |
|
0 commit comments