In line with the code blog and other dev sites (Wiki, DevTalk) Everything is pretty much copied from the one in blender.org (_navbar_developer.php), with some additions to make it work in Gitea. The styling additions are in the <style> block with the comment "/* Custom styling for Gitea */" The link to "Projects" is projects.blender.org (since it makes sense here but not yet in the Code blog). On the Gitea side, two custom templates have changed: * head_navbar.tpml was changed to add the mobile navbar expand toggle. * body_inner_pre.tpml contains the actual navbar, copied from the blender.org repo with the following changes: * Added <style> block custom for Gitea. * Added custom notifications code from head_navbar.tpml * Added user buttons (notif, create, register, sign in, etc), See the area around "{{/* Here starts the custom styling for gitea. */}}" * In order to style the buttons as such, the class `navbardev-btn` was added to the Register, Sign In, Notifications, Create, and User dropdown buttons.
28 lines
1.3 KiB
Cheetah
28 lines
1.3 KiB
Cheetah
<div class="ui container" id="navbar">
|
|
<div class="item brand mobile-only">
|
|
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
|
|
<i class="sidebar icon"></i>
|
|
</div>
|
|
</div>
|
|
|
|
{{if and .IsSigned .MustChangePassword}}
|
|
{{/* No links */}}
|
|
{{else if .IsSigned}}
|
|
{{if not .UnitIssuesGlobalDisabled}}
|
|
<a class="item {{if .PageIsIssues}}active{{end}}" href="{{AppSubUrl}}/issues">{{.locale.Tr "issues"}}</a>
|
|
{{end}}
|
|
{{if not .UnitPullsGlobalDisabled}}
|
|
<a class="item {{if .PageIsPulls}}active{{end}}" href="{{AppSubUrl}}/pulls">{{.locale.Tr "pull_requests"}}</a>
|
|
{{end}}
|
|
{{if not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled)}}
|
|
{{if .ShowMilestonesDashboardPage}}<a class="item {{if .PageIsMilestonesDashboard}}active{{end}}" href="{{AppSubUrl}}/milestones">{{.locale.Tr "milestones"}}</a>{{end}}
|
|
{{end}}
|
|
<a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a>
|
|
{{else if .IsLandingPageOrganizations}}
|
|
<a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{.locale.Tr "explore"}}</a>
|
|
{{else}}
|
|
<a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a>
|
|
{{end}}
|
|
|
|
{{template "custom/extra_links" .}}
|
|
</div>
|