-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Navbar rework for mobile (repo page and more) #14704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
8dd1405
18974e0
00b0eb2
cd03f9e
090cfa3
98aa5b5
4825dfe
f8b611f
cb1db8c
8629c35
226df54
6f8a46d
d38262c
d1e4c53
56522a4
e9cbb30
3a998ac
29cbfb8
493fdec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
<div class="ui secondary pointing tabular top attached borderless stackable menu new-menu navbar"> | ||
<a class="{{if .PageIsExploreRepositories}}active{{end}} item" href="{{AppSubUrl}}/explore/repos"> | ||
{{svg "octicon-repo"}} {{.i18n.Tr "explore.repos"}} | ||
</a> | ||
<a class="{{if .PageIsExploreUsers}}active{{end}} item" href="{{AppSubUrl}}/explore/users"> | ||
{{svg "octicon-person"}} {{.i18n.Tr "explore.users"}} | ||
</a> | ||
<a class="{{if .PageIsExploreOrganizations}}active{{end}} item" href="{{AppSubUrl}}/explore/organizations"> | ||
{{svg "octicon-organization"}} {{.i18n.Tr "explore.organizations"}} | ||
</a> | ||
{{if .IsRepoIndexerEnabled}} | ||
<a class="{{if .PageIsExploreCode}}active{{end}} item" href="{{AppSubUrl}}/explore/code"> | ||
{{svg "octicon-code"}} {{.i18n.Tr "explore.code"}} | ||
</a> | ||
{{end}} | ||
<div class="new-menu-inner"> | ||
<a class="{{if .PageIsExploreRepositories}}active{{end}} item" href="{{AppSubUrl}}/explore/repos"> | ||
{{svg "octicon-repo"}} {{.i18n.Tr "explore.repos"}} | ||
</a> | ||
<a class="{{if .PageIsExploreUsers}}active{{end}} item" href="{{AppSubUrl}}/explore/users"> | ||
{{svg "octicon-person"}} {{.i18n.Tr "explore.users"}} | ||
</a> | ||
<a class="{{if .PageIsExploreOrganizations}}active{{end}} item" href="{{AppSubUrl}}/explore/organizations"> | ||
{{svg "octicon-organization"}} {{.i18n.Tr "explore.organizations"}} | ||
</a> | ||
{{if .IsRepoIndexerEnabled}} | ||
<a class="{{if .PageIsExploreCode}}active{{end}} item" href="{{AppSubUrl}}/explore/code"> | ||
{{svg "octicon-code"}} {{.i18n.Tr "explore.code"}} | ||
</a> | ||
{{end}} | ||
</div> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,53 @@ | ||
<div class="header-wrapper"> | ||
{{with .Repository}} | ||
<div class="ui container"> | ||
<div class="repo-header"> | ||
<div class="repo-header fw"> | ||
<div class="repo-title-wrap df fc"> | ||
<div class="repo-title"> | ||
<div class="repo-title fw"> | ||
{{$avatar := (repoAvatar . 32 "mr-3")}} | ||
{{if $avatar}} | ||
{{if $.PageIsSettings}} | ||
<div class="repo-icon mr-3">{{svg "octicon-tools" 32}}</div> | ||
{{else if $avatar}} | ||
{{$avatar}} | ||
{{else}} | ||
{{template "repo/icon" .}} | ||
{{end}} | ||
<a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a> | ||
<div class="mx-2">/</div> | ||
<a href="{{$.RepoLink}}">{{.Name}}</a> | ||
<div class="labels df ac fw"> | ||
{{if .IsTemplate}} | ||
{{if .IsPrivate}} | ||
<span class="ui basic label">{{$.i18n.Tr "repo.desc.private_template"}}</span> | ||
{{else}} | ||
{{if .Owner.Visibility.IsPrivate}} | ||
<span class="ui basic label">{{$.i18n.Tr "repo.desc.internal_template"}}</span> | ||
<div class="df fw"> | ||
<a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a> | ||
<div class="mx-2">/</div> | ||
</div> | ||
<div class="di"> | ||
<a href="{{$.RepoLink}}">{{.Name}}</a> | ||
{{- if $.PageIsSettings -}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It may be helpful to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looked around in the code base and found several instances of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A lot of our UI stuff is essentially being done by cargo-cult - it's not clear why stuff is needed or why it breaks when you adjust the templates. We need to get better and if there is something unusual it needs to be explained. If there is a necessary thing like this which could break the UI - it needs to be explicit - otherwise the next person who comes along will add another block in there without the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I understand that. A lot of the spacing is controlled by whitespace (I even saw a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<div class="di mx-2">/</div><span class="mr-2">{{$.i18n.Tr "repo.settings"}}</span> | ||
{{- else -}} | ||
<div class="labels dif ac fw vm"> | ||
{{if .IsTemplate}} | ||
{{if .IsPrivate}} | ||
<span class="ui basic label">{{$.i18n.Tr "repo.desc.private_template"}}</span> | ||
{{else}} | ||
{{if .Owner.Visibility.IsPrivate}} | ||
<span class="ui basic label">{{$.i18n.Tr "repo.desc.internal_template"}}</span> | ||
{{end}} | ||
{{end}} | ||
{{else}} | ||
{{if .IsPrivate}} | ||
<span class="ui basic label">{{$.i18n.Tr "repo.desc.private"}}</span> | ||
{{else}} | ||
{{if .Owner.Visibility.IsPrivate}} | ||
<span class="ui basic label">{{$.i18n.Tr "repo.desc.internal"}}</span> | ||
{{end}} | ||
{{end}} | ||
{{end}} | ||
{{end}} | ||
{{else}} | ||
{{if .IsPrivate}} | ||
<span class="ui basic label">{{$.i18n.Tr "repo.desc.private"}}</span> | ||
{{else}} | ||
{{if .Owner.Visibility.IsPrivate}} | ||
<span class="ui basic label">{{$.i18n.Tr "repo.desc.internal"}}</span> | ||
{{if .IsArchived}} | ||
<span class="ui basic label">{{$.i18n.Tr "repo.desc.archived"}}</span> | ||
{{end}} | ||
{{end}} | ||
{{end}} | ||
{{if .IsArchived}} | ||
<span class="ui basic label">{{$.i18n.Tr "repo.desc.archived"}}</span> | ||
{{if $.Permission.IsAdmin}} | ||
<a class="ui compact tiny basic icon button poping up" href="{{$.RepoLink}}/settings" data-content="{{$.i18n.Tr "repo.settings"}}" data-position="right center" data-variation="tiny"> | ||
{{svg "octicon-tools"}} | ||
</a> | ||
{{end}} | ||
</div> | ||
{{end}} | ||
</div> | ||
</div> | ||
|
@@ -79,9 +94,10 @@ | |
</div><!-- end grid --> | ||
</div><!-- end container --> | ||
{{end}} | ||
{{if not $.PageIsSettings}} | ||
<div class="ui tabs container"> | ||
{{if not .Repository.IsBeingCreated}} | ||
<div class="ui tabular stackable menu navbar"> | ||
<div class="ui tabular menu navbar"> | ||
{{if .Permission.CanRead $.UnitTypeCode}} | ||
<a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL | EscapePound}}{{end}}"> | ||
{{svg "octicon-code"}} {{.i18n.Tr "repo.code"}} | ||
|
@@ -99,7 +115,7 @@ | |
|
||
{{if .Permission.CanRead $.UnitTypeExternalTracker}} | ||
<a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoExternalIssuesLink}}" target="_blank" rel="noopener noreferrer"> | ||
{{svg "octicon-link-external"}} {{.i18n.Tr "repo.issues"}} </span> | ||
{{svg "octicon-link-external"}} {{.i18n.Tr "repo.issues"}} | ||
</a> | ||
{{end}} | ||
|
||
|
@@ -144,15 +160,15 @@ | |
|
||
{{template "custom/extra_tabs" .}} | ||
|
||
{{if .Permission.IsAdmin}} | ||
<div class="right menu"> | ||
<a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings"> | ||
{{svg "octicon-tools"}} {{.i18n.Tr "repo.settings"}} | ||
</a> | ||
</div> | ||
{{end}} | ||
<div class="spacer"></div> | ||
</div> | ||
{{end}} | ||
</div> | ||
<div class="ui tabs divider"></div> | ||
<div class="df"> | ||
<div class="ui tabs divider f1"></div> | ||
<div class="ui tabs divider container mx-0"></div> | ||
<div class="ui tabs divider spacer"></div> | ||
<div class="ui tabs divider f1"></div> | ||
</div> | ||
{{end}} | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really want the comment emitted here? or do you just want the template not to emit whitespace?
If the latter you may want to use:
And more usefully you can put your reasoning why this spacing has to be removed as the comment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I guess that makes sense.