Skip to content

Commit d2bdd5f

Browse files
authored
Merge pull request #140 from prgrms-aibe-devcourse/feat/#137-junior-dashboard-mentoring-list
[feat] 주니어 대시보드 멘토링 내역 전체보기 작업
2 parents 877ae4f + d5e8e8b commit d2bdd5f

2 files changed

Lines changed: 122 additions & 127 deletions

File tree

src/main/resources/templates/my/dashboard/junior.html

Lines changed: 81 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@
5252
font-weight: 700;
5353
line-height: 1;
5454
}
55-
/* 이미지 기준 색상 */
56-
.stat-pending { color: #ffffff; } /* 대기 중 - 흰색 */
57-
.stat-inprogress { color: #00CFE8; } /* 진행 중 - 민트 */
58-
.stat-completed { color: #c084fc; } /* 완료 내역 - 보라 */
55+
.stat-pending { color: #ffffff; }
56+
.stat-inprogress { color: #00CFE8; }
57+
.stat-completed { color: #c084fc; }
5958

6059
/* ===== 추천 가이드 카드 ===== */
6160
.guide-card-v2 {
@@ -212,6 +211,7 @@
212211
align-items: center;
213212
gap: 0.3rem;
214213
text-decoration: none;
214+
cursor: pointer;
215215
}
216216
.btn-action-outline {
217217
background-color: transparent;
@@ -235,9 +235,14 @@
235235
.section-header {
236236
display: flex;
237237
align-items: center;
238-
gap: 0.55rem;
238+
justify-content: space-between; /* 양쪽 끝으로 배치 */
239239
margin-bottom: 1.1rem;
240240
}
241+
.section-header-left {
242+
display: flex;
243+
align-items: center;
244+
gap: 0.55rem;
245+
}
241246
.section-header-icon {
242247
width: 28px;
243248
height: 28px;
@@ -255,6 +260,21 @@
255260
margin: 0;
256261
}
257262

263+
/* 💡 추가된 전체보기 링크 스타일 */
264+
.view-all-link {
265+
font-size: 0.85rem;
266+
color: #8b93a7;
267+
text-decoration: none;
268+
font-weight: 500;
269+
background: none;
270+
border: none;
271+
padding: 0;
272+
transition: color 0.2s ease;
273+
}
274+
.view-all-link:hover {
275+
color: #d1d5db; /* 마우스 오버 시 조금 더 밝게 */
276+
}
277+
258278
/* ===== 빈 상태 ===== */
259279
.empty-state {
260280
text-align: center;
@@ -266,7 +286,6 @@
266286

267287
<div layout:fragment="content" class="container py-5 mt-5" style="max-width: 1080px;">
268288

269-
<!-- 프로필 수정 결과 메시지 -->
270289
<div th:if="${param.profileUpdated}" class="alert mb-3"
271290
style="background-color: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.35); color: #4ade80; border-radius: 0.9rem; padding: 0.75rem 1.25rem;">
272291
프로필이 업데이트되었습니다.
@@ -276,7 +295,6 @@
276295
이미 사용 중인 닉네임입니다.
277296
</div>
278297

279-
<!-- ===== 상단: 인사 + 통계 ===== -->
280298
<div class="greeting-card mb-4">
281299
<div class="d-flex align-items-center justify-content-between flex-wrap gap-3">
282300
<div class="d-flex align-items-center gap-3">
@@ -314,26 +332,24 @@ <h4 class="fw-bold text-white mb-1">
314332
</div>
315333
</div>
316334

317-
<!-- ===== 추천 가이드 ===== -->
318335
<div class="mb-4">
319336
<div class="section-header">
320-
<span class="section-header-icon">
321-
<!-- 지도 아이콘 -->
322-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
323-
<polygon points="3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21"/>
324-
<line x1="9" y1="3" x2="9" y2="18"/>
325-
<line x1="15" y1="6" x2="15" y2="21"/>
326-
</svg>
327-
</span>
328-
<h5 class="section-title">다음 성장을 위한 추천 가이드</h5>
337+
<div class="section-header-left">
338+
<span class="section-header-icon">
339+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
340+
<polygon points="3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21"/>
341+
<line x1="9" y1="3" x2="9" y2="18"/>
342+
<line x1="15" y1="6" x2="15" y2="21"/>
343+
</svg>
344+
</span>
345+
<h5 class="section-title">다음 성장을 위한 추천 가이드</h5>
346+
</div>
329347
</div>
330348

331349
<div class="row g-3">
332-
<!-- 카드 1: 코드 리뷰 멘토링 가기 -->
333350
<div class="col-md-4">
334351
<div class="guide-card-v2">
335352
<div class="guide-icon-v2 guide-icon-blue">
336-
<!-- 모니터 아이콘 -->
337353
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#60a5fa" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
338354
<rect x="2" y="3" width="20" height="14" rx="2"/>
339355
<line x1="8" y1="21" x2="16" y2="21"/>
@@ -347,11 +363,9 @@ <h5 class="section-title">다음 성장을 위한 추천 가이드</h5>
347363
</div>
348364
</div>
349365

350-
<!-- 카드 2: 다른 사람들 후기 보러가기 -->
351366
<div class="col-md-4">
352367
<div class="guide-card-v2">
353368
<div class="guide-icon-v2 guide-icon-purple">
354-
<!-- 로켓 아이콘 -->
355369
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#c084fc" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
356370
<path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"/>
357371
<path d="m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"/>
@@ -366,11 +380,9 @@ <h5 class="section-title">다음 성장을 위한 추천 가이드</h5>
366380
</div>
367381
</div>
368382

369-
<!-- 카드 3: 시니어 지원하러 가기 -->
370383
<div class="col-md-4">
371384
<div class="guide-card-v2">
372385
<div class="guide-icon-v2 guide-icon-green">
373-
<!-- 악수 아이콘 -->
374386
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#34d399" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
375387
<path d="M20.42 4.58a5.4 5.4 0 0 0-7.65 0l-.77.78-.77-.78a5.4 5.4 0 0 0-7.65 0C1.46 6.7 1.33 10.28 4 13l8 8 8-8c2.67-2.72 2.54-6.3.42-8.42z"/>
376388
<path d="M12 5.36 8.87 8.5a2.13 2.13 0 0 0 0 3h0a2.13 2.13 0 0 0 3 0l2.26-2.21a2.13 2.13 0 0 1 3 0l2.96 2.96"/>
@@ -387,38 +399,44 @@ <h5 class="section-title">다음 성장을 위한 추천 가이드</h5>
387399
</div>
388400
</div>
389401

390-
<!-- ===== 전체 멘토링 내역 ===== -->
391402
<div class="card-dark p-4">
392403
<div class="section-header">
393-
<span class="section-header-icon">
394-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
395-
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
396-
</svg>
397-
</span>
398-
<h5 class="section-title">전체 멘토링 내역</h5>
404+
<div class="section-header-left">
405+
<span class="section-header-icon">
406+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
407+
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
408+
</svg>
409+
</span>
410+
<h5 class="section-title">전체 멘토링 내역</h5>
411+
</div>
412+
413+
<button th:if="${junior.orders != null and junior.orders.size() > 5}"
414+
type="button"
415+
id="viewAllBtnContainer"
416+
class="view-all-link"
417+
onclick="showAllMentoringItems()">
418+
전체 보기 →
419+
</button>
399420
</div>
400421

401-
<!-- 주문 없을 때 -->
402422
<div th:if="${junior.orders == null or junior.orders.isEmpty()}" class="empty-state">
403423
<div class="fs-1 mb-3">📭</div>
404424
<p class="mb-3">아직 의뢰한 코드 리뷰가 없어요.</p>
405425
<a href="/" class="btn-action btn-action-mint">시니어 찾아보기</a>
406426
</div>
407427

408-
<!-- 주문 목록 -->
409428
<div th:unless="${junior.orders == null or junior.orders.isEmpty()}">
410-
<div th:each="order : ${junior.orders}" class="mentoring-item">
411-
<!-- 아바타 -->
429+
<div th:each="order, stat : ${junior.orders}"
430+
class="mentoring-item"
431+
th:classappend="${stat.index >= 5} ? 'extra-item d-none' : ''">
412432
<div class="mentor-avatar">
413433
<span th:text="${#strings.substring(order.seniorNickname, 0, 1)}"></span>
414434
</div>
415435

416-
<!-- 시니어 정보 -->
417436
<div class="mentor-info">
418437
<div class="mentor-name-row">
419438
<span class="mentor-name" th:text="${order.seniorNickname}">시니어닉네임</span>
420439

421-
<!-- 상태 배지 -->
422440
<span th:if="${order.status.name() == 'PENDING'}" class="status-pill status-pending">결제 대기</span>
423441
<span th:if="${order.status.name() == 'PAID'}" class="status-pill status-paid">리뷰 진행중</span>
424442
<span th:if="${order.status.name() == 'SETTLED'}" class="status-pill status-settled">완료</span>
@@ -432,7 +450,6 @@ <h5 class="section-title">전체 멘토링 내역</h5>
432450
</div>
433451
</div>
434452

435-
<!-- 액션 -->
436453
<div class="d-flex align-items-center gap-2">
437454
<a th:if="${order.status.name() == 'SETTLED' and !order.hasReview}"
438455
th:href="@{|/orders/${order.orderId}?reviewOnly=1|}"
@@ -447,7 +464,6 @@ <h5 class="section-title">전체 멘토링 내역</h5>
447464
</div>
448465
</div>
449466

450-
<!-- ===== 프로필 수정 모달 ===== -->
451467
<div class="modal fade" id="editProfileModal" tabindex="-1" aria-labelledby="editProfileModalLabel" aria-hidden="true">
452468
<div class="modal-dialog modal-dialog-centered">
453469
<div class="modal-content" style="background-color: #161b27; border: 1px solid #2a2f40; border-radius: 1.25rem; color: #fff;">
@@ -458,7 +474,6 @@ <h5 class="modal-title fw-bold" id="editProfileModalLabel">프로필 수정</h5>
458474
<form th:action="@{/my/profile}" method="post" enctype="multipart/form-data">
459475
<div class="modal-body" style="display: flex; flex-direction: column; gap: 1.25rem; padding: 1.5rem;">
460476

461-
<!-- 프로필 이미지 미리보기 -->
462477
<div style="text-align: center;">
463478
<div id="profilePreview" style="
464479
width: 80px; height: 80px; border-radius: 1rem;
@@ -476,7 +491,6 @@ <h5 class="modal-title fw-bold" id="editProfileModalLabel">프로필 수정</h5>
476491
<div style="margin-top: 0.5rem; font-size: 0.75rem; color: #8b93a7;">이미지를 클릭해 변경</div>
477492
</div>
478493

479-
<!-- 닉네임 -->
480494
<div>
481495
<label for="nicknameInput" class="form-label" style="color: #8b93a7; font-size: 0.82rem; margin-bottom: 0.4rem; display: block;">닉네임</label>
482496
<input type="text" id="nicknameInput" name="nickname"
@@ -486,7 +500,6 @@ <h5 class="modal-title fw-bold" id="editProfileModalLabel">프로필 수정</h5>
486500
style="background-color: #0f1320; border: 1px solid #2a2f40; color: #fff; border-radius: 0.75rem; padding: 0.65rem 1rem;">
487501
</div>
488502

489-
<!-- 프로필 이미지 파일 -->
490503
<div>
491504
<label for="profileImageInput" class="form-label" style="color: #8b93a7; font-size: 0.82rem; margin-bottom: 0.4rem; display: block;">프로필 이미지 <span style="font-size: 0.75rem;">(선택, 5MB 이하)</span></label>
492505
<input type="file" id="profileImageInput" name="profileImage"
@@ -507,19 +520,32 @@ <h5 class="modal-title fw-bold" id="editProfileModalLabel">프로필 수정</h5>
507520
</div>
508521

509522
<th:block layout:fragment="script">
510-
<script>
511-
document.getElementById('profileImageInput')?.addEventListener('change', function () {
512-
const file = this.files[0];
513-
const preview = document.getElementById('profilePreview');
514-
515-
if (!file) return;
516-
517-
const reader = new FileReader();
518-
reader.onload = function (e) {
519-
preview.innerHTML = '<img id="previewImg" src="' + e.target.result + '" style="width:100%;height:100%;object-fit:cover;display:block;" alt="미리보기">';
520-
};
521-
reader.readAsDataURL(file);
522-
});
523-
</script>
523+
<script>
524+
document.getElementById('profileImageInput')?.addEventListener('change', function () {
525+
const file = this.files[0];
526+
const preview = document.getElementById('profilePreview');
527+
528+
if (!file) return;
529+
530+
const reader = new FileReader();
531+
reader.onload = function (e) {
532+
preview.innerHTML = '<img id="previewImg" src="' + e.target.result + '" style="width:100%;height:100%;object-fit:cover;display:block;" alt="미리보기">';
533+
};
534+
reader.readAsDataURL(file);
535+
});
536+
537+
// 전체 보기 펼치기
538+
function showAllMentoringItems() {
539+
const hiddenItems = document.querySelectorAll('.extra-item');
540+
hiddenItems.forEach(item => {
541+
item.classList.remove('d-none');
542+
});
543+
544+
const btnContainer = document.getElementById('viewAllBtnContainer');
545+
if(btnContainer) {
546+
btnContainer.style.display = 'none';
547+
}
548+
}
549+
</script>
524550
</th:block>
525551
</html>

0 commit comments

Comments
 (0)