1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Support alphanumeric issue style (ABC-1234) for external issue tracker (#2992)

This commit is contained in:
Cosmin Stroe
2016-04-22 17:28:08 -05:00
committed by Unknwon
parent 39356f4238
commit ba314a7a36
8 changed files with 353 additions and 12 deletions

View File

@@ -170,6 +170,7 @@ type Repository struct {
EnableIssues bool `xorm:"NOT NULL DEFAULT true"`
EnableExternalTracker bool
ExternalTrackerFormat string
ExternalTrackerStyle string
ExternalMetas map[string]string `xorm:"-"`
EnablePulls bool `xorm:"NOT NULL DEFAULT true"`
@@ -254,6 +255,13 @@ func (repo *Repository) ComposeMetas() map[string]string {
"user": repo.MustOwner().Name,
"repo": repo.Name,
}
switch repo.ExternalTrackerStyle {
case markdown.ISSUE_NAME_STYLE_ALPHANUMERIC:
repo.ExternalMetas["style"] = markdown.ISSUE_NAME_STYLE_ALPHANUMERIC
default:
repo.ExternalMetas["style"] = markdown.ISSUE_NAME_STYLE_NUMERIC
}
}
return repo.ExternalMetas
}