SHA256
forked from course-team/tjhlp-gitea
官网改版后提问指南在 https://cpp.tongji.sh/Website/qa/ask/, 平台内不再单独留一份: - 删除 customization/custom/public/assets/tjhlp/ask-guide.html - home.tmpl(「按模板提问」卡片 + 底部相关站点)、base/head_navbar.tmpl(未登录导航 与用户菜单两处)、学期答疑入口卡片: 全部改指官网 /Website/qa/ask/ - issue-templates 两个 config.yaml 同样改指官网; general 里原来那条「答疑平台提问指南」 (指向平台内副本)直接去掉, 只剩「提问指南」+「课程官网」两条官网入口 - 顺手修掉两个已失效的官网地址: /Website/faq/ -> /Website/qa/faq/(旧的是跳转页), /Website/contact -> /Website/contact.html(旧地址现在 404) - custom/public 因此变成空目录, 加 .gitkeep 占位: bind mount 的源目录不存在时 docker compose 会以 root 创建它, 之后普通用户/CI 写不进去(同 options/.gitkeep 的坑) 断言同步: check.sh 与 preview.sh check 改为断言指向 /Website/qa/ask/、页面里没有 ask-question//Website/faq//Website/contact" 这些旧地址、平台内副本已 404。 实测(预览): 首页与导航栏 3 处 qa/ask/、1 处 qa/faq/、1 处 contact.html, 登录后卡片 再 2 处 qa/ask/; 两套检查脚本全过; scripts 80 个测试全过。
194 lines
8.3 KiB
Cheetah
194 lines
8.3 KiB
Cheetah
{{/*
|
|
导航栏, 整文件覆盖 Gitea 内置 templates/base/head_navbar.tmpl。
|
|
相对上游只改了两处: 未登录时的「帮助」和用户菜单里的「帮助」指向课程提问指南,
|
|
不再外链 docs.gitea.com。上游基线见 upstream/<版本>/templates/base/head_navbar.tmpl,
|
|
升级时请 diff 该基线后重新合并, 不要直接覆盖本文件。
|
|
*/}}
|
|
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
|
|
<div class="navbar-left">
|
|
<!-- the logo -->
|
|
<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home_title"}}{{end}}">
|
|
<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
|
|
</a>
|
|
|
|
<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
|
|
<div class="ui secondary menu navbar-mobile-right only-mobile">
|
|
{{template "base/head_navbar_icons" dict "PageGlobalData" .PageGlobalData}}
|
|
<button class="item ui icon mini button tw-m-0" id="navbar-expand-toggle" aria-label="{{ctx.Locale.Tr "home.nav_menu"}}">{{svg "octicon-three-bars"}}</button>
|
|
</div>
|
|
|
|
<!-- navbar links non-mobile -->
|
|
{{if and .IsSigned .MustChangePassword}}
|
|
{{/* No links */}}
|
|
{{else if .IsSigned}}
|
|
{{if not ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}}
|
|
<a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{ctx.Locale.Tr "issues"}}</a>
|
|
{{end}}
|
|
{{if not ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled}}
|
|
<a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{ctx.Locale.Tr "pull_requests"}}</a>
|
|
{{end}}
|
|
{{if not (and ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled)}}
|
|
{{if .ShowMilestonesDashboardPage}}
|
|
<a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{ctx.Locale.Tr "milestones"}}</a>
|
|
{{end}}
|
|
{{end}}
|
|
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore_title"}}</a>
|
|
{{else if .IsLandingPageOrganizations}}
|
|
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{ctx.Locale.Tr "explore_title"}}</a>
|
|
{{else}}
|
|
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore_title"}}</a>
|
|
{{end}}
|
|
|
|
{{template "custom/extra_links" .}}
|
|
|
|
{{if not .IsSigned}}
|
|
<a class="item" href="https://cpp.tongji.sh/Website/">课程官网</a>
|
|
<a class="item" href="https://cpp.tongji.sh/Website/qa/ask/">提问指南</a>
|
|
{{end}}
|
|
</div>
|
|
|
|
<!-- the full dropdown menus -->
|
|
<div class="navbar-right">
|
|
{{if and .IsSigned .MustChangePassword}}
|
|
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
|
|
<span class="text">
|
|
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-1"}}
|
|
<span class="only-mobile">{{.SignedUser.Name}}</span>
|
|
<span class="not-mobile flex-text-block">{{svg "octicon-triangle-down"}}</span>
|
|
</span>
|
|
<div class="menu user-menu">
|
|
<div class="header">
|
|
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
|
</div>
|
|
|
|
<div class="divider"></div>
|
|
<a class="item" href="{{AppSubUrl}}/user/logout">
|
|
{{svg "octicon-sign-out"}}
|
|
{{ctx.Locale.Tr "sign_out"}}
|
|
</a>
|
|
</div><!-- end content avatar menu -->
|
|
</div><!-- end dropdown avatar menu -->
|
|
{{else if .IsSigned}}
|
|
{{template "base/head_navbar_icons" dict "ItemExtraClass" "not-mobile" "PageGlobalData" .PageGlobalData}}
|
|
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}">
|
|
<span class="flex-text-block">
|
|
{{svg "octicon-plus"}}
|
|
<span class="not-mobile flex-text-block">{{svg "octicon-triangle-down"}}</span>
|
|
<span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span>
|
|
</span>
|
|
<div class="menu">
|
|
<a class="item" href="{{AppSubUrl}}/repo/create">
|
|
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
|
|
</a>
|
|
{{if not .DisableMigrations}}
|
|
<a class="item" href="{{AppSubUrl}}/repo/migrate">
|
|
{{svg "octicon-repo-push"}} {{ctx.Locale.Tr "new_migrate"}}
|
|
</a>
|
|
{{end}}
|
|
{{if .SignedUser.CanCreateOrganization}}
|
|
<a class="item" href="{{AppSubUrl}}/org/create">
|
|
{{svg "octicon-organization"}} {{ctx.Locale.Tr "new_org"}}
|
|
</a>
|
|
{{end}}
|
|
</div><!-- end content create new menu -->
|
|
</div><!-- end dropdown menu create new -->
|
|
|
|
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
|
|
<span class="text tw-flex tw-items-center">
|
|
<span class="navbar-avatar">
|
|
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-2"}}
|
|
{{if .IsAdmin}}{{svg "octicon-shield-check" 16 "navbar-admin-badge"}}{{end}}
|
|
</span>
|
|
<span class="only-mobile">{{.SignedUser.Name}}</span>
|
|
<span class="not-mobile flex-text-block">{{svg "octicon-triangle-down"}}</span>
|
|
</span>
|
|
<div class="menu user-menu">
|
|
<div class="header">
|
|
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
|
</div>
|
|
|
|
<div class="divider"></div>
|
|
<a class="item" href="{{.SignedUser.HomeLink}}">
|
|
{{svg "octicon-person"}}
|
|
{{ctx.Locale.Tr "your_profile"}}
|
|
</a>
|
|
{{if not .DisableStars}}
|
|
<a class="item" href="{{.SignedUser.HomeLink}}?tab=stars">
|
|
{{svg "octicon-star"}}
|
|
{{ctx.Locale.Tr "your_starred"}}
|
|
</a>
|
|
{{end}}
|
|
<a class="item" href="{{AppSubUrl}}/notifications/subscriptions">
|
|
{{svg "octicon-bell"}}
|
|
{{ctx.Locale.Tr "notification.subscriptions"}}
|
|
</a>
|
|
<a class="{{if .PageIsUserSettings}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
|
|
{{svg "octicon-tools"}}
|
|
{{ctx.Locale.Tr "your_settings"}}
|
|
</a>
|
|
<a class="item" href="https://cpp.tongji.sh/Website/qa/ask/">
|
|
{{svg "octicon-question"}}
|
|
提问指南
|
|
</a>
|
|
<a class="item" href="https://cpp.tongji.sh/Website/">
|
|
{{svg "octicon-book"}}
|
|
课程官网
|
|
</a>
|
|
{{if .IsAdmin}}
|
|
<div class="divider"></div>
|
|
<a class="{{if .PageIsAdmin}}active {{end}}item" href="{{AppSubUrl}}/-/admin">
|
|
{{svg "octicon-server"}}
|
|
{{ctx.Locale.Tr "admin_panel"}}
|
|
</a>
|
|
{{end}}
|
|
<div class="divider"></div>
|
|
<a class="item" href="{{AppSubUrl}}/user/logout">
|
|
{{svg "octicon-sign-out"}}
|
|
{{ctx.Locale.Tr "sign_out"}}
|
|
</a>
|
|
</div><!-- end content avatar menu -->
|
|
</div><!-- end dropdown avatar menu -->
|
|
{{else}}
|
|
{{if .ShowRegistrationButton}}
|
|
<a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
|
|
{{svg "octicon-person"}}
|
|
<span class="tw-ml-1">{{ctx.Locale.Tr "register"}}</span>
|
|
</a>
|
|
{{end}}
|
|
<a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login">
|
|
{{svg "octicon-sign-in"}}
|
|
<span class="tw-ml-1">{{ctx.Locale.Tr "sign_in"}}</span>
|
|
</a>
|
|
{{end}}
|
|
</div><!-- end full right menu -->
|
|
|
|
{{$activeStopwatch := and .PageGlobalData (call .PageGlobalData.GetActiveStopwatch)}}
|
|
{{if $activeStopwatch}}
|
|
<div class="active-stopwatch-popup tippy-target">
|
|
<div class="flex-text-block tw-p-3">
|
|
<a class="stopwatch-link flex-text-block muted" href="{{$activeStopwatch.IssueLink}}">
|
|
{{svg "octicon-issue-opened" 16}}
|
|
<span class="stopwatch-issue">{{$activeStopwatch.RepoSlug}}#{{$activeStopwatch.IssueIndex}}</span>
|
|
</a>
|
|
<div class="tw-flex tw-gap-1">
|
|
<form class="stopwatch-commit form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/stop">
|
|
<button
|
|
type="submit"
|
|
class="ui button mini compact basic icon tw-mr-0"
|
|
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}"
|
|
>{{svg "octicon-square-fill"}}</button>
|
|
</form>
|
|
<form class="stopwatch-cancel form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/cancel">
|
|
<button
|
|
type="submit"
|
|
class="ui button mini compact basic icon tw-mr-0"
|
|
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}"
|
|
>{{svg "octicon-trash"}}</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</nav>
|
|
{{template "base/head_banner"}}
|