Skip to content

Commit

Permalink
调整登录扩展能力可选个人,未完
Browse files Browse the repository at this point in the history
  • Loading branch information
mjsoftking committed Dec 16, 2024
1 parent d8bd2d8 commit 7457a30
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
10 changes: 6 additions & 4 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,14 @@ spec:
name: expand_login_skill
label: 扩展登录后能力
help: 开启后,在文章详情界面,根据作者身份显示编辑按钮。控制台按钮 - 登录组件样式 添加 新建文章 和 发布瞬间 菜单项。登录用户需要具有进入控制台的权限。
value: true
value: 'console'
options:
- label: 开启
value: true
- label: 控制台
value: 'console'
- label: 个人
value: 'uc'
- label: 关闭
value: false
value: 'none'
- $formkit: radio
name: load_progress
label: 加载进度条
Expand Down
12 changes: 7 additions & 5 deletions templates/common/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,20 @@
th:title="${theme.config.basic_style.console.console_title}">
<i th:class="${#strings.defaultString(theme.config.basic_style.console.console_icon, 'ri-equalizer-line')}"></i>
</a>
<div th:if="${theme.config.basic_style.show_console == 'logon'}" class="navbar-logon" trigger="hover" th:with="currentUser = ${contributorFinder.getContributor(#authentication.name)}">
<div th:if="${theme.config.basic_style.show_console == 'logon'}" class="navbar-logon" trigger="hover"
th:with="currentUser = ${contributorFinder.getContributor(#authentication.name)},
skillUrl = ${theme.config.basic_style.expand_login_skill}">
<div class="navbar-logon-head">
<img th:src="${currentUser.avatar ?: #theme.assets('/img/avatar.svg')}"
th:alt="${currentUser.displayName}"
/>
</div>
<ul class="navbar-logon-group">
<li th:if="${theme.config.basic_style.expand_login_skill && !#strings.isEmpty(logonUserName)}" class="navbar-logon-group-menu">
<a href="/console/posts/editor" target="_blank"><i th:if="${!#strings.isEmpty(theme.config.basic_style.logon.console_person_class)}" th:class="${theme.config.basic_style.logon.console_post_class}"></i> 新建文章</a>
<li th:if="${skillUrl != 'none' && !#strings.isEmpty(logonUserName)}" class="navbar-logon-group-menu">
<a th:href="@{|/${skillUrl}/posts/editor|}" target="_blank"><i th:if="${!#strings.isEmpty(theme.config.basic_style.logon.console_person_class)}" th:class="${theme.config.basic_style.logon.console_post_class}"></i> 新建文章</a>
</li>
<li th:if="${theme.config.basic_style.expand_login_skill && !#strings.isEmpty(logonUserName)}" class="navbar-logon-group-menu">
<a href="/console/moments" target="_blank"><i th:if="${!#strings.isEmpty(theme.config.basic_style.logon.console_person_class)}" th:class="${theme.config.basic_style.logon.console_moment_class}"></i> 发布瞬间</a>
<li th:if="${skillUrl != 'none' && !#strings.isEmpty(logonUserName)}" class="navbar-logon-group-menu">
<a th:href="@{|/${skillUrl}/moments|}" target="_blank"><i th:if="${!#strings.isEmpty(theme.config.basic_style.logon.console_person_class)}" th:class="${theme.config.basic_style.logon.console_moment_class}"></i> 发布瞬间</a>
</li>
<li th:if="${!#strings.isEmpty(logonUserName)}" class="navbar-logon-group-menu">
<a href="/uc" target="_blank"><i th:if="${!#strings.isEmpty(theme.config.basic_style.logon.console_person_class)}" th:class="${theme.config.basic_style.logon.console_person_class}"></i> 个人中心</a>
Expand Down
9 changes: 5 additions & 4 deletions templates/main/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
th:fragment="article (post, type)"
th:with="updateInterval = ${T(java.lang.Math).floor((#dates.createNow().getTime()/1000.0 - post.status.lastModifyTime.getEpochSecond())/86400.0).intValue()},
isPost = ${type == 'Post'},
skillUrl = ${theme.config.basic_style.expand_login_skill},
thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : thumbnail.gen(post.spec.cover, 'xl')}">

<div th:if="${!#strings.isEmpty(thumbnail)}" class="card widget">
Expand All @@ -19,8 +20,8 @@ <h1 class="title" th:text="${post.spec.title}"></h1>
</li>
<li><i class="ri-thumb-up-line"></i>[[${post.stats.upvote}]]</li>
<li><i class="ri-quill-pen-line"></i>[[${#strings.length(#strings.trim(post.content.content))}]]</li>
<li th:if="${theme.config.basic_style.expand_login_skill && logonUserName == post.spec.owner}" class="is-hidden-laptop">
<a target="_blank" title="编辑文章" th:href="@{|/console/${isPost ? 'posts' : 'single-pages'}/editor?name=${post.metadata.name}|}"><i class="ri-edit-2-line"></i>编辑</a></li>
<li th:if="${logonUserName == post.spec.owner && (skillUrl == 'console' || (skillUrl == 'uc' && isPost))}" class="is-hidden-laptop">
<a target="_blank" title="编辑文章" th:href="@{|/${skillUrl}/${isPost ? 'posts' : 'single-pages'}/editor?name=${post.metadata.name}|}"><i class="ri-edit-2-line"></i>编辑</a></li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -48,8 +49,8 @@ <h1 class="title" th:text="${post.spec.title}"></h1>
</li>
<li><i class="ri-thumb-up-line"></i>[[${post.stats.upvote}]]</li>
<li><i class="ri-quill-pen-line"></i>[[${#strings.length(#strings.trim(post.content.content))}]]</li>
<li th:if="${theme.config.basic_style.expand_login_skill && logonUserName == post.spec.owner}" class="is-hidden-laptop">
<a target="_blank" title="编辑文章" th:href="@{|/console/${isPost ? 'posts' : 'single-pages'}/editor?name=${post.metadata.name}|}"><i class="ri-edit-2-line"></i>编辑</a></li>
<li th:if="${logonUserName == post.spec.owner && (skillUrl == 'console' || (skillUrl == 'uc' && isPost))}" class="is-hidden-laptop">
<a target="_blank" title="编辑文章" th:href="@{|/skillUrl/${isPost ? 'posts' : 'single-pages'}/editor?name=${post.metadata.name}|}"><i class="ri-edit-2-line"></i>编辑</a></li>
</ul>
<div th:if="${isPost && !#lists.isEmpty(post.categories)}" class="level-item">
<a th:each="cy : ${post.categories}" th:href="${cy.status.permalink}"
Expand Down

0 comments on commit 7457a30

Please sign in to comment.