summaryrefslogtreecommitdiffstats
path: root/templates/repo/diff
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2024-03-24 19:23:38 +0100
committerGitHub <noreply@github.com>2024-03-24 18:23:38 +0000
commitec3d467f15a683b305ac165c3eba6683628dcb25 (patch)
treeefcac44b28525ab5a131893e5eeab1771a5ae901 /templates/repo/diff
parent0a2f973de9b681a472c96bdfcd945978e88458d8 (diff)
downloadgitea-ec3d467f15a683b305ac165c3eba6683628dcb25.tar.gz
gitea-ec3d467f15a683b305ac165c3eba6683628dcb25.zip
Migrate `gt-hidden` to `tw-hidden` (#30046)
We have to define this one in helpers.css because tailwind only generates a single class but certain things rely on this being double-class. Command ran: ```sh perl -p -i -e 's#gt-hidden#tw-hidden#g' web_src/js/**/* templates/**/* models/**/* web_src/css/**/* --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates/repo/diff')
-rw-r--r--templates/repo/diff/box.tmpl14
-rw-r--r--templates/repo/diff/comment_form.tmpl2
-rw-r--r--templates/repo/diff/comments.tmpl4
-rw-r--r--templates/repo/diff/compare.tmpl12
-rw-r--r--templates/repo/diff/conversation.tmpl4
5 files changed, 18 insertions, 18 deletions
diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl
index a6ca314b3a..37a4e1e323 100644
--- a/templates/repo/diff/box.tmpl
+++ b/templates/repo/diff/box.tmpl
@@ -5,15 +5,15 @@
{{if $showFileTree}}
<button class="diff-toggle-file-tree-button not-mobile btn interact-fg" data-show-text="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{ctx.Locale.Tr "repo.diff.hide_file_tree"}}">
{{/* the icon meaning is reversed here, "octicon-sidebar-collapse" means show the file tree */}}
- {{svg "octicon-sidebar-collapse" 20 "icon gt-hidden"}}
- {{svg "octicon-sidebar-expand" 20 "icon gt-hidden"}}
+ {{svg "octicon-sidebar-collapse" 20 "icon tw-hidden"}}
+ {{svg "octicon-sidebar-expand" 20 "icon tw-hidden"}}
</button>
<script>
// Default to true if unset
const diffTreeVisible = localStorage?.getItem('diff_file_tree_visible') !== 'false';
const diffTreeBtn = document.querySelector('.diff-toggle-file-tree-button');
const diffTreeIcon = `.octicon-sidebar-${diffTreeVisible ? 'expand' : 'collapse'}`;
- diffTreeBtn.querySelector(diffTreeIcon).classList.remove('gt-hidden');
+ diffTreeBtn.querySelector(diffTreeIcon).classList.remove('tw-hidden');
diffTreeBtn.setAttribute('data-tooltip-content', diffTreeBtn.getAttribute(diffTreeVisible ? 'data-hide-text' : 'data-show-text'));
</script>
{{end}}
@@ -89,9 +89,9 @@
{{end}}
<div id="diff-container">
{{if $showFileTree}}
- <div id="diff-file-tree" class="gt-hidden not-mobile"></div>
+ <div id="diff-file-tree" class="tw-hidden not-mobile"></div>
<script>
- if (diffTreeVisible) document.getElementById('diff-file-tree').classList.remove('gt-hidden');
+ if (diffTreeVisible) document.getElementById('diff-file-tree').classList.remove('tw-hidden');
</script>
{{end}}
{{if .DiffNotAvailable}}
@@ -159,7 +159,7 @@
{{end}}
{{if not (or $file.IsIncomplete $file.IsBin $file.IsSubmodule)}}
<button class="ui basic tiny button unescape-button not-mobile">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button>
- <button class="ui basic tiny button escape-button gt-hidden">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
+ <button class="ui basic tiny button escape-button tw-hidden">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
{{end}}
{{if and (not $file.IsSubmodule) (not $.PageIsWiki)}}
{{if $file.IsDeleted}}
@@ -176,7 +176,7 @@
</div>
</h4>
<div class="diff-file-body ui attached unstackable table segment" {{if and $file.IsViewed $.IsShowingAllCommits}}data-folded="true"{{end}}>
- <div id="diff-source-{{$file.NameHash}}" class="file-body file-code unicode-escaped code-diff{{if $.IsSplitStyle}} code-diff-split{{else}} code-diff-unified{{end}}{{if $showFileViewToggle}} gt-hidden{{end}}">
+ <div id="diff-source-{{$file.NameHash}}" class="file-body file-code unicode-escaped code-diff{{if $.IsSplitStyle}} code-diff-split{{else}} code-diff-unified{{end}}{{if $showFileViewToggle}} tw-hidden{{end}}">
{{if or $file.IsIncomplete $file.IsBin}}
<div class="diff-file-body binary">
{{if $file.IsIncomplete}}
diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl
index d797e89444..6a5dec6c48 100644
--- a/templates/repo/diff/comment_form.tmpl
+++ b/templates/repo/diff/comment_form.tmpl
@@ -1,5 +1,5 @@
{{if and $.root.SignedUserID (not $.Repository.IsArchived)}}
- <form class="ui form {{if $.hidden}}gt-hidden comment-form{{end}}" action="{{$.root.Issue.Link}}/files/reviews/comments" method="post">
+ <form class="ui form {{if $.hidden}}tw-hidden comment-form{{end}}" action="{{$.root.Issue.Link}}/files/reviews/comments" method="post">
{{$.root.CsrfTokenHtml}}
<input type="hidden" name="origin" value="{{if $.root.PageIsPullFiles}}diff{{else}}timeline{{end}}">
<input type="hidden" name="latest_commit_id" value="{{$.root.AfterCommitID}}">
diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl
index b03a9291c5..a9120465bd 100644
--- a/templates/repo/diff/comments.tmpl
+++ b/templates/repo/diff/comments.tmpl
@@ -60,8 +60,8 @@
<span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
{{end}}
</div>
- <div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div>
- <div class="edit-content-zone gt-hidden" data-update-url="{{$.root.RepoLink}}/comments/{{.ID}}" data-context="{{$.root.RepoLink}}" data-attachment-url="{{$.root.RepoLink}}/comments/{{.ID}}/attachments"></div>
+ <div id="issuecomment-{{.ID}}-raw" class="raw-content tw-hidden">{{.Content}}</div>
+ <div class="edit-content-zone tw-hidden" data-update-url="{{$.root.RepoLink}}/comments/{{.ID}}" data-context="{{$.root.RepoLink}}" data-attachment-url="{{$.root.RepoLink}}/comments/{{.ID}}/attachments"></div>
{{if .Attachments}}
{{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}}
{{end}}
diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl
index ea9c0d471a..d0472577d0 100644
--- a/templates/repo/diff/compare.tmpl
+++ b/templates/repo/diff/compare.tmpl
@@ -75,7 +75,7 @@
{{end}}
{{end}}
</div>
- <div class="scrolling menu reference-list-menu base-tag-list gt-hidden">
+ <div class="scrolling menu reference-list-menu base-tag-list tw-hidden">
{{range .Tags}}
<div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-url="{{$.RepoLink}}/compare/{{PathEscapeSegments .}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}">{{$BaseCompareName}}:{{.}}</div>
{{end}}
@@ -144,7 +144,7 @@
{{end}}
{{end}}
</div>
- <div class="scrolling menu reference-list-menu head-tag-list gt-hidden">
+ <div class="scrolling menu reference-list-menu head-tag-list tw-hidden">
{{range .HeadTags}}
<div class="{{if eq $.HeadBranch .}}selected{{end}} item" data-url="{{$.RepoLink}}/compare/{{PathEscapeSegments $.BaseBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments .}}">{{$HeadCompareName}}:{{.}}</div>
{{end}}
@@ -171,10 +171,10 @@
{{if .IsNothingToCompare}}
{{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived) .PageIsComparePull}}
<div class="ui segment">{{ctx.Locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div>
- <div class="ui info message show-form-container {{if .Flash}}gt-hidden{{end}}">
+ <div class="ui info message show-form-container {{if .Flash}}tw-hidden{{end}}">
<button class="ui button primary show-form">{{ctx.Locale.Tr "repo.pulls.new"}}</button>
</div>
- <div class="pullrequest-form {{if not .Flash}}gt-hidden{{end}}">
+ <div class="pullrequest-form {{if not .Flash}}tw-hidden{{end}}">
{{template "repo/issue/new_form" .}}
</div>
{{else if and .HeadIsBranch .BaseIsBranch}}
@@ -204,7 +204,7 @@
</div>
{{else}}
{{if and $.IsSigned (not .Repository.IsArchived)}}
- <div class="ui info message show-form-container {{if .Flash}}gt-hidden{{end}}">
+ <div class="ui info message show-form-container {{if .Flash}}tw-hidden{{end}}">
<button class="ui button primary show-form">{{ctx.Locale.Tr "repo.pulls.new"}}</button>
</div>
{{else if .Repository.IsArchived}}
@@ -217,7 +217,7 @@
</div>
{{end}}
{{if $.IsSigned}}
- <div class="pullrequest-form {{if not .Flash}}gt-hidden{{end}}">
+ <div class="pullrequest-form {{if not .Flash}}tw-hidden{{end}}">
{{template "repo/issue/new_form" .}}
</div>
{{end}}
diff --git a/templates/repo/diff/conversation.tmpl b/templates/repo/diff/conversation.tmpl
index 872cbee78b..c263ddcdd6 100644
--- a/templates/repo/diff/conversation.tmpl
+++ b/templates/repo/diff/conversation.tmpl
@@ -27,14 +27,14 @@
{{svg "octicon-unfold" 16 "tw-mr-2"}}
{{ctx.Locale.Tr "repo.issues.review.show_resolved"}}
</button>
- <button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="ui tiny labeled button hide-outdated tw-flex tw-items-center gt-hidden">
+ <button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="ui tiny labeled button hide-outdated tw-flex tw-items-center tw-hidden">
{{svg "octicon-fold" 16 "tw-mr-2"}}
{{ctx.Locale.Tr "repo.issues.review.hide_resolved"}}
</button>
</div>
</div>
{{end}}
- <div id="code-comments-{{$comment.ID}}" class="field comment-code-cloud {{if $resolved}}gt-hidden{{end}}">
+ <div id="code-comments-{{$comment.ID}}" class="field comment-code-cloud {{if $resolved}}tw-hidden{{end}}">
<div class="comment-list">
<ui class="ui comments">
{{template "repo/diff/comments" dict "root" $ "comments" .comments}}