부모 티켓
1개 티켓

백로그

0
티켓 없음

할 일

0
티켓 없음

진행 중

0
티켓 없음

리뷰

1
보통 41f4999a
서브 티켓 [P2] 학습 대시보드 + 진행률

학습 대시보드 — Learn 홈 진행률 바 + 커리큘럼별 진행률 + Turbo Frames + 테스트

## 목표 Learn 홈(learn/home#index)을 학습 대시보드로 업그레이드. 커리큘럼별 진행률 바, 전체 진행률 표시. ## 현재 상태 - Learn::HomeController 구현됨: `@curricula = Curriculum.published.order(:position).includes(:lessons)` - learn/home/index.html.erb 존재 (커리큘럼 카드 목록) - UserLessonProgress 모델로 진행 추적 가능 - User has_many :user_lesson_progresses, has_many :lessons(through) ## 구현 사항 ### 1. Learn::HomeController 업그레이드 ```ruby def index @curricula = Curriculum.published.order(:position).includes(:lessons) # 유저의 전체 진행 상태 @total_lessons = Lesson.published.count @completed_lessons = Current.user.user_lesson_progresses.where(completed: true).count @overall_progress = @total_lessons.zero? ? 0 : (@completed_lessons.to_f / @total_lessons * 100).round # 커리큘럼별 진행률 계산 lesson_ids = Lesson.published.pluck(:id) completed_by_curriculum = Current.user.user_lesson_progresses .where(completed: true, lesson_id: lesson_ids) .joins(:lesson) .group("lessons.curriculum_id") .count @progress_by_curriculum = completed_by_curriculum end ``` ### 2. 뷰 업그레이드 (learn/home/index.html.erb) - **전체 진행률 섹션**: 큰 진행률 바 + "N / M 레슨 완료" 텍스트 - **커리큘럼별 카드**: 각 카드에 진행률 바 (완료 레슨 수 / 전체 레슨 수) - **진행률 바**: Tailwind CSS로 구현 (bg-surface 배경, bg-accent 채움) - **Turbo Frame**: 각 커리큘럼 진행률을 turbo_frame_tag로 감싸서 부분 갱신 가능 - **다크 테마** (bg-bg, bg-surface, text-text-primary, bg-accent) - 기존 Partial 활용 (_card) ### 3. 커리큘럼 진행률 partial (선택) - `learn/home/_curriculum_progress.html.erb` — 커리큘럼 카드 + 진행률 바 - turbo_frame_tag "curriculum_progress_#{curriculum.id}" ### ⚠️ 주의 - learn/ 범위만 수정 (developer-2는 services/ 작업 중) - 모델 수정 불필요 - N+1 방지: joins, group, count 사용 - 한국어 텍스트 ### 테스트 - Learn::HomeController: index(진행률 계산 확인) - 레슨 완료 후 진행률 변경 확인 - 인증 필요 확인 ### 완료 기준 - 커리큘럼별 진행률 퍼센트 표시 - 전체 진행률 바 - 다크 테마 디자인 - bin/rails test 전체 통과

D
developer-1
25 days

완료 (전체)

0
티켓 없음