Skip to content

Commit 30b9ea5

Browse files
authored
Merge pull request #57 from eurofurence/pickup-notices
Pickup Notices if mass_printing was already performed
2 parents cfb811b + e12a30b commit 30b9ea5

5 files changed

Lines changed: 44 additions & 13 deletions

File tree

app/Filament/Resources/EventResource.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
use Filament\Forms\Form;
1111
use Filament\Resources\Resource;
1212
use Filament\Tables;
13-
use Filament\Tables\Columns\TextColumn;
1413
use Filament\Tables\Table;
15-
use Illuminate\Database\Eloquent\Builder;
16-
use Illuminate\Database\Eloquent\SoftDeletingScope;
1714

1815
class EventResource extends Resource
1916
{
@@ -38,6 +35,8 @@ public static function form(Form $form): Form
3835
Forms\Components\DateTimePicker::make('preorder_starts_at')->required(),
3936
Forms\Components\DateTimePicker::make('preorder_ends_at')
4037
->required(),
38+
Forms\Components\DateTimePicker::make('mass_printed_at')
39+
->required(),
4140
Forms\Components\DateTimePicker::make('order_ends_at')
4241
->required(),
4342
])->columns()->columnSpanFull()->label('Closing Dates'),
@@ -67,7 +66,11 @@ public static function table(Table $table): Table
6766
->dateTime('d.m.Y H:i')
6867
->description(fn (Event $record) => $record->preorder_ends_at?->diffForHumans())
6968
->sortable(),
70-
TextColumn::make('order_ends_at')
69+
Tables\Columns\TextColumn::make('mass_printed_at')
70+
->dateTime('d.m.Y H:i')
71+
->description(fn (Event $record) => $record->mass_printed_at?->diffForHumans())
72+
->sortable(),
73+
Tables\Columns\TextColumn::make('order_ends_at')
7174
->dateTime('d.m.Y H:i')
7275
->description(fn (Event $record) => $record->order_ends_at?->diffForHumans())
7376
->sortable(),

app/Models/Event.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ protected function casts()
2424
'preorder_starts_at' => 'datetime',
2525
'preorder_ends_at' => 'datetime',
2626
'order_ends_at' => 'datetime',
27+
'mass_printed_at' => 'datetime',
2728
];
2829
}
2930

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table('events', function (Blueprint $table) {
15+
$table->dateTime('mass_printed_at')
16+
->useCurrent()
17+
->after("preorder_ends_at")
18+
->comment('Timestamp when the event badges are being mass printed');
19+
});
20+
}
21+
};

resources/js/Pages/Badges/BadgesCreate.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Panel from 'primevue/panel';
1313
import Tag from 'primevue/tag';
1414
import dayjs from "dayjs";
1515
import InputError from "@/Components/InputError.vue";
16+
import Message from "primevue/message";
1617
1718
defineOptions({
1819
layout: Layout
@@ -90,6 +91,12 @@ const total = computed(() => {
9091
<h1 class="text-xl sm:text-2xl md:text-3xl font-semibold font-main">Eurofurence Fursuit Badge Creator</h1>
9192
<p>Welcome to our badge configurator, please enter all the details and options you would like!</p>
9293
</div>
94+
<Message
95+
v-if="new Date(usePage().props.event.mass_printed_at) < new Date()"
96+
severity="info"
97+
:closable="false">
98+
{{ "Late badge orders can be picked up starting from the 2nd convention day." }}
99+
</Message>
93100
<!-- Group 1 -- Fursuit Details -->
94101
<div class="space-y-8">
95102
<div class="md:border-2 md:shadow md:bg-white md:rounded-lg md:p-8">

resources/js/Pages/Welcome.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,7 @@ defineOptions({
1414
})
1515
1616
const props = defineProps({
17-
showState: String,
18-
});
19-
20-
const preorderPeriodEnded = computed(() => {
21-
return dayjs().isAfter(dayjs('2022-08-15'));
22-
});
23-
24-
const eventEnded = computed(() => {
25-
return usePage().props.event === null;
17+
showState: String
2618
});
2719
2820
const messages = computed(() => {
@@ -121,6 +113,13 @@ const messages = computed(() => {
121113
:closable="false">
122114
{{ messages.message.text }}
123115
</Message>
116+
<Message
117+
v-if="new Date(usePage().props.event.mass_printed_at) < new Date()"
118+
severity="info"
119+
:closable="false"
120+
>
121+
{{ "Any fursuit badge orders placed now will be available to pick up starting from the 2nd convention day." }}
122+
</Message>
124123
<!-- End Countdown -->
125124
<PaymentInfoWidget />
126125
<h1 class="text-2xl font-semibold font-main">The Eurofurence Fursuit Badge</h1>

0 commit comments

Comments
 (0)