Custom navbar (wip)

master
Shad Amethyst 2 years ago
parent 7f3f6e80d0
commit 57303daf00
Signed by: amethyst
GPG Key ID: D970C8DD1D6DEE36

@ -48,17 +48,23 @@
Here's a handy button for you: Here's a handy button for you:
</p> </p>
<div class="ui middle grid"> <div class="ui middle grid" style="margin-bottom: 1em;">
<div class="sixteen wide center aligned centered row"> <div class="sixteen wide center aligned centered row">
<a class="ui button" href="{{AppSubUrl}}/user/oauth2/github">Login via Github</a> <a role="button" class="ui button" href="{{AppSubUrl}}/user/oauth2/github">Sign In via Github</a>
</div> </div>
</div> </div>
<h3>About Github sign-in</h3>
<p> <p>
The current solution for contributions (Login via Github) is more of a temporary solution, as I'm waiting for The current solution for contributions (Sign In via Github) is more of a temporary solution, as I'm waiting for
<a href="https://github.com/go-gitea/gitea/issues/18240">federation support for Gitea</a> to get implemented. <a href="https://github.com/go-gitea/gitea/issues/18240">federation support for Gitea</a> to get implemented.
</p> </p>
<p>
New accounts created this way will not be able to create repositories, nor can they create organizations.
</p>
<p> <p>
If you'd like to host repositories on this instance or if you'd like to get an account without using Github, If you'd like to host repositories on this instance or if you'd like to get an account without using Github,
then please contact me directly (you'll find my contact infos on my <a href="https://shadamethyst.xyz/">main website</a>). then please contact me directly (you'll find my contact infos on my <a href="https://shadamethyst.xyz/">main website</a>).

@ -0,0 +1,106 @@
<div class="dashboard-navbar">
<div class="ui secondary stackable menu">
<div class="item">
<div class="ui floating dropdown link jump">
<span class="text truncated-item-container">
{{avatar .ContextUser}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
{{if .ContextUser.IsOrganization}}
<span class="org-visibility">
{{if .ContextUser.Visibility.IsLimited}}<div class="ui orange tiny horizontal label">{{.i18n.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
{{if .ContextUser.Visibility.IsPrivate}}<div class="ui red tiny horizontal label">{{.i18n.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
</span>
{{end}}
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</span>
<div class="context user overflow menu" tabindex="-1">
<div class="ui header">
{{.i18n.Tr "home.switch_dashboard_context"}}
</div>
<div class="scrolling menu items">
<a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item truncated-item-container" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{else if .PageIsMilestonesDashboard}}milestones{{end}}">
{{avatar .SignedUser}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</a>
{{range .Orgs}}
<a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item truncated-item-container" title="{{.Name}}" href="{{.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
{{avatar .}}
<span class="truncated-item-name">{{.ShortName 40}}</span>
<span class="org-visibility">
{{if .Visibility.IsLimited}}<div class="ui orange tiny horizontal label">{{$.i18n.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
{{if .Visibility.IsPrivate}}<div class="ui red tiny horizontal label">{{$.i18n.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
</span>
</a>
{{end}}
</div>
{{if .SignedUser.CanCreateOrganization}}
<a class="item" href="{{AppSubUrl}}/org/create">
{{svg "octicon-plus"}}&nbsp;&nbsp;&nbsp;{{.i18n.Tr "new_org"}}
</a>
{{end}}
</div>
</div>
</div>
{{if .ContextUser.IsOrganization}}
<div class="item">
<div class="ui floating dropdown link jump">
<span class="text">
{{svg "octicon-people" 18}}
{{if .Team}}
{{.Team.Name}}
{{else}}
{{.i18n.Tr "org.teams"}}
{{end}}
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</span>
<div class="context user overflow menu" tabindex="-1">
<div class="ui header">
{{.i18n.Tr "home.filter_by_team_repositories"}}
</div>
<div class="scrolling menu items">
<a class="{{if not $.Team}}active selected{{end}} item" title="{{.i18n.Tr "all"}}" href="{{$.Org.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
{{.i18n.Tr "all"}}
</a>
{{range .Teams}}
{{if not .IncludesAllRepositories}}
<a class="{{if $.Team}}{{if eq $.Team.ID .ID}}active selected{{end}}{{end}} item" title="{{.Name}}" href="{{$.Org.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}/{{.Name}}">
{{.Name}}
</a>
{{end}}
{{end}}
</div>
</div>
</div>
</div>
{{end}}
{{if .ContextUser.IsOrganization}}
<div class="right stackable menu">
<a class="{{if .PageIsNews}}active{{end}} item" style="margin-left: auto" href="{{.ContextUser.DashboardLink}}{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
{{svg "octicon-rss"}}&nbsp;{{.i18n.Tr "activities"}}
</a>
{{if not .UnitIssuesGlobalDisabled}}
<a class="{{if .PageIsIssues}}active{{end}} item" href="{{.ContextUser.OrganisationLink}}/issues{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
{{svg "octicon-issue-opened"}}&nbsp;{{.i18n.Tr "issues"}}
</a>
{{end}}
{{if not .UnitPullsGlobalDisabled}}
<a class="{{if .PageIsPulls}}active{{end}} item" href="{{.ContextUser.OrganisationLink}}/pulls{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
{{svg "octicon-git-pull-request"}}&nbsp;{{.i18n.Tr "pull_requests"}}
</a>
{{end}}
{{if and .ShowMilestonesDashboardPage (not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled))}}
<a class="{{if .PageIsMilestonesDashboard}}active{{end}} item" href="{{.ContextUser.OrganisationLink}}/milestones{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
{{svg "octicon-milestone"}}&nbsp;{{.i18n.Tr "milestones"}}
</a>
{{end}}
<div class="item">
<a class="ui primary basic button" href="{{.ContextUser.HomeLink}}" title='{{.i18n.Tr "home.view_home" .ContextUser.Name}}'>
{{.i18n.Tr "home.view_home" (.ContextUser.ShortName 40)}}
</a>
</div>
</div>
{{end}}
</div>
</div>
<div class="ui divider"></div>
Loading…
Cancel
Save