File tree Expand file tree Collapse file tree 6 files changed +26
-7
lines changed Expand file tree Collapse file tree 6 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -125,8 +125,11 @@ type Issue struct {
125125 IsPull bool `xorm:"INDEX"` // Indicates whether is a pull request or not.
126126 PullRequest * PullRequest `xorm:"-"`
127127 NumComments int
128- Ref string
129- PinOrder int `xorm:"DEFAULT 0"`
128+
129+ // TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl"
130+ Ref string
131+
132+ PinOrder int `xorm:"DEFAULT 0"`
130133
131134 DeadlineUnix timeutil.TimeStamp `xorm:"INDEX"`
132135
Original file line number Diff line number Diff line change 1+ {{/* TODO: RemoveIssueRef: the Issue.Ref will be removed in 1.24 or 1.25 if no end user really needs it or there could be better alternative then.
2+ PR: https://github.com/go-gitea/gitea/pull/32744
3+
4+ The Issue.Ref was added by Add possibility to record branch or tag information in an issue (#780)
5+ After 8 years, this "branch selector" does nothing more than saving the branch/tag name into database and displays it.
6+
7+ There are still users using it:
8+ * @didim99: it is a really useful feature to specify a branch in which issue found.
9+
10+ Still needs to figure out:
11+ * Could the "recording branch/tag name" be replaced by other approaches?
12+ * Write the branch name in the issue title/body then it will still be displayed, eg: `[bug] (fix/ui-broken-bug) there is a bug ....`
13+ * Is "GitHub-like development sidebar (`#31899`)" good enough (or better) for your usage?
14+ */}}
115{{if and (not .Issue.IsPull) (not .PageIsComparePull)}}
216<input id="ref_selector" name="ref" type="hidden" value="{{.Reference}}">
317<div class="ui dropdown select-branch branch-selector-dropdown ellipsis-items-nowrap {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}}"
2943 {{range .Branches}}
3044 <div class="item" data-id="refs/heads/{{.}}" data-name="{{.}}" data-id-selector="#ref_selector" title="{{.}}">{{.}}</div>
3145 {{else}}
32- <div class="item">{{ctx.Locale.Tr "no_results_found"}}</div>
46+ <div class="item disabled ">{{ctx.Locale.Tr "no_results_found"}}</div>
3347 {{end}}
3448 </div>
3549 <div id="tag-list" class="scrolling menu reference-list-menu tw-hidden">
3953 {{range .Tags}}
4054 <div class="item" data-id="refs/tags/{{.}}" data-name="tags/{{.}}" data-id-selector="#ref_selector">{{.}}</div>
4155 {{else}}
42- <div class="item">{{ctx.Locale.Tr "no_results_found"}}</div>
56+ <div class="item disabled ">{{ctx.Locale.Tr "no_results_found"}}</div>
4357 {{end}}
4458 </div>
4559 </div>
Original file line number Diff line number Diff line change 4747 </div>
4848
4949 <div class="issue-content-right ui segment">
50- {{template "repo/issue/branch_selector_field" $}}
50+ {{template "repo/issue/branch_selector_field" $}}{{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}}
51+
5152 {{if .PageIsComparePull}}
5253 {{template "repo/issue/sidebar/reviewer_list" $.IssuePageMetaData}}
5354 <div class="divider"></div>
Original file line number Diff line number Diff line change 11<div class="issue-content-right ui segment">
2- {{template "repo/issue/branch_selector_field" $}}
2+ {{template "repo/issue/branch_selector_field" $}}{{/* TODO: RemoveIssueRef: template "repo/issue/branch_selector_field" $*/}}
33
44 {{if .Issue.IsPull}}
55 {{template "repo/issue/sidebar/reviewer_list" $.IssuePageMetaData}}
Original file line number Diff line number Diff line change 9999 <span class="gt-ellipsis">{{.Project.Title}}</span>
100100 </a>
101101 {{end}}
102- {{if .Ref}}
102+ {{if .Ref}}{{/* TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl" */}}
103103 <a class="ref flex-text-inline tw-max-w-[300px]" {{if $.RepoLink}}href="{{index $.IssueRefURLs .ID}}"{{else}}href="{{.Repo.Link}}{{index $.IssueRefURLs .ID}}"{{end}}>
104104 {{svg "octicon-git-branch" 14}}
105105 <span class="gt-ellipsis">{{index $.IssueRefEndNames .ID}}</span>
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import {queryElems, toggleElem} from '../utils/dom.ts';
44import { initIssueSidebarComboList } from './repo-issue-sidebar-combolist.ts' ;
55
66function initBranchSelector ( ) {
7+ // TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl"
78 const elSelectBranch = document . querySelector ( '.ui.dropdown.select-branch' ) ;
89 if ( ! elSelectBranch ) return ;
910
You can’t perform that action at this time.
0 commit comments