Merge pull request #357 from chengzhongxue/main

适配1.3友链插件
This commit is contained in:
困困鱼 2023-08-03 12:14:04 +08:00 committed by GitHub
commit 73a99f8481
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 21 deletions

View File

@ -36,7 +36,6 @@ spec:
- $formkit: "textarea"
name: "description"
label: "描述"
value: ""
---
@ -52,12 +51,10 @@ spec:
- $formkit: "attachment"
name: "siteshot"
label: "背景"
value: ""
- $formkit: "text"
name: "label"
label: "标签"
value: ""
- $formkit: "color"
name: "labelColor"
value: "#425AEF"
label: "标签颜色"
label: "标签颜色"

View File

@ -74,18 +74,20 @@
[[${group.spec.displayName}]] ([[${group.links.size}]])
</h2>
<div class="flink-desc">[[${group.metadata.annotations.description}]]</div>
<div class="flink-desc" th:if="${not #strings.isEmpty(#annotations.get(group, 'description'))}">[[${#annotations.get(group, 'description')}]]</div>
<!-- 第一个,使用卡片展示 -->
<div th:if="${#strings.equals(group.metadata.annotations.displayStyle,'beautify') && not #lists.isEmpty(group.links)}"
<div th:if="${#strings.equals(#annotations.get(group, 'displayStyle'),'beautify') && not #lists.isEmpty(group.links)}"
class="site-card-group">
<div class="site-card" th:each="link : ${group.links}">
<span th:if="${not #strings.isEmpty(link.metadata.annotations.label)}"
th:style="'background-color:' + ${link.metadata.annotations.labelColor}"
class="site-card-tag">[[${link.metadata.annotations.label}]]</span>
<span th:if="${not #strings.isEmpty(#annotations.get(link, 'label'))}"
th:style="'background-color:' + ${#annotations.get(link,'labelColor')}"
class="site-card-tag">[[${#annotations.get(link, 'label')}]]</span>
<a class="img" target="_blank" th:href="${link.spec.url}" th:title="${link.spec.displayName}">
<img class="flink-avatar" style="pointer-events: none;" th:alt="${link.spec.displayName}"
th:src="@{${#strings.isEmpty(link.metadata.annotations.siteshot) ? link.spec.logo : link.metadata.annotations.siteshot}}">
th:src="@{${#strings.isEmpty(#annotations.get(link, 'siteshot')) ? link.spec.logo : #annotations.get(link,'siteshot') }}">
</a>
<a class="info cf-friends-link" target="_blank" th:href="${link.spec.url}"
@ -106,11 +108,11 @@
</div>
<div class="flink-list"
th:if="${#strings.equals(group.metadata.annotations.displayStyle,'default') && not #lists.isEmpty(group.links)}">
th:if="${#strings.equals(#annotations.get(group, 'displayStyle'),'default') && not #lists.isEmpty(group.links)}">
<div class="flink-list-item" th:each="link : ${group.links}">
<span th:if="${not #strings.isEmpty(link.metadata.annotations.label)}"
th:style="'background-color:' + ${link.metadata.annotations.labelColor}"
class="site-card-tag">[[${link.metadata.annotations.label}]]</span>
<span th:if="${not #strings.isEmpty(#annotations.get(link, 'label'))}"
th:style="'background-color:' + ${#annotations.get(link,'labelColor')}"
class="site-card-tag">[[${#annotations.get(link, 'label')}]]</span>
<a class="cf-friends-link" rel="external nofollow" target="_blank" th:href="${link.spec.url}"
th:title="${link.spec.displayName}">
<img class="flink-avatar cf-friends-avatar" th:alt="${link.spec.displayName}"
@ -126,7 +128,7 @@
</div>
<div class="flink-list mini"
th:if="${#strings.equals(group.metadata.annotations.displayStyle,'deprecated') && not #lists.isEmpty(group.links)}">
th:if="${#strings.equals(#annotations.get(group, 'displayStyle'),'deprecated') && not #lists.isEmpty(group.links)}">
<div class="flink-list-item" th:each="link : ${group.links}">
<a class="cf-friends-link" rel="external nofollow" target="_blank" th:href="${link.spec.url}"
th:title="${link.spec.displayName}">
@ -150,4 +152,4 @@
</div>
</th:block>
</th:block>
</th:block>

View File

@ -8,9 +8,9 @@
th:if="${pluginFinder.available('PluginLinks')}"
th:with="groups = ${linkFinder.groupBy()}">
<th:block th:each="group,iterStat : ${groups}">
<details th:if="${group.metadata.annotations.displayStyle != 'deprecated' && not #strings.isEmpty(group.metadata.annotations.displayStyle) && not #lists.isEmpty(group.links)}"
<details th:if="${#annotations.get(group, 'displayStyle') != 'deprecated' && not #strings.isEmpty(#annotations.get(group, 'displayStyle')) && not #lists.isEmpty(group.links)}"
class="card-friend-class-name">
<summary class="card-friend-class-desc" th:title="${group.metadata.annotations.description}">
<summary class="card-friend-class-desc" th:title="${#annotations.get(group, 'description')}">
<sapn>[[${group.spec.displayName}]]</sapn>
<sapn>[[${group.links.size}]]</sapn>
</summary>
@ -25,9 +25,9 @@
</div>
</a>
</details>
<details th:if="${#strings.equals(group.metadata.annotations.displayStyle,'deprecated') && not #lists.isEmpty(group.links)}"
<details th:if="${#strings.equals(#annotations.get(group, 'displayStyle'),'deprecated') && not #lists.isEmpty(group.links)}"
class="card-friend-class-name">
<summary class="card-friend-class-desc" th:title="${group.metadata.annotations.description}">
<summary class="card-friend-class-desc" th:title="${#annotations.get(group, 'description')}">
<sapn>[[${group.spec.displayName}]]</sapn>
<sapn>[[${group.links.size}]]</sapn>
</summary>
@ -49,4 +49,4 @@
</div>
</html>
</html>