1
1
mirror of https://github.com/go-gitea/gitea synced 2024-11-18 16:14:26 +00:00

Prevent tab shifting, remove extra margin on fluid pages (#31090)

1. Extend concept of https://github.com/go-gitea/gitea/pull/29831 to all
tabular menus, there were only three left that weren't already
`<overflow-menu>`.

<img width="634" alt="Screenshot 2024-05-27 at 00 42 16"
src="https://github.com/go-gitea/gitea/assets/115237/d9a7e219-d05e-40a1-9e93-777f9a8a90dd">
<img width="965" alt="Screenshot 2024-05-27 at 00 29 32"
src="https://github.com/go-gitea/gitea/assets/115237/e6ed71b1-11fb-4a74-9adb-af4524286cff">

2. Remove extra padding on `fluid padded` container like for example PR
diff view. The page margin is already correctly sized via
`.ui.container`, so this was just extraneous padding that looked ugly.

Before:
<img width="1351" alt="Screenshot 2024-05-27 at 00 45 11"
src="https://github.com/go-gitea/gitea/assets/115237/4b45fd11-b1b2-4fbb-a618-26eb22be9472">

After:
<img width="1344" alt="Screenshot 2024-05-27 at 00 45 22"
src="https://github.com/go-gitea/gitea/assets/115237/d09593eb-6c7f-45e7-85b6-f0050047004b">

3. Replace `gt-word-break` with `tw-break-anywhere` in issue-title,
fixing overflow.

Before:
<img width="1333" alt="Screenshot 2024-05-27 at 00 50 14"
src="https://github.com/go-gitea/gitea/assets/115237/64d15d04-b456-401e-a972-df636965f0eb">

After:
<img width="1316" alt="Screenshot 2024-05-27 at 00 50 26"
src="https://github.com/go-gitea/gitea/assets/115237/ed1ce830-1408-414b-8263-eeaf773f52c8">
This commit is contained in:
silverwind 2024-05-27 08:45:16 +02:00 committed by GitHub
parent 31a0c4dfb4
commit 6e140b58dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 13 additions and 14 deletions

View File

@ -6,7 +6,7 @@
<div class="issue-title-header"> <div class="issue-title-header">
{{$canEditIssueTitle := and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}} {{$canEditIssueTitle := and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
<div class="issue-title" id="issue-title-display"> <div class="issue-title" id="issue-title-display">
<h1 class="gt-word-break"> <h1 class="tw-break-anywhere">
{{RenderIssueTitle $.Context .Issue.Title ($.Repository.ComposeMetas ctx) | RenderCodeBlock}} {{RenderIssueTitle $.Context .Issue.Title ($.Repository.ComposeMetas ctx) | RenderCodeBlock}}
<span class="index">#{{.Issue.Index}}</span> <span class="index">#{{.Issue.Index}}</span>
</h1> </h1>

View File

@ -2,17 +2,17 @@
<div class="ui top attached pull tabular menu"> <div class="ui top attached pull tabular menu">
<a class="item {{if .PageIsPullConversation}}active{{end}}" href="{{.Issue.Link}}"> <a class="item {{if .PageIsPullConversation}}active{{end}}" href="{{.Issue.Link}}">
{{svg "octicon-comment-discussion"}} {{svg "octicon-comment-discussion"}}
{{ctx.Locale.Tr "repo.pulls.tab_conversation"}} {{template "shared/misc/tabtitle" (ctx.Locale.Tr "repo.pulls.tab_conversation")}}
<span class="ui small label">{{.Issue.NumComments}}</span> <span class="ui small label">{{.Issue.NumComments}}</span>
</a> </a>
<a class="item {{if .PageIsPullCommits}}active{{end}}" {{if .NumCommits}}href="{{.Issue.Link}}/commits"{{end}}> <a class="item {{if .PageIsPullCommits}}active{{end}}" {{if .NumCommits}}href="{{.Issue.Link}}/commits"{{end}}>
{{svg "octicon-git-commit"}} {{svg "octicon-git-commit"}}
{{ctx.Locale.Tr "repo.pulls.tab_commits"}} {{template "shared/misc/tabtitle" (ctx.Locale.Tr "repo.pulls.tab_commits")}}
<span class="ui small label">{{if .NumCommits}}{{.NumCommits}}{{else}}-{{end}}</span> <span class="ui small label">{{if .NumCommits}}{{.NumCommits}}{{else}}-{{end}}</span>
</a> </a>
<a class="item {{if .PageIsPullFiles}}active{{end}}" href="{{.Issue.Link}}/files"> <a class="item {{if .PageIsPullFiles}}active{{end}}" href="{{.Issue.Link}}/files">
{{svg "octicon-diff"}} {{svg "octicon-diff"}}
{{ctx.Locale.Tr "repo.pulls.tab_files"}} {{template "shared/misc/tabtitle" (ctx.Locale.Tr "repo.pulls.tab_files")}}
<span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span> <span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span>
</a> </a>
{{if or .Diff.TotalAddition .Diff.TotalDeletion}} {{if or .Diff.TotalAddition .Diff.TotalDeletion}}

View File

@ -34,9 +34,11 @@
</div> </div>
<div class="info tw-hidden" id="info-{{.ID}}"> <div class="info tw-hidden" id="info-{{.ID}}">
<div class="ui top attached tabular menu"> <div class="ui top attached tabular menu">
<a class="item active" data-tab="request-{{.ID}}">{{ctx.Locale.Tr "repo.settings.webhook.request"}}</a> <a class="item active" data-tab="request-{{.ID}}">
{{template "shared/misc/tabtitle" (ctx.Locale.Tr "repo.settings.webhook.request")}}
</a>
<a class="item" data-tab="response-{{.ID}}"> <a class="item" data-tab="response-{{.ID}}">
{{ctx.Locale.Tr "repo.settings.webhook.response"}} {{template "shared/misc/tabtitle" (ctx.Locale.Tr "repo.settings.webhook.response")}}
{{if .ResponseInfo}} {{if .ResponseInfo}}
{{if .IsSucceed}} {{if .IsSucceed}}
<span class="ui green label">{{.ResponseInfo.Status}}</span> <span class="ui green label">{{.ResponseInfo.Status}}</span>
@ -49,10 +51,10 @@
</a> </a>
{{if or $.Permission.IsAdmin $.IsOrganizationOwner $.PageIsAdmin $.PageIsUserSettings}} {{if or $.Permission.IsAdmin $.IsOrganizationOwner $.PageIsAdmin $.PageIsUserSettings}}
<div class="right menu"> <div class="right menu">
<form class="item" action="{{$.Link}}/replay/{{.UUID}}" method="post"> <form class="tw-py-2" action="{{$.Link}}/replay/{{.UUID}}" method="post">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
<span data-tooltip-content="{{if $.Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description_disabled"}}{{end}}"> <span data-tooltip-content="{{if $.Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description_disabled"}}{{end}}">
<button class="ui tiny button{{if not $.Webhook.IsActive}} disabled{{end}}">{{svg "octicon-sync"}}</button> <button class="ui tiny button tw-mr-0{{if not $.Webhook.IsActive}} disabled{{end}}">{{svg "octicon-sync"}}</button>
</span> </span>
</form> </form>
</div> </div>

View File

@ -14,8 +14,8 @@ Template Attributes:
<div {{if .ContainerId}}id="{{.ContainerId}}"{{end}} class="combo-markdown-editor {{.ContainerClasses}}" data-dropzone-parent-container="{{.DropzoneParentContainer}}"> <div {{if .ContainerId}}id="{{.ContainerId}}"{{end}} class="combo-markdown-editor {{.ContainerClasses}}" data-dropzone-parent-container="{{.DropzoneParentContainer}}">
{{if .MarkdownPreviewUrl}} {{if .MarkdownPreviewUrl}}
<div class="ui top tabular menu"> <div class="ui top tabular menu">
<a class="active item" data-tab-for="markdown-writer">{{ctx.Locale.Tr "write"}}</a> <a class="active item" data-tab-for="markdown-writer">{{template "shared/misc/tabtitle" (ctx.Locale.Tr "write")}}</a>
<a class="item" data-tab-for="markdown-previewer" data-preview-url="{{.MarkdownPreviewUrl}}" data-preview-context="{{.MarkdownPreviewContext}}">{{ctx.Locale.Tr "preview"}}</a> <a class="item" data-tab-for="markdown-previewer" data-preview-url="{{.MarkdownPreviewUrl}}" data-preview-context="{{.MarkdownPreviewContext}}">{{template "shared/misc/tabtitle" (ctx.Locale.Tr "preview")}}</a>
</div> </div>
{{end}} {{end}}
<div class="ui tab active" data-tab-panel="markdown-writer"> <div class="ui tab active" data-tab-panel="markdown-writer">

View File

@ -0,0 +1 @@
<span class="resize-for-semibold" data-text="{{.}}">{{.}}</span>

View File

@ -12,10 +12,6 @@
width: 100%; width: 100%;
} }
.ui.container.fluid.padded {
padding: 0 var(--page-margin-x);
}
.ui[class*="center aligned"].container { .ui[class*="center aligned"].container {
text-align: center; text-align: center;
} }