aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/view_content/sidebar.tmpl
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-02-19 12:06:14 +0800
committerGitHub <noreply@github.com>2023-02-19 12:06:14 +0800
commitd32af84a1002ceb235c86e4ac569c866ab7816d4 (patch)
tree3832638122aac31fdc2215f85873629fd8ef2fd2 /templates/repo/issue/view_content/sidebar.tmpl
parent6221a6fd5450692ae27e5602b41fc9ebd9150736 (diff)
downloadgitea-d32af84a1002ceb235c86e4ac569c866ab7816d4.tar.gz
gitea-d32af84a1002ceb235c86e4ac569c866ab7816d4.zip
Refactor hiding-methods, remove jQuery show/hide, remove `.hide` class, remove inline style=display:none (#22950)
Close #22847 This PR: * introduce Gitea's own `showElem` and related functions * remove jQuery show/hide * remove .hide class * remove inline style=display:none From now on: do not use: * "[hidden]" attribute: it's too weak, can not be applied to an element with "display: flex" * ".hidden" class: it has been polluted by Fomantic UI in many cases * inline style="display: none": it's difficult to tweak * jQuery's show/hide/toggle: it can not show/hide elements with "display: xxx !important" only use: * this ".gt-hidden" class * showElem/hideElem/toggleElem functions in "utils/dom.js" cc: @silverwind , this is the all-in-one PR
Diffstat (limited to 'templates/repo/issue/view_content/sidebar.tmpl')
-rw-r--r--templates/repo/issue/view_content/sidebar.tmpl12
1 files changed, 6 insertions, 6 deletions
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl
index 8cd34ede6e..2b24825b5f 100644
--- a/templates/repo/issue/view_content/sidebar.tmpl
+++ b/templates/repo/issue/view_content/sidebar.tmpl
@@ -50,7 +50,7 @@
</div>
<div class="ui assignees list">
- <span class="no-select item {{if or .OriginalReviews .PullReviewers}}hide{{end}}">{{.locale.Tr "repo.issues.new.no_reviewers"}}</span>
+ <span class="no-select item {{if or .OriginalReviews .PullReviewers}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_reviewers"}}</span>
<div class="selected">
{{range .PullReviewers}}
<div class="item gt-mb-2">
@@ -202,7 +202,7 @@
</div>
</div>
<div class="ui select-milestone list">
- <span class="no-select item {{if .Issue.Milestone}}hide{{end}}">{{.locale.Tr "repo.issues.new.no_milestone"}}</span>
+ <span class="no-select item {{if .Issue.Milestone}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_milestone"}}</span>
<div class="selected">
{{if .Issue.Milestone}}
<a class="item muted sidebar-item-link" href="{{.RepoLink}}/milestone/{{.Issue.Milestone.ID}}">
@@ -259,7 +259,7 @@
</div>
</div>
<div class="ui select-project list">
- <span class="no-select item {{if .Issue.ProjectID}}hide{{end}}">{{.locale.Tr "repo.issues.new.no_projects"}}</span>
+ <span class="no-select item {{if .Issue.ProjectID}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_projects"}}</span>
<div class="selected">
{{if .Issue.ProjectID}}
<a class="item muted sidebar-item-link" href="{{.Issue.Project.Link}}">
@@ -308,7 +308,7 @@
</div>
</div>
<div class="ui assignees list">
- <span class="no-select item {{if .Issue.Assignees}}hide{{end}}">{{.locale.Tr "repo.issues.new.no_assignees"}}</span>
+ <span class="no-select item {{if .Issue.Assignees}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_assignees"}}</span>
<div class="selected">
{{range .Issue.Assignees}}
<div class="item">
@@ -423,7 +423,7 @@
<div class="ui divider"></div>
<span class="text"><strong>{{.locale.Tr "repo.issues.due_date"}}</strong></span>
<div class="ui form" id="deadline-loader">
- <div class="ui negative message" id="deadline-err-invalid-date" style="display: none;">
+ <div class="ui negative message gt-hidden" id="deadline-err-invalid-date">
{{svg "octicon-x" 16 "close icon"}}
{{.locale.Tr "repo.issues.due_date_invalid"}}
</div>
@@ -447,7 +447,7 @@
{{end}}
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
- <div {{if ne .Issue.DeadlineUnix 0}} style="display: none;"{{end}} id="deadlineForm">
+ <div {{if ne .Issue.DeadlineUnix 0}} class="gt-hidden"{{end}} id="deadlineForm">
<form class="ui fluid action input issue-due-form" action="{{AppSubUrl}}/{{PathEscape .Repository.Owner.Name}}/{{PathEscape .Repository.Name}}/issues/{{.Issue.Index}}/deadline" method="post" id="update-issue-deadline-form">
{{$.CsrfTokenHtml}}
<input required placeholder="{{.locale.Tr "repo.issues.due_date_form"}}" {{if gt .Issue.DeadlineUnix 0}}value="{{.Issue.DeadlineUnix.Format "2006-01-02"}}"{{end}} type="date" name="deadlineDate" id="deadlineDate">