Spaces:
Running on Zero
Running on Zero
Update html_templates.py
Browse files21 unmodified lines2223242526272879 unmodified lines10810911011111211320 unmodified lines134135136137138139263 unmodified lines40340440540640740840936 unmodified lines446447448449450451452407 unmodified lines86086186286386486586660 unmodified lines92792892993093193293338 unmodified lines97297397497597697721 unmodified linesdef get_color_scheme(is_single_dog: bool) -> Union[str, List[str]]:"""Get color scheme for dog detection visualization."""single_dog_color = '#34C759' # 清爽的綠色作為單狗顏色color_list = ['#FF5733', # 珊瑚紅'#28A745', # 深綠色79 unmodified lines</div>'''def format_description_html(description: Dict[str, Any], breed: str) -> str:"""Format basic breed description with tooltips."""if not isinstance(description, dict):20 unmodified linesreturn f'<ul style="list-style-type: none; padding-left: 0;">{" ".join(html_parts)}</ul>'def format_tooltip(key: str, value: str) -> str:"""Format tooltip with content for each field."""tooltip_contents = {263 unmodified lines{format_noise_items(barking_triggers)}</div><div class="disclaimer-section" style="margin-top: 15px; font-size: 0.9em; color: #666;"><p class="disclaimer-text source-text">Source: Compiled from various breed behavior resources, 2024</p><p class="disclaimer-text">Individual dogs may vary in their vocalization patterns.</p><p class="disclaimer-text">Training can significantly influence barking behavior.</p><p class="disclaimer-text">Environmental factors may affect noise levels.</p>36 unmodified lines{format_health_items(health_screenings)}</div><div class="disclaimer-section" style="margin-top: 15px; font-size: 0.9em; color: #666;"><p class="disclaimer-text source-text">Source: Compiled from various veterinary and breed information resources, 2024</p><p class="disclaimer-text">This information is for reference only and based on breed tendencies.</p><p class="disclaimer-text">Each dog is unique and may not develop any or all of these conditions.</p><p class="disclaimer-text">Always consult with qualified veterinarians for professional advice.</p>407 unmodified lines{format_noise_items(barking_triggers)}</div><div style="margin-top: 20px; padding-top: 16px; border-top: 1px solid #e2e8f0;"><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Source: Compiled from various breed behavior resources, 2024</p><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Individual dogs may vary in their vocalization patterns.</p><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Training can significantly influence barking behavior.</p><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Environmental factors may affect noise levels.</p>60 unmodified lines{format_health_items(health_screenings)}</div><div style="margin-top: 20px; padding-top: 16px; border-top: 1px solid #e2e8f0;"><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Source: Compiled from veterinary resources and breed health studies, 2024</p><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Regular vet check-ups are essential for all breeds.</p><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Early detection and prevention are key to managing health issues.</p><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Not all dogs will develop these conditions.</p>38 unmodified lines</div>"""def format_breed_details_html(description: Dict[str, Any], breed: str) -> str:"""Format breed details for the show_details_html function."""return f"""21 unmodified lines2223242526272879 unmodified lines10810911011111211311420 unmodified lines135136137138139140141263 unmodified lines40540640740840941041136 unmodified lines448449450451452453454407 unmodified lines86286386486586686786860 unmodified lines92993093193293393493538 unmodified lines97497597697797897998021 unmodified linesdef get_color_scheme(is_single_dog: bool) -> Union[str, List[str]]:"""Get color scheme for dog detection visualization."""single_dog_color = '#34C759' # 亮綠色作為辨識一隻狗的默認顏色color_list = ['#FF5733', # 珊瑚紅'#28A745', # 深綠色79 unmodified lines</div>'''# 特性分類def format_description_html(description: Dict[str, Any], breed: str) -> str:"""Format basic breed description with tooltips."""if not isinstance(description, dict):20 unmodified linesreturn f'<ul style="list-style-type: none; padding-left: 0;">{" ".join(html_parts)}</ul>'# 提示氣泡def format_tooltip(key: str, value: str) -> str:"""Format tooltip with content for each field."""tooltip_contents = {263 unmodified lines{format_noise_items(barking_triggers)}</div><div class="disclaimer-section" style="margin-top: 15px; font-size: 0.9em; color: #666;"><p class="disclaimer-text source-text">Source: Compiled from various breed behavior resources, 2025</p><p class="disclaimer-text">Individual dogs may vary in their vocalization patterns.</p><p class="disclaimer-text">Training can significantly influence barking behavior.</p><p class="disclaimer-text">Environmental factors may affect noise levels.</p>36 unmodified lines{format_health_items(health_screenings)}</div><div class="disclaimer-section" style="margin-top: 15px; font-size: 0.9em; color: #666;"><p class="disclaimer-text source-text">Source: Compiled from various veterinary and breed information resources, 2025</p><p class="disclaimer-text">This information is for reference only and based on breed tendencies.</p><p class="disclaimer-text">Each dog is unique and may not develop any or all of these conditions.</p><p class="disclaimer-text">Always consult with qualified veterinarians for professional advice.</p>407 unmodified lines{format_noise_items(barking_triggers)}</div><div style="margin-top: 20px; padding-top: 16px; border-top: 1px solid #e2e8f0;"><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Source: Compiled from various breed behavior resources, 2025</p><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Individual dogs may vary in their vocalization patterns.</p><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Training can significantly influence barking behavior.</p><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Environmental factors may affect noise levels.</p>60 unmodified lines{format_health_items(health_screenings)}</div><div style="margin-top: 20px; padding-top: 16px; border-top: 1px solid #e2e8f0;"><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Source: Compiled from veterinary resources and breed health studies, 2025</p><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Regular vet check-ups are essential for all breeds.</p><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Early detection and prevention are key to managing health issues.</p><p style="margin: 0 0 8px 0; color: #4a5568; font-size: 0.9em;">Not all dogs will develop these conditions.</p>38 unmodified lines</div>"""# AKC Linkdef format_breed_details_html(description: Dict[str, Any], breed: str) -> str:"""Format breed details for the show_details_html function."""return f"""
html_templates.py+8-5