diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-11-08 10:21:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-08 02:21:13 +0000 |
commit | 623a2d41cc866d31e6348c58cccf336b67a4b2c7 (patch) | |
tree | 0f0e064098dd40d63be2c20935f72de8d0e46c0e /templates/repo | |
parent | 028e6120943107fdfb25bf8ada9e3fc2e14e37e0 (diff) | |
download | gitea-623a2d41cc866d31e6348c58cccf336b67a4b2c7.tar.gz gitea-623a2d41cc866d31e6348c58cccf336b67a4b2c7.zip |
Refactor issue page info (#32445)
Fix a longstanding TODO since 2021 (#14826) / 2018 (#2531)
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/issue/view_content.tmpl | 7 | ||||
-rw-r--r-- | templates/repo/issue/view_title.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/pulls/files.tmpl | 4 |
3 files changed, 6 insertions, 11 deletions
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 1f9bbd86aa..3f7b2dc78f 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -1,11 +1,4 @@ <div class="issue-content"> - <!-- I know, there is probably a better way to do this (moved from sidebar.tmpl, original author: 6543 @ 2021-02-28) --> - <!-- Agree, there should be a better way, eg: introduce window.config.pageData (original author: wxiaoguang @ 2021-09-05) --> - <input type="hidden" id="repolink" value="{{$.RepoRelPath}}"> - <input type="hidden" id="repoId" value="{{.Repository.ID}}"> - <input type="hidden" id="issueIndex" value="{{.Issue.Index}}"> - <input type="hidden" id="type" value="{{.IssueType}}"> - {{$createdStr:= DateUtils.TimeSince .Issue.CreatedUnix}} <div class="issue-content-left comment-list prevent-before-timeline"> <div class="ui timeline"> diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index 0f796ce9bf..26b36d6ffc 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -3,6 +3,12 @@ {{template "base/alert" .}} </div> {{end}} +<div class="tw-hidden" id="issue-page-info" + data-issue-index="{{$.Issue.Index}}" + data-issue-dependency-search-type="{{$.IssueDependencySearchType}}" + data-issue-repo-link="{{$.RepoLink}}" + data-issue-repo-id="{{$.Repository.ID}}" +></div> <div class="issue-title-header"> {{$canEditIssueTitle := and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}} <div class="issue-title" id="issue-title-display"> diff --git a/templates/repo/pulls/files.tmpl b/templates/repo/pulls/files.tmpl index 402bec800b..e7baa484a1 100644 --- a/templates/repo/pulls/files.tmpl +++ b/templates/repo/pulls/files.tmpl @@ -1,8 +1,4 @@ {{template "base/head" .}} - -<input type="hidden" id="repolink" value="{{$.RepoRelPath}}"> -<input type="hidden" id="issueIndex" value="{{.Issue.Index}}"> - <div role="main" aria-label="{{.Title}}" class="page-content repository view issue pull files diff"> {{template "repo/header" .}} <div class="ui container fluid padded"> |