fix: 템플릿 완전 재작성 - 페이지당 4개 고정 영역

This commit is contained in:
청춘약국
2026-03-18 23:19:22 +09:00
parent 72ce6d9f05
commit 4fb34d5e17
2 changed files with 210 additions and 377 deletions

View File

@@ -122,14 +122,7 @@ class AnimalMedRendererV2:
await page.set_content(html_content, wait_until='networkidle') await page.set_content(html_content, wait_until='networkidle')
# 콘텐츠 크기 확인 # scale 고정 (페이지 분할을 위해)
rect = await page.evaluate('''() => {
const el = document.querySelector('.container');
const rect = el.getBoundingClientRect();
return { width: rect.width, height: rect.height };
}''')
# scale 고정 (자연스러운 페이지 분할)
scale = 1.0 scale = 1.0
await page.pdf( await page.pdf(

View File

@@ -9,8 +9,6 @@
* { margin: 0; padding: 0; box-sizing: border-box; } * { margin: 0; padding: 0; box-sizing: border-box; }
html, body { html, body {
width: 210mm;
height: 297mm;
font-family: 'Noto Sans KR', sans-serif; font-family: 'Noto Sans KR', sans-serif;
font-size: 9pt; font-size: 9pt;
color: #333; color: #333;
@@ -18,16 +16,14 @@
background: #fff; background: #fff;
} }
.container { /* 페이지 */
width: 210mm;
padding: 5mm;
}
.page { .page {
width: 200mm; width: 210mm;
height: 287mm; height: 297mm;
padding: 5mm;
page-break-after: always; page-break-after: always;
position: relative; position: relative;
box-sizing: border-box;
} }
.page:last-child { .page:last-child {
@@ -39,85 +35,79 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
border-bottom: 3px solid #1565C0; border-bottom: 2px solid #1565C0;
padding-bottom: 3mm; padding-bottom: 2mm;
margin-bottom: 4mm; margin-bottom: 3mm;
height: 15mm;
} }
.header-left .patient-name { .header-left .patient-name {
font-size: 16pt; font-size: 14pt;
font-weight: 700; font-weight: 700;
color: #0D47A1; color: #0D47A1;
} }
.header-left .patient-info { .header-left .patient-info {
font-size: 8pt;
color: #666;
margin-top: 1mm;
}
.header-center {
text-align: center;
}
.header-center .pharmacy-name {
font-size: 14pt;
font-weight: 700;
color: #1565C0;
}
.header-center .pharmacy-slogan {
font-size: 8pt;
color: #42A5F5;
}
.header-right {
text-align: right;
font-size: 7pt; font-size: 7pt;
color: #666; color: #666;
} }
/* 약품 카드 그리드 */ .header-center .pharmacy-name {
.drug-cards-grid { font-size: 12pt;
display: grid; font-weight: 700;
grid-template-columns: 1fr 1fr; color: #1565C0;
gap: 3mm;
} }
/* 약품 카드 공통 */ .header-right {
font-size: 7pt;
color: #666;
}
/* 카드 그리드 영역 - 고정 높이 */
.cards-area {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
gap: 2mm;
height: 265mm; /* 297 - 5*2(패딩) - 15(헤더) - 7(푸터) */
}
.cards-area.no-header {
height: 280mm; /* 헤더 없을 때 */
}
/* 약품 카드 */
.drug-card { .drug-card {
border: 1px solid #E0E0E0; border: 1px solid #E0E0E0;
border-radius: 2mm; border-radius: 2mm;
overflow: hidden; overflow: hidden;
page-break-inside: avoid; display: flex;
flex-direction: column;
} }
.drug-card-header { .drug-card-header {
background: linear-gradient(135deg, #1565C0, #42A5F5); background: linear-gradient(135deg, #1565C0, #42A5F5);
color: white; color: white;
padding: 2mm; padding: 1.5mm;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 2mm; gap: 2mm;
flex-shrink: 0;
} }
.drug-icon { .drug-icon {
width: 8mm; width: 7mm;
height: 8mm; height: 7mm;
background: white; background: white;
border-radius: 1.5mm; border-radius: 1mm;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 12pt; font-size: 10pt;
}
.drug-title-area {
flex: 1;
} }
.drug-name { .drug-name {
font-size: 9pt; font-size: 8pt;
font-weight: 700; font-weight: 700;
} }
@@ -129,489 +119,339 @@
.drug-badges { .drug-badges {
display: flex; display: flex;
gap: 0.5mm; gap: 0.5mm;
margin-top: 0.5mm;
flex-wrap: wrap; flex-wrap: wrap;
} }
.badge { .badge {
background: rgba(255,255,255,0.2); background: rgba(255,255,255,0.2);
padding: 0.3mm 1mm; padding: 0.2mm 1mm;
border-radius: 0.5mm; border-radius: 0.5mm;
font-size: 5pt; font-size: 4.5pt;
} }
.drug-card-body { .drug-card-body {
padding: 2mm; padding: 1.5mm;
font-size: 6pt; font-size: 5.5pt;
} flex: 1;
overflow: hidden;
/* 구충제 전용 - 커버리지 표 */
.coverage-section {
margin-bottom: 3mm;
} }
/* 섹션들 */
.coverage-title { .coverage-title {
font-size: 9pt; font-size: 6pt;
font-weight: 700; font-weight: 700;
color: #1565C0; color: #1565C0;
margin-bottom: 2mm; margin-bottom: 1mm;
display: flex;
align-items: center;
gap: 1mm;
} }
.coverage-table { .coverage-table {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 1mm; gap: 0.5mm;
background: #F5F5F5; background: #F5F5F5;
padding: 2mm; padding: 1mm;
border-radius: 2mm; border-radius: 1mm;
margin-bottom: 1.5mm;
} }
.coverage-item { .coverage-item {
background: white; background: white;
padding: 1.5mm; padding: 1mm;
border-radius: 1mm; border-radius: 0.5mm;
text-align: center; text-align: center;
font-size: 7pt; font-size: 5pt;
} }
.coverage-item.covered { .coverage-item.covered { border-left: 1.5px solid #4CAF50; }
border-left: 2px solid #4CAF50; .coverage-item.not-covered { border-left: 1.5px solid #F44336; background: #FFEBEE; }
}
.coverage-item.not-covered { .coverage-icon { font-size: 7pt; }
border-left: 2px solid #F44336; .coverage-name { font-weight: 500; }
background: #FFEBEE;
}
.coverage-icon {
font-size: 10pt;
display: block;
}
.coverage-name {
font-weight: 500;
margin-top: 0.5mm;
}
/* 갭 경고 */ /* 갭 경고 */
.gap-warning { .gap-warning {
background: #FFF3E0; background: #FFF3E0;
border: 1px solid #FFB74D; border: 1px solid #FFB74D;
border-radius: 2mm; border-radius: 1mm;
padding: 2mm; padding: 1mm;
margin-top: 2mm; margin-bottom: 1.5mm;
font-size: 7pt; font-size: 5pt;
} }
.gap-warning-title { .gap-warning-title { font-weight: 700; color: #E65100; }
font-weight: 700; .gap-solution { color: #F57C00; }
color: #E65100;
}
.gap-solution {
color: #F57C00;
margin-top: 1mm;
}
/* 투약 정보 */ /* 투약 정보 */
.dosing-section { .dosing-section {
background: #E3F2FD; background: #E3F2FD;
border-radius: 2mm; border-radius: 1mm;
padding: 2mm 3mm; padding: 1mm 1.5mm;
margin-bottom: 3mm; margin-bottom: 1.5mm;
} }
.dosing-title { .dosing-title { font-weight: 700; color: #1565C0; font-size: 5.5pt; }
font-weight: 700; .dosing-main { font-size: 8pt; font-weight: 700; color: #0D47A1; }
color: #1565C0; .dosing-note { font-size: 5pt; color: #1976D2; }
font-size: 8pt;
}
.dosing-main {
font-size: 11pt;
font-weight: 700;
color: #0D47A1;
margin: 1mm 0;
}
.dosing-note {
font-size: 7pt;
color: #1976D2;
}
/* 체중별 제품 */ /* 체중별 제품 */
.weight-products { .weight-products {
display: flex; display: flex;
gap: 1mm; gap: 0.5mm;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 2mm; margin-top: 1mm;
} }
.weight-product { .weight-product {
background: #E8F5E9; background: #E8F5E9;
padding: 1mm 2mm; padding: 0.5mm 1mm;
border-radius: 1mm; border-radius: 0.5mm;
font-size: 6pt; font-size: 4.5pt;
border: 1px solid #A5D6A7; border: 0.5px solid #A5D6A7;
}
/* NSAIDs 전용 - 용량표 */
.dosage-table-section {
margin-bottom: 3mm;
} }
/* 용량표 */
.dosage-grid { .dosage-grid {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 1mm; gap: 0.5mm;
background: #E3F2FD; background: #E3F2FD;
padding: 2mm; padding: 1mm;
border-radius: 2mm; border-radius: 1mm;
margin-bottom: 1.5mm;
} }
.dosage-cell { .dosage-cell {
background: white; background: white;
padding: 1.5mm; padding: 1mm;
border-radius: 1mm; border-radius: 0.5mm;
text-align: center; text-align: center;
font-size: 7pt; font-size: 5pt;
} }
.dosage-weight { .dosage-weight { font-weight: 500; color: #1565C0; }
font-weight: 500; .dosage-amount { font-weight: 700; color: #0D47A1; font-size: 6pt; }
color: #1565C0;
}
.dosage-amount {
font-weight: 700;
color: #0D47A1;
font-size: 9pt;
}
/* 절대 금기 */ /* 절대 금기 */
.contraindication-box { .contraindication-box {
background: #FFEBEE; background: #FFEBEE;
border: 2px solid #F44336; border: 1px solid #F44336;
border-radius: 2mm; border-radius: 1mm;
padding: 2mm 3mm; padding: 1mm;
margin-bottom: 3mm; margin-bottom: 1.5mm;
} }
.contraindication-title { .contraindication-title { font-weight: 900; color: #C62828; font-size: 6pt; }
font-weight: 900;
color: #C62828;
font-size: 9pt;
margin-bottom: 1mm;
}
.contraindication-list { .contraindication-list {
list-style: none; list-style: none;
} font-size: 5pt;
.contraindication-list li {
font-size: 8pt;
color: #B71C1C; color: #B71C1C;
padding: 1mm 0;
border-bottom: 1px dashed #FFCDD2;
display: flex;
align-items: flex-start;
gap: 1mm;
} }
.contraindication-list li:last-child { .contraindication-list li { padding: 0.3mm 0; }
border-bottom: none;
}
/* 주의사항 */ /* 주의사항 */
.warnings-section { .warnings-section {
background: #FFF8E1; background: #FFF8E1;
border: 1px solid #FFE082; border: 1px solid #FFE082;
border-radius: 2mm; border-radius: 1mm;
padding: 2mm 3mm; padding: 1mm;
} }
.warnings-title { .warnings-title { font-weight: 700; color: #F57F17; font-size: 5.5pt; }
font-weight: 700;
color: #F57F17;
font-size: 8pt;
margin-bottom: 1mm;
}
.warnings-list { .warnings-list {
list-style: none; list-style: none;
} font-size: 5pt;
.warnings-list li {
font-size: 7pt;
color: #795548; color: #795548;
padding: 0.5mm 0;
padding-left: 2mm;
position: relative;
} }
.warnings-list li::before { .warnings-list li { padding: 0.2mm 0; }
content: "•";
position: absolute; /* 외용제 용법 */
left: 0; .usage-box {
color: #FF9800; background: #E8F5E9;
padding: 1mm;
border-radius: 1mm;
font-size: 5pt;
margin-bottom: 1.5mm;
} }
/* 푸터 */ /* 푸터 */
.footer { .footer {
position: absolute; position: absolute;
bottom: 4mm; bottom: 3mm;
left: 6mm; left: 5mm;
right: 6mm; right: 5mm;
text-align: center; text-align: center;
font-size: 6pt; font-size: 5pt;
color: #9E9E9E; color: #9E9E9E;
border-top: 1px solid #E0E0E0; border-top: 0.5px solid #E0E0E0;
padding-top: 2mm; padding-top: 1mm;
height: 7mm;
} }
.footer-logo { .footer-logo { font-weight: 700; color: #1565C0; font-size: 6pt; }
font-weight: 700;
color: #1565C0;
font-size: 8pt;
}
</style> </style>
</head> </head>
<body> <body>
<div class="container"> {% set drugs_per_page = 4 %}
<!-- 약품 카드들 (페이지당 4개, 2x2 그리드) --> {% set total_pages = ((drugs|length - 1) // drugs_per_page) + 1 %}
{% for drug in drugs %}
{% if loop.index0 % 4 == 0 %} {% for page_num in range(total_pages) %}
<div class="page"> <div class="page">
{% if loop.index0 == 0 %} {% if page_num == 0 %}
<!-- 헤더 (첫 페이지만) --> <!-- 헤더 (첫 페이지만) -->
<div class="header"> <div class="header">
<div class="header-left"> <div class="header-left">
<div class="patient-name">{{ patient_name }} 보호자님</div> <div class="patient-name">{{ patient_name }} 보호자님</div>
<div class="patient-info"> <div class="patient-info">🐾 {{ pet_name }} ({{ pet_species }}, {{ pet_age }}) | 📅 {{ issue_date }}</div>
🐾 {{ pet_name }} ({{ pet_species }}, {{ pet_age }}) | 📅 {{ issue_date }} </div>
</div> <div class="header-center">
</div> <div class="pharmacy-name">🏥 {{ pharmacy_name }}</div>
<div class="header-center"> </div>
<div class="pharmacy-name">🏥 {{ pharmacy_name }}</div> <div class="header-right">{{ pharmacy_tel }}</div>
</div> </div>
<div class="header-right">{{ pharmacy_tel }}</div> {% endif %}
</div>
{% endif %} <div class="cards-area {% if page_num > 0 %}no-header{% endif %}">
<div class="drug-cards-grid"> {% set start_idx = page_num * drugs_per_page %}
{% endif %} {% set end_idx = [start_idx + drugs_per_page, drugs|length] | min %}
{% for drug in drugs[start_idx:end_idx] %}
<div class="drug-card"> <div class="drug-card">
<div class="drug-card-header"> <div class="drug-card-header">
<div class="drug-icon">💊</div> <div class="drug-icon">💊</div>
<div class="drug-title-area"> <div>
<div class="drug-name">{{ drug.name }}</div> <div class="drug-name">{{ drug.name }}</div>
<div class="drug-subtitle">{{ drug.english_name }}</div> <div class="drug-subtitle">{{ drug.english_name }}</div>
<div class="drug-badges"> <div class="drug-badges">
<span class="badge">{{ drug.category_display }}</span> <span class="badge">{{ drug.category_display }}</span>
{% for animal in drug.target_animal %} {% for animal in drug.target_animal %}<span class="badge">{{ animal }}</span>{% endfor %}
<span class="badge">{{ animal }}</span>
{% endfor %}
<span class="badge">{{ drug.administration }}</span>
</div> </div>
</div> </div>
</div> </div>
<div class="drug-card-body"> <div class="drug-card-body">
{% if drug.category == 'antiparasitic' %} {% if drug.category == 'antiparasitic' %}
<!-- 구충제 레이아웃 --> <!-- 구충제 -->
<div class="coverage-section"> <div class="coverage-title">🎯 구충 범위</div>
<div class="coverage-title">🎯 구충 범위</div> <div class="coverage-table">
<div class="coverage-table"> {% for item in drug.coverage_summary.covered %}
{% for item in drug.coverage_summary.covered %} <div class="coverage-item covered">
<div class="coverage-item covered"> <span class="coverage-icon"></span>
<span class="coverage-icon"></span> <span class="coverage-name">{{ item }}</span>
<span class="coverage-name">{{ item }}</span>
</div>
{% endfor %}
{% for item in drug.coverage_summary.not_covered %}
<div class="coverage-item not-covered">
<span class="coverage-icon"></span>
<span class="coverage-name">{{ item }}</span>
</div>
{% endfor %}
</div> </div>
{% endfor %}
{% if drug.coverage_summary.not_covered %} {% for item in drug.coverage_summary.not_covered %}
<div class="gap-warning"> <div class="coverage-item not-covered">
<div class="gap-warning-title">⚠️ 미커버 항목</div> <span class="coverage-icon"></span>
<div class="gap-solution">💡 {{ drug.coverage_summary.gap_solution }}</div> <span class="coverage-name">{{ item }}</span>
</div> </div>
{% endif %} {% endfor %}
</div> </div>
<div class="dosing-section"> {% if drug.coverage_summary.gap_solution %}
<div class="dosing-title">📅 투약 주기</div> <div class="gap-warning">
<div class="dosing-main">{{ drug.dosing.interval }}</div> <span class="gap-warning-title">⚠️ 보완:</span>
<div class="dosing-note"> <span class="gap-solution">{{ drug.coverage_summary.gap_solution }}</span>
{{ drug.dosing.interval_reason }}<br> </div>
최소 연령: {{ drug.dosing.minimum_age }} / 최소 체중: {{ drug.dosing.minimum_weight }} {% endif %}
</div>
<div class="dosing-section">
<div class="dosing-title">📅 투약</div>
<div class="dosing-main">{{ drug.dosing.interval }}</div>
{% if drug.weight_products %} {% if drug.weight_products %}
<div class="weight-products"> <div class="weight-products">
{% for wp in drug.weight_products %} {% for wp in drug.weight_products %}<div class="weight-product">{{ wp.size }}({{ wp.weight_range }})</div>{% endfor %}
<div class="weight-product">{{ wp.size }} ({{ wp.weight_range }})</div>
{% endfor %}
</div> </div>
{% endif %} {% endif %}
</div> </div>
{% elif drug.category == 'nsaid' %} {% elif drug.category == 'nsaid' %}
<!-- NSAIDs 레이아웃 --> <!-- NSAIDs -->
<div class="dosage-table-section"> <div class="coverage-title">⚖️ 용량 ({{ drug.dosage.standard }})</div>
<div class="coverage-title">⚖️ 체중별 용량 ({{ drug.dosage.standard }})</div> <div class="dosage-grid">
<div class="dosage-grid"> {% for row in drug.dosage_table[:6] %}
{% for row in drug.dosage_table %} <div class="dosage-cell">
<div class="dosage-cell"> <div class="dosage-weight">{{ row.weight }}</div>
<div class="dosage-weight">{{ row.weight }}</div> <div class="dosage-amount">{{ row.tablets }}</div>
<div class="dosage-amount">{{ row.tablets }}</div>
</div>
{% endfor %}
</div> </div>
{% endfor %}
</div> </div>
{% if drug.absolute_contraindications %} {% if drug.absolute_contraindications %}
<div class="contraindication-box"> <div class="contraindication-box">
<div class="contraindication-title">🚫 절대 금기</div> <div class="contraindication-title">🚫 절대 금기</div>
<ul class="contraindication-list"> <ul class="contraindication-list">
{% for contra in drug.absolute_contraindications %} {% for c in drug.absolute_contraindications[:3] %}
<li>❌ {{ contra.item }} — {{ contra.reason }}</li> <li>❌ {{ c.item }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% endif %} {% endif %}
{% elif drug.category == 'antibiotic' %} {% elif drug.category == 'antibiotic' %}
<!-- 항생제 레이아웃 --> <!-- 항생제 -->
<div class="dosing-section"> <div class="dosing-section">
<div class="dosing-title">📋 적응증</div> <div class="dosing-title">📋 {{ drug.indication[:30] }}...</div>
<div class="dosing-main">{{ drug.indication }}</div> <div class="dosing-main">{{ drug.dosage.standard }}</div>
</div> <div class="dosing-note">기간: {{ drug.dosage.duration }}</div>
<div class="dosage-table-section">
<div class="coverage-title">⚖️ 체중별 용량 ({{ drug.dosage.standard }})</div>
<div class="dosage-grid">
{% for row in drug.dosage_table %}
<div class="dosage-cell">
<div class="dosage-weight">{{ row.weight }}</div>
<div class="dosage-amount">{{ row.tablets }}</div>
</div>
{% endfor %}
</div>
<div class="dosing-note" style="margin-top:2mm;">
투약 기간: {{ drug.dosage.duration }}
</div>
</div> </div>
{% if drug.cat_warning %} {% if drug.cat_warning %}
<div class="contraindication-box"> <div class="contraindication-box">
<div class="contraindication-title">🐱 고양이 특별 주의</div> <div class="contraindication-title">🐱 고양이 주의</div>
<ul class="contraindication-list"> <div style="font-size:5pt;">최대: {{ drug.cat_warning.max_dose }} ({{ drug.cat_warning.risk }})</div>
<li>❌ 최대 용량: {{ drug.cat_warning.max_dose }}</li>
<li>❌ 위험: {{ drug.cat_warning.risk }}</li>
</ul>
</div> </div>
{% endif %} {% endif %}
{% elif drug.category == 'antiemetic' %} {% elif drug.category == 'antiemetic' %}
<!-- 항구토제 레이아웃 --> <!-- 항구토제 -->
<div class="dosing-section"> <div class="dosing-section">
<div class="dosing-title">📋 적응증</div> <div class="dosing-title">📋 {{ drug.indication }}</div>
<div class="dosing-main">{{ drug.indication }}</div>
</div> </div>
<div class="usage-box">
<div class="coverage-section"> <b>급성구토:</b> {{ drug.dosage.acute_vomiting.dose }} ({{ drug.dosage.acute_vomiting.duration }})<br>
<div class="coverage-title">💊 용법용량</div> <b>멀미예방:</b> {{ drug.dosage.motion_sickness.dose }} ({{ drug.dosage.motion_sickness.timing }})
<div class="coverage-table" style="grid-template-columns: 1fr 1fr;">
<div class="coverage-item covered">
<span class="coverage-name" style="font-weight:700;">급성 구토</span>
<span style="font-size:8pt;">{{ drug.dosage.acute_vomiting.dose }}</span>
<span style="font-size:6pt;">최대 {{ drug.dosage.acute_vomiting.duration }}</span>
</div>
<div class="coverage-item covered">
<span class="coverage-name" style="font-weight:700;">멀미 예방</span>
<span style="font-size:8pt;">{{ drug.dosage.motion_sickness.dose }}</span>
<span style="font-size:6pt;">{{ drug.dosage.motion_sickness.timing }}</span>
</div>
</div>
</div>
{% if drug.clinical_notes %}
<div class="gap-warning">
<div class="gap-warning-title">💡 임상 참고</div>
{% for note in drug.clinical_notes %}
<div class="gap-solution">• {{ note }}</div>
{% endfor %}
</div>
{% endif %}
{% elif drug.category in ['otic', 'antifungal', 'topical'] %}
<!-- 외용제 레이아웃 -->
<div class="dosing-section">
<div class="dosing-title">📋 적응증</div>
<div class="dosing-main" style="font-size:7pt;">{{ drug.indication }}</div>
</div>
<div class="dosage-table-section">
<div class="coverage-title" style="font-size:7pt;">💊 용법</div>
<div style="font-size:6pt; background:#E8F5E9; padding:1.5mm; border-radius:1mm;">
{% if drug.dosage.frequency %}
<div><b>빈도:</b> {{ drug.dosage.frequency }}</div>
{% endif %}
{% if drug.dosage.duration %}
<div><b>기간:</b> {{ drug.dosage.duration }}</div>
{% endif %}
{% if drug.dosage.contact_time %}
<div><b>접촉시간:</b> {{ drug.dosage.contact_time }}</div>
{% endif %}
{% if drug.dosage.amount %}
<div><b>용량:</b> {{ drug.dosage.amount }}</div>
{% endif %}
</div>
</div> </div>
{% else %} {% else %}
<!--본 레이아웃 --> <!--타 (외용제 등) -->
<div class="dosing-section"> <div class="dosing-section">
<div class="dosing-title">📋 적응증</div> <div class="dosing-title">📋 {{ drug.indication }}</div>
<div class="dosing-main">{{ drug.indication }}</div> </div>
{% if drug.dosage %}
<div class="usage-box">
{% if drug.dosage.frequency %}<b>빈도:</b> {{ drug.dosage.frequency }}<br>{% endif %}
{% if drug.dosage.duration %}<b>기간:</b> {{ drug.dosage.duration }}<br>{% endif %}
{% if drug.dosage.contact_time %}<b>접촉:</b> {{ drug.dosage.contact_time }}{% endif %}
</div> </div>
{% endif %} {% endif %}
{% endif %}
<!-- 공통: 주의사항 --> <!-- 주의사항 -->
{% if drug.warnings %} {% if drug.warnings %}
<div class="warnings-section"> <div class="warnings-section">
<div class="warnings-title">⚠️ 주의사항</div> <div class="warnings-title">⚠️ 주의</div>
<ul class="warnings-list"> <ul class="warnings-list">
{% for warning in drug.warnings %} {% for w in drug.warnings[:3] %}<li>{{ w[:40] }}{% if w|length > 40 %}...{% endif %}</li>{% endfor %}
<li>{{ warning }}</li>
{% endfor %}
</ul> </ul>
</div> </div>
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% if loop.index % 4 == 0 or loop.last %}
</div><!-- drug-cards-grid -->
{% if loop.last %}
<!-- 푸터 (마지막 페이지만) -->
<div class="footer">
<div class="footer-logo">🐾 동물약 복약안내 시스템 v2</div>
※ 본 안내문은 참고용입니다.
</div>
{% endif %}
</div><!-- page -->
{% endif %}
{% endfor %} {% endfor %}
<!-- 푸터 제거됨 (위에서 처리) -->
</div> </div>
{% if loop.last %}
<!-- 푸터 (마지막 페이지만) -->
<div class="footer">
<div class="footer-logo">🐾 동물약 복약안내 v2</div>
※ 참고용 안내문입니다. 정확한 투약은 수의사 지시에 따르세요.
</div>
{% endif %}
</div>
{% endfor %}
</body> </body>
</html> </html>