feat:유형에 면접 추가 + 커스텀 유형 동적 추가 기능
- Schedule 모델에 TYPE_INTERVIEW(면접) 추가 (보라색) - 유형 select 옆에 [+] 버튼 → 커스텀 유형 직접 입력 가능 - 컨트롤러 validation을 string|max:50으로 변경 (동적 유형 허용) - 달력 뱃지 색상을 인라인 스타일로 변경 (Tailwind JIT 미빌드 대응) - 수정 모달에서 커스텀 유형도 select에 자동 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -48,12 +48,14 @@ class Schedule extends Model
|
||||
|
||||
public const TYPE_EVENT = 'event';
|
||||
public const TYPE_MEETING = 'meeting';
|
||||
public const TYPE_INTERVIEW = 'interview';
|
||||
public const TYPE_NOTICE = 'notice';
|
||||
public const TYPE_OTHER = 'other';
|
||||
|
||||
public const TYPES = [
|
||||
self::TYPE_EVENT => '일정',
|
||||
self::TYPE_MEETING => '회의',
|
||||
self::TYPE_INTERVIEW => '면접',
|
||||
self::TYPE_NOTICE => '공지',
|
||||
self::TYPE_OTHER => '기타',
|
||||
];
|
||||
@@ -61,6 +63,7 @@ class Schedule extends Model
|
||||
public const TYPE_COLORS = [
|
||||
self::TYPE_EVENT => ['bg' => 'bg-emerald-50', 'text' => 'text-emerald-700', 'border' => 'border-emerald-200'],
|
||||
self::TYPE_MEETING => ['bg' => 'bg-blue-50', 'text' => 'text-blue-700', 'border' => 'border-blue-200'],
|
||||
self::TYPE_INTERVIEW => ['bg' => 'bg-violet-50', 'text' => 'text-violet-700', 'border' => 'border-violet-200'],
|
||||
self::TYPE_NOTICE => ['bg' => 'bg-amber-50', 'text' => 'text-amber-700', 'border' => 'border-amber-200'],
|
||||
self::TYPE_OTHER => ['bg' => 'bg-gray-50', 'text' => 'text-gray-700', 'border' => 'border-gray-200'],
|
||||
];
|
||||
@@ -98,4 +101,20 @@ public function getTypeColorsAttribute(): array
|
||||
{
|
||||
return self::TYPE_COLORS[$this->type] ?? self::TYPE_COLORS[self::TYPE_OTHER];
|
||||
}
|
||||
|
||||
/**
|
||||
* 인라인 스타일로 타입 색상 반환 (Tailwind JIT 미빌드 대응)
|
||||
*/
|
||||
public function getTypeStyleAttribute(): string
|
||||
{
|
||||
$styles = [
|
||||
'event' => 'background:#ecfdf5;color:#047857;border-color:#a7f3d0;',
|
||||
'meeting' => 'background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe;',
|
||||
'interview' => 'background:#f5f3ff;color:#6d28d9;border-color:#ddd6fe;',
|
||||
'notice' => 'background:#fffbeb;color:#b45309;border-color:#fde68a;',
|
||||
'other' => 'background:#f9fafb;color:#374151;border-color:#e5e7eb;',
|
||||
];
|
||||
|
||||
return $styles[$this->type] ?? 'background:#f0fdf4;color:#15803d;border-color:#bbf7d0;';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user