Files
theme-earth/templates/modules/footer-social.html
Ryan Wang 140612c8d5 refactor: simplify the setting form (#184)
简化设置表单的部分选项,并提供旧数据的兼容。

before:

<img width="627" alt="image" src="https://github.com/user-attachments/assets/511da020-faed-43bb-95b7-2dcc17dfe90d">
<img width="562" alt="image" src="https://github.com/user-attachments/assets/08f7cd4b-ec85-4157-9c2a-5aa7384aa1ab">

after:

<img width="562" alt="image" src="https://github.com/user-attachments/assets/360462e2-35b7-4de6-8435-05a324dbb5d3">
<img width="561" alt="image" src="https://github.com/user-attachments/assets/e4fc8876-9152-424c-b49c-c438f20a0403">


```release-note
简化设置表单的部分选项
```
2024-09-13 08:20:26 +00:00

23 lines
947 B
HTML

<th:block th:with="social_media = ${theme.config.footer.social_media}">
<div th:unless="${#lists.isEmpty(social_media)}" class="mt-4 flex justify-center space-x-6 sm:mt-0">
<th:block th:each="item : ${social_media}">
<a
th:if="${item.url_type == 'normal'}"
th:href="${item.url}"
class="text-gray-500 hover:text-gray-900 dark:hover:text-white"
th:title="${item.name}"
>
<div th:classappend="${item.icon}" class="size-5"></div>
</a>
<span
th:if="${item.url_type == 'image'}"
th:attr="x-data=|{openImageModal:false,image: '${item.url}', alt: '${item.name}'}|"
class="cursor-pointer text-gray-500 hover:text-gray-900 dark:hover:text-white"
>
<div th:classappend="${item.icon}" class="size-5" @click="openImageModal = true"></div>
<th:block th:replace="~{modules/image-view-modal}" />
</span>
</th:block>
</div>
</th:block>