diff options
author | Sandro Santilli <strk@kbt.io> | 2022-06-10 07:39:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-10 13:39:53 +0800 |
commit | 52c2e82813c2519cd08c9ecd66ef7b0815682770 (patch) | |
tree | 1120ca6d9b6534e33554f0b1c74529e62feba5b2 /templates/repo/settings | |
parent | 5f618248a98ffbb7066100ffe1955faf791d0205 (diff) | |
download | gitea-52c2e82813c2519cd08c9ecd66ef7b0815682770.tar.gz gitea-52c2e82813c2519cd08c9ecd66ef7b0815682770.zip |
Custom regexp external issues (#17624)
* Implement custom regular expression for external issue tracking.
Signed-off-by: Alexander Beyn <malex@fatelectrons.org>
* Fix syntax/style
* Update repo.go
* Set metas['regexp']
* gofmt
* fix some tests
* fix more tests
* refactor frontend
* use LRU cache for regexp
* Update modules/markup/html_internal_test.go
Co-authored-by: Alexander Beyn <malex@fatelectrons.org>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates/repo/settings')
-rw-r--r-- | templates/repo/settings/options.tmpl | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index f44d9c98ad..67a98aff43 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -361,16 +361,27 @@ <div class="ui radio checkbox"> {{$externalTracker := (.Repository.MustGetUnit $.UnitTypeExternalTracker)}} {{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}} - <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="numeric" {{if $externalTrackerStyle}}{{if eq $externalTrackerStyle "numeric"}}checked=""{{end}}{{end}}/> - <label>{{.i18n.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">(#1234)</span></label> + <input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="numeric" {{if eq $externalTrackerStyle "numeric"}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">#1234</span></label> </div> </div> <div class="field"> <div class="ui radio checkbox"> - <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="alphanumeric" {{if $externalTrackerStyle}}{{if eq $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle "alphanumeric"}}checked=""{{end}}{{end}} /> - <label>{{.i18n.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">(ABC-123, DEFG-234)</span></label> + <input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="alphanumeric" {{if eq $externalTrackerStyle "alphanumeric"}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">ABC-123 , DEFG-234</span></label> </div> </div> + <div class="field"> + <div class="ui radio checkbox"> + <input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="regexp" {{if eq $externalTrackerStyle "regexp"}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.tracker_issue_style.regexp"}} <span class="ui light grey text">(ISSUE-\d+) , ISSUE-(\d+)</span></label> + </div> + </div> + </div> + <div class="field {{if ne $externalTrackerStyle "regexp"}}disabled{{end}}" id="tracker-issue-style-regex-box"> + <label for="external_tracker_regexp_pattern">{{.i18n.Tr "repo.settings.tracker_issue_style.regexp_pattern"}}</label> + <input id="external_tracker_regexp_pattern" name="external_tracker_regexp_pattern" value="{{(.Repository.MustGetUnit $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerRegexpPattern}}"> + <p class="help">{{.i18n.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc" | Str2html}}</p> </div> </div> </div> |