更新公告展示
This commit is contained in:
@@ -8,6 +8,7 @@ import Icon from '../components/Icon.vue'
|
||||
import Logo from '../components/Logo.vue'
|
||||
import { pointsLabel } from '../credits'
|
||||
import { draft } from '../playground'
|
||||
import { announcement, openAnnouncement } from '../announcement'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
@@ -73,7 +74,7 @@ const currentLabel = computed(() => {
|
||||
</router-link>
|
||||
</nav>
|
||||
|
||||
<!-- Bottom: admin shortcut (admins only) + settings -->
|
||||
<!-- Bottom: admin shortcut (admins only) + 公告 + settings -->
|
||||
<div class="flex flex-col items-center gap-3">
|
||||
<router-link v-if="isAdmin()" to="/admin/overview" title="进入管理后台"
|
||||
class="rail-bottom">
|
||||
@@ -86,6 +87,12 @@ const currentLabel = computed(() => {
|
||||
<svg v-if="isDark" class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>
|
||||
<svg v-else class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>
|
||||
</button>
|
||||
<!-- 公告 — sits right above 设置. Only for logged-in users, and only
|
||||
when there actually is an announcement to show. -->
|
||||
<button v-if="isAuthed() && announcement.content.trim()" type="button"
|
||||
@click="openAnnouncement" title="公告" class="rail-bottom">
|
||||
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 11l18-7-4 14-6-3-3 4-1-6z"/></svg>
|
||||
</button>
|
||||
<router-link to="/settings" title="设置" @click="onSettings"
|
||||
:class="$route.path === '/settings' ? 'rail-bottom active' : 'rail-bottom'">
|
||||
<Icon name="config" class="w-4 h-4" />
|
||||
|
||||
Reference in New Issue
Block a user