fix: 修复space模板if/else-if链导致闭合div丢失 + 多余{{end}}导致模板解析panic
- 将所有tab分支从if/else-if链改为独立{{if}}块
- 修复关注/粉丝列表内层if/else-if链
- 删除多余的{{end}}避免模板解析panic
This commit is contained in:
@ -175,7 +175,8 @@
|
||||
</main>
|
||||
|
||||
{{/* ========== 关注列表 Tab(含本人+访客) ==========*/}}
|
||||
{{else if or (eq .ActiveTab "following") (eq .ActiveTab "followers")}}
|
||||
{{end}}
|
||||
{{if or (eq .ActiveTab "following") (eq .ActiveTab "followers")}}
|
||||
<!-- 左侧导航 -->
|
||||
<aside class="space-sidebar">
|
||||
<h2 class="space-sidebar-title">{{if .IsOwnSpace}}我的关注{{else}}Ta的关注{{end}}</h2>
|
||||
@ -266,9 +267,10 @@
|
||||
{{else}}
|
||||
<div class="space-empty-state"><p>暂无数据</p></div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
{{/* ---- 粉丝列表 ---- */}}
|
||||
{{else if eq .ActiveTab "followers"}}
|
||||
{{if eq .ActiveTab "followers"}}
|
||||
{{if .FollowersResult}}
|
||||
{{if .FollowersResult.Accessible}}
|
||||
{{if eq (len .FollowersResult.Items) 0}}
|
||||
@ -332,7 +334,8 @@
|
||||
</main>
|
||||
|
||||
{{/* ========== 收藏夹 Tab(仅本人) ==========*/}}
|
||||
{{else if eq .ActiveTab "collections"}}
|
||||
{{end}}
|
||||
{{if eq .ActiveTab "collections"}}
|
||||
<!-- 左侧收藏夹列表 -->
|
||||
<aside class="space-sidebar collection-sidebar">
|
||||
<h2 class="space-sidebar-title collapsible" onclick="toggleFolderSection(this)">
|
||||
@ -423,7 +426,8 @@
|
||||
</main>
|
||||
|
||||
{{/* ========== 设置 Tab(仅本人) ==========*/}}
|
||||
{{else if eq .ActiveTab "settings"}}
|
||||
{{end}}
|
||||
{{if eq .ActiveTab "settings"}}
|
||||
<main class="space-main-full settings-main">
|
||||
<h1 class="space-section-title">隐私设置</h1>
|
||||
<div class="privacy-settings-grid">
|
||||
@ -564,6 +568,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
{{end}}
|
||||
</div><!-- /.space-card-layout -->
|
||||
|
||||
</div><!-- /.space-page -->
|
||||
@ -724,6 +729,5 @@ document.querySelectorAll('#privacy-follow-list, #privacy-follower-list').forEac
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user