1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-21 08:31:27 -05:00

Merge pull request 'Replace gt-word-break with tw-break-anywhere' (#4102) from 0ko/forgejo:ui-replace-gt-word-break into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4102
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-06-11 10:39:03 +00:00
commit d6140093c0
15 changed files with 17 additions and 22 deletions

View file

@ -47,13 +47,13 @@
<tr> <tr>
<td>{{.ID}}</td> <td>{{.ID}}</td>
<td> <td>
<a class="gt-word-break" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> <a class="tw-break-anywhere" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>
{{if .Owner.Visibility.IsPrivate}} {{if .Owner.Visibility.IsPrivate}}
<span class="text gold">{{svg "octicon-lock"}}</span> <span class="text gold">{{svg "octicon-lock"}}</span>
{{end}} {{end}}
</td> </td>
<td> <td>
<a class="gt-word-break" href="{{.Link}}">{{.Name}}</a> <a class="tw-break-anywhere" href="{{.Link}}">{{.Name}}</a>
{{if .IsArchived}} {{if .IsArchived}}
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span> <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
{{end}} {{end}}

View file

@ -54,7 +54,7 @@
{{end}} {{end}}
{{if .PackageDescriptor.Metadata.ImageLayers}} {{if .PackageDescriptor.Metadata.ImageLayers}}
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.container.layers"}}</h4> <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.container.layers"}}</h4>
<div class="ui attached segment gt-word-break"> <div class="ui attached segment tw-break-anywhere">
<table class="ui very basic compact table"> <table class="ui very basic compact table">
<tbody> <tbody>
{{range .PackageDescriptor.Metadata.ImageLayers}} {{range .PackageDescriptor.Metadata.ImageLayers}}
@ -80,7 +80,7 @@
{{range $key, $value := .PackageDescriptor.Metadata.Labels}} {{range $key, $value := .PackageDescriptor.Metadata.Labels}}
<tr> <tr>
<td class="top aligned">{{$key}}</td> <td class="top aligned">{{$key}}</td>
<td class="gt-word-break">{{$value}}</td> <td class="tw-break-anywhere">{{$value}}</td>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>

View file

@ -59,7 +59,7 @@
{{ctx.Locale.Tr "packages.settings.delete"}} {{ctx.Locale.Tr "packages.settings.delete"}}
</div> </div>
<div class="content"> <div class="content">
<div class="ui warning message gt-word-break"> <div class="ui warning message tw-break-anywhere">
{{ctx.Locale.Tr "packages.settings.delete.notice" .PackageDescriptor.Package.Name .PackageDescriptor.Version.Version}} {{ctx.Locale.Tr "packages.settings.delete.notice" .PackageDescriptor.Package.Name .PackageDescriptor.Version.Version}}
</div> </div>
<form class="ui form" action="{{.Link}}" method="post"> <form class="ui form" action="{{.Link}}" method="post">

View file

@ -156,7 +156,7 @@
<div class="divider"{{if .Color}} style="color: {{ContrastColor .Color}} !important"{{end}}></div> <div class="divider"{{if .Color}} style="color: {{ContrastColor .Color}} !important"{{end}}></div>
<div class="ui cards" data-url="{{$.Link}}/{{.ID}}" data-project="{{$.Project.ID}}" data-board="{{.ID}}" id="board_{{.ID}}"> <div class="ui cards" data-url="{{$.Link}}/{{.ID}}" data-project="{{$.Project.ID}}" data-board="{{.ID}}" id="board_{{.ID}}">
{{range (index $.IssuesMap .ID)}} {{range (index $.IssuesMap .ID)}}
<div class="issue-card gt-word-break {{if $canWriteProject}}tw-cursor-grab{{end}}" data-issue="{{.ID}}"> <div class="issue-card tw-break-anywhere {{if $canWriteProject}}tw-cursor-grab{{end}}" data-issue="{{.ID}}">
{{template "repo/issue/card" (dict "Issue" . "Page" $)}} {{template "repo/issue/card" (dict "Issue" . "Page" $)}}
</div> </div>
{{end}} {{end}}

View file

@ -6,7 +6,7 @@
{{template "repo/code/recently_pushed_new_branches" .}} {{template "repo/code/recently_pushed_new_branches" .}}
{{if and (not .HideRepoInfo) (not .IsBlame)}} {{if and (not .HideRepoInfo) (not .IsBlame)}}
<div class="repo-description"> <div class="repo-description">
<div id="repo-desc" class="gt-word-break tw-text-16"> <div id="repo-desc" class="tw-break-anywhere tw-text-16">
{{$description := .Repository.DescriptionHTML $.Context}} {{$description := .Repository.DescriptionHTML $.Context}}
{{if $description}}<span class="description">{{$description | RenderCodeBlock}}</span>{{else}}<span class="no-description text-italic">{{ctx.Locale.Tr "repo.no_desc"}}</span>{{end}} {{if $description}}<span class="description">{{$description | RenderCodeBlock}}</span>{{else}}<span class="no-description text-italic">{{ctx.Locale.Tr "repo.no_desc"}}</span>{{end}}
{{if .Repository.Website}}<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end}} {{if .Repository.Website}}<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end}}

View file

@ -7,7 +7,7 @@
{{if .PinnedIssues}} {{if .PinnedIssues}}
<div id="issue-pins" {{if .IsRepoAdmin}}data-is-repo-admin{{end}}> <div id="issue-pins" {{if .IsRepoAdmin}}data-is-repo-admin{{end}}>
{{range .PinnedIssues}} {{range .PinnedIssues}}
<div class="issue-card gt-word-break {{if $.IsRepoAdmin}}tw-cursor-grab{{end}}" data-move-url="{{$.Link}}/move_pin" data-issue-id="{{.ID}}"> <div class="issue-card tw-break-anywhere {{if $.IsRepoAdmin}}tw-cursor-grab{{end}}" data-move-url="{{$.Link}}/move_pin" data-issue-id="{{.ID}}">
{{template "repo/issue/card" (dict "Issue" . "Page" $ "isPinnedIssueCard" true)}} {{template "repo/issue/card" (dict "Issue" . "Page" $ "isPinnedIssueCard" true)}}
</div> </div>
{{end}} {{end}}

View file

@ -5,7 +5,7 @@
<div class="ui segments conversation-holder"> <div class="ui segments conversation-holder">
<div class="ui segment collapsible-comment-box tw-py-2 tw-flex tw-items-center tw-justify-between"> <div class="ui segment collapsible-comment-box tw-py-2 tw-flex tw-items-center tw-justify-between">
<div class="tw-flex tw-items-center"> <div class="tw-flex tw-items-center">
<a href="{{(index .comments 0).CodeCommentLink ctx}}" class="file-comment tw-ml-2 gt-word-break">{{(index .comments 0).TreePath}}</a> <a href="{{(index .comments 0).CodeCommentLink ctx}}" class="file-comment tw-ml-2 tw-break-anywhere">{{(index .comments 0).TreePath}}</a>
{{if $invalid}} {{if $invalid}}
<span class="ui label basic small tw-ml-2" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}"> <span class="ui label basic small tw-ml-2" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}">
{{ctx.Locale.Tr "repo.issues.review.outdated"}} {{ctx.Locale.Tr "repo.issues.review.outdated"}}

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

@ -17,7 +17,7 @@
</div> </div>
<div class="ui twelve wide column detail"> <div class="ui twelve wide column detail">
<div class="tw-flex tw-items-center tw-justify-between tw-flex-wrap tw-mb-2"> <div class="tw-flex tw-items-center tw-justify-between tw-flex-wrap tw-mb-2">
<h4 class="release-list-title gt-word-break"> <h4 class="release-list-title tw-break-anywhere">
<a href="{{$.RepoLink}}/releases/tag/{{$release.TagName | PathEscapeSegments}}">{{$release.Title}}</a> <a href="{{$.RepoLink}}/releases/tag/{{$release.TagName | PathEscapeSegments}}">{{$release.Title}}</a>
{{template "repo/commit_statuses" dict "Status" $info.CommitStatus "Statuses" $info.CommitStatuses "AdditionalClasses" "tw-flex"}} {{template "repo/commit_statuses" dict "Status" $info.CommitStatus "Statuses" $info.CommitStatuses "AdditionalClasses" "tw-flex"}}
{{if $release.IsDraft}} {{if $release.IsDraft}}

View file

@ -239,7 +239,7 @@
<tbody> <tbody>
{{range .PushMirrors}} {{range .PushMirrors}}
<tr> <tr>
<td class="gt-word-break">{{.RemoteAddress}}</td> <td class="tw-break-anywhere">{{.RemoteAddress}}</td>
<td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.push"}}</td> <td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.push"}}</td>
<td>{{if .LastUpdateUnix}}{{DateTime "full" .LastUpdateUnix}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{ctx.Locale.Tr "error"}}</div>{{end}}</td> <td>{{if .LastUpdateUnix}}{{DateTime "full" .LastUpdateUnix}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{ctx.Locale.Tr "error"}}</div>{{end}}</td>
<td class="right aligned"> <td class="right aligned">

View file

@ -8,7 +8,7 @@
<div class="ui header"> <div class="ui header">
<a class="file-revisions-btn ui basic button" title="{{ctx.Locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}"><span>{{.revision}}</span> {{svg "octicon-home"}}</a> <a class="file-revisions-btn ui basic button" title="{{ctx.Locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}"><span>{{.revision}}</span> {{svg "octicon-home"}}</a>
{{$title}} {{$title}}
<div class="ui sub header gt-word-break"> <div class="ui sub header tw-break-anywhere">
{{$timeSince := TimeSince .Author.When ctx.Locale}} {{$timeSince := TimeSince .Author.When ctx.Locale}}
{{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince}} {{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince}}
</div> </div>

View file

@ -2,7 +2,7 @@
<div class="ui container"> <div class="ui container">
<div class="ui vertically grid head"> <div class="ui vertically grid head">
<div class="column"> <div class="column">
<div class="ui header tw-flex tw-items-center gt-word-break"> <div class="ui header tw-flex tw-items-center tw-break-anywhere">
{{ctx.AvatarUtils.Avatar . 100}} {{ctx.AvatarUtils.Avatar . 100}}
<span class="text grey"><a class="muted" href="{{.HomeLink}}">{{.DisplayName}}</a></span> <span class="text grey"><a class="muted" href="{{.HomeLink}}">{{.DisplayName}}</a></span>
<span class="org-visibility"> <span class="org-visibility">

View file

@ -11,7 +11,7 @@
</span> </span>
{{end}} {{end}}
</div> </div>
<div class="content gt-word-break profile-avatar-name"> <div class="content tw-break-anywhere profile-avatar-name">
{{if .ContextUser.FullName}}<span class="header text center">{{.ContextUser.FullName}}</span>{{end}} {{if .ContextUser.FullName}}<span class="header text center">{{.ContextUser.FullName}}</span>{{end}}
<span class="username text center">{{.ContextUser.Name}}{{if .ContextUser.Pronouns}} · {{.ContextUser.Pronouns}}{{end}} {{if .IsAdmin}} <span class="username text center">{{.ContextUser.Name}}{{if .ContextUser.Pronouns}} · {{.ContextUser.Pronouns}}{{end}} {{if .IsAdmin}}
<a class="muted" href="{{AppSubUrl}}/admin/users/{{.ContextUser.ID}}" data-tooltip-content="{{ctx.Locale.Tr "admin.users.details"}}"> <a class="muted" href="{{AppSubUrl}}/admin/users/{{.ContextUser.ID}}" data-tooltip-content="{{ctx.Locale.Tr "admin.users.details"}}">
@ -25,7 +25,7 @@
{{end}} {{end}}
</div> </div>
</div> </div>
<div class="extra content gt-word-break"> <div class="extra content tw-break-anywhere">
<ul> <ul>
{{if .ContextUser.Location}} {{if .ContextUser.Location}}
<li> <li>

View file

@ -3,11 +3,6 @@ Gitea's tailwind-style CSS helper classes have `gt-` prefix.
Gitea's private styles use `g-` prefix. Gitea's private styles use `g-` prefix.
*/ */
.gt-word-break {
word-wrap: break-word !important;
overflow-wrap: anywhere;
}
.gt-ellipsis { .gt-ellipsis {
overflow: hidden !important; overflow: hidden !important;
white-space: nowrap !important; white-space: nowrap !important;

View file

@ -125,7 +125,7 @@ export function initRepoIssueSidebarList() {
} }
filteredResponse.results.push({ filteredResponse.results.push({
name: `#${issue.number} ${htmlEscape(issue.title) name: `#${issue.number} ${htmlEscape(issue.title)
}<div class="text small gt-word-break">${htmlEscape(issue.repository.full_name)}</div>`, }<div class="text small tw-break-anywhere">${htmlEscape(issue.repository.full_name)}</div>`,
value: issue.id, value: issue.id,
}); });
}); });