Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: optimize post edit button position #177

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/assets/dist/style.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions templates/modules/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
th:if="${theme.config.global.show_scroll_button}"
type="button"
id="btn-scroll-to-top"
class="fixed bottom-5 right-5 flex items-center justify-center rounded-full bg-gray-800 p-3 opacity-0 shadow transition-all duration-300 hover:opacity-70 hover:shadow-lg dark:bg-slate-600 lg:bottom-10 lg:right-10"
class="fixed bottom-5 right-5 flex items-center justify-center rounded-full bg-white p-3 opacity-0 shadow transition-all duration-300 hover:opacity-70 hover:shadow-lg dark:bg-slate-600 lg:bottom-10 lg:right-10"
>
<span class="i-tabler-chevron-up text-2xl text-white dark:text-slate-200"></span>
<span class="i-tabler-chevron-up text-2xl text-gray-600 dark:text-slate-200"></span>
</button>
</body>
</html>
18 changes: 9 additions & 9 deletions templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@
</div>
</div>
<div class="inline-flex flex-row gap-1">
<div sec:authorize="isAuthenticated()" class="flex items-center justify-between" id="edit-button">
<a
th:href="|/console/single-pages/editor?name=${singlePage.metadata.name}&returnToView=true|"
class="inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600 dark:hover:text-white"
>
<span class="i-tabler-edit text-lg transition-all group-hover:-translate-x-1"></span>
<span>编辑</span>
</a>
</div>
<a
th:if="${haloCommentEnabled}"
href="#comment"
Expand Down Expand Up @@ -77,14 +86,5 @@ <h2 class="mb-2 text-base font-medium text-gray-900 dark:text-slate-50">评论</
<halo:comment group="content.halo.run" kind="SinglePage" th:attr="name=${singlePage.metadata.name}" />
</div>
</div>

<a
sec:authorize="isAuthenticated()"
th:href="|/console/single-pages/editor?name=${singlePage.metadata.name}&returnToView=true|"
id="edit-button"
class="fixed bottom-10 right-10 flex size-14 items-center justify-center rounded-full bg-[#4CCBA0] text-white shadow transition-all duration-300 hover:opacity-80 hover:shadow-lg"
>
<div class="i-tabler-edit !size-7"></div>
</a>
</th:block>
</html>
18 changes: 9 additions & 9 deletions templates/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ <h2 class="inline-flex items-center gap-2 text-base dark:text-slate-50">
</div>
</div>
<div class="flex flex-row items-center gap-1.5 self-end">
<div sec:authorize="isAuthenticated()" class="flex items-center justify-between" id="edit-button">
<a
th:href="|/console/posts/editor?name=${post.metadata.name}&returnToView=true|"
class="inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600 dark:hover:text-white"
>
<span class="i-tabler-edit text-lg transition-all group-hover:-translate-x-1"></span>
<span>编辑</span>
</a>
</div>
<div
th:if="${theme.config.post.show_upvote_button}"
@click="handleUpvote(name)"
Expand Down Expand Up @@ -164,14 +173,5 @@ <h2 class="mb-2 text-base font-medium text-gray-900 dark:text-slate-50">评论</
<halo:comment group="content.halo.run" kind="Post" th:attr="name=${post.metadata.name}" />
</div>
</div>

<a
sec:authorize="isAuthenticated()"
th:href="|/console/posts/editor?name=${post.metadata.name}&returnToView=true|"
id="edit-button"
class="fixed bottom-10 right-10 flex size-14 items-center justify-center rounded-full bg-[#4CCBA0] text-white shadow transition-all duration-300 hover:opacity-80 hover:shadow-lg"
>
<div class="i-tabler-edit !size-7"></div>
</a>
</th:block>
</html>