|
|
@@ -47,21 +47,21 @@ class EsgHistoryResource extends Resource
|
|
47
|
47
|
|
|
48
|
48
|
return $years;
|
|
49
|
49
|
})->columnSpan(1),
|
|
50
|
|
- Select::make("selected_month")->label("月份")->options(function (){
|
|
|
50
|
+ Select::make("selected_month")->label("月份")->options(function () {
|
|
51
|
51
|
$months = [];
|
|
52
|
|
- for($i=1;$i<=12 ;$i++){
|
|
|
52
|
+ for ($i = 1; $i <= 12; $i++) {
|
|
53
|
53
|
$months[$i] = strval($i) . "月";
|
|
54
|
54
|
}
|
|
55
|
55
|
return $months;
|
|
56
|
56
|
})->default(now()->month)->columnSpan(1),
|
|
57
|
|
- Translate::make()->schema(fn (string $locale) => [
|
|
|
57
|
+ Translate::make()->schema(fn(string $locale) => [
|
|
58
|
58
|
TextInput::make('title')->required($locale == 'zh_TW')->label("標題"),
|
|
59
|
59
|
Textarea::make('description')->required($locale == 'zh_TW')->label("內文"),
|
|
60
|
60
|
])
|
|
61
|
|
- ->locales(["zh_TW", "en"])
|
|
62
|
|
- ->actions([
|
|
63
|
|
- app(DeepLService::class)->createTranslationAction("Main", ["title", 'description'])
|
|
64
|
|
- ])->columnSpanFull(),
|
|
|
61
|
+ ->locales(["zh_TW", "en"])
|
|
|
62
|
+ ->actions([
|
|
|
63
|
+ app(DeepLService::class)->createTranslationAction("Main", ["title", 'description'])
|
|
|
64
|
+ ])->columnSpanFull(),
|
|
65
|
65
|
Radio::make("visible")->label("顯示/不顯示")->options([1 => "顯示", 0 => "不顯示"])->inline()->default(1)->columnSpan(2)
|
|
66
|
66
|
])->columns(3)
|
|
67
|
67
|
]);
|
|
|
@@ -77,26 +77,26 @@ class EsgHistoryResource extends Resource
|
|
77
|
77
|
])
|
|
78
|
78
|
->filters([
|
|
79
|
79
|
SelectFilter::make('selected_year')->label("年份")
|
|
80
|
|
- ->options(function () {
|
|
81
|
|
- $currentYear = now()->year;
|
|
82
|
|
- $years = [];
|
|
83
|
|
- // 從 10 年前到 5 年後
|
|
84
|
|
- for ($i = $currentYear - 10; $i <= $currentYear + 10; $i++) {
|
|
85
|
|
- $years[$i] = strval($i) . '年';
|
|
86
|
|
- }
|
|
|
80
|
+ ->options(function () {
|
|
|
81
|
+ $currentYear = now()->year;
|
|
|
82
|
+ $years = [];
|
|
|
83
|
+ // 從 10 年前到 5 年後
|
|
|
84
|
+ for ($i = $currentYear - 10; $i <= $currentYear + 10; $i++) {
|
|
|
85
|
+ $years[$i] = strval($i) . '年';
|
|
|
86
|
+ }
|
|
87
|
87
|
|
|
88
|
|
- return $years;
|
|
89
|
|
- })
|
|
90
|
|
- ->attribute('selected_year'),
|
|
|
88
|
+ return $years;
|
|
|
89
|
+ })
|
|
|
90
|
+ ->attribute('selected_year'),
|
|
91
|
91
|
SelectFilter::make('selected_month')->label("月份")
|
|
92
|
|
- ->options(function () {
|
|
93
|
|
- $months = [];
|
|
94
|
|
- for($i=1;$i<=12 ;$i++){
|
|
95
|
|
- $months[$i] = strval($i) . "月";
|
|
96
|
|
- }
|
|
97
|
|
- return $months;
|
|
98
|
|
- })
|
|
99
|
|
- ->attribute('selected_month'),
|
|
|
92
|
+ ->options(function () {
|
|
|
93
|
+ $months = [];
|
|
|
94
|
+ for ($i = 1; $i <= 12; $i++) {
|
|
|
95
|
+ $months[$i] = strval($i) . "月";
|
|
|
96
|
+ }
|
|
|
97
|
+ return $months;
|
|
|
98
|
+ })
|
|
|
99
|
+ ->attribute('selected_month'),
|
|
100
|
100
|
])
|
|
101
|
101
|
->actions([
|
|
102
|
102
|
Tables\Actions\EditAction::make(),
|