Started implementation of setting
Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
parent
a9607ed720
commit
24514ba1c4
|
|
@ -16,6 +16,7 @@ const (
|
|||
UnitTypeWiki // 5 Wiki
|
||||
UnitTypeExternalWiki // 6 ExternalWiki
|
||||
UnitTypeExternalTracker // 7 ExternalTracker
|
||||
UnitTypeIssueDependencies // 8 Issue Dependencies
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -28,6 +29,7 @@ var (
|
|||
UnitTypeWiki,
|
||||
UnitTypeExternalWiki,
|
||||
UnitTypeExternalTracker,
|
||||
UnitTypeIssueDependencies,
|
||||
}
|
||||
|
||||
// defaultRepoUnits contains the default unit types
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ type RepoSettingForm struct {
|
|||
TrackerURLFormat string
|
||||
TrackerIssueStyle string
|
||||
EnablePulls bool
|
||||
EnableIssueDependencies bool
|
||||
}
|
||||
|
||||
// Validate validates the fields
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -215,6 +216,15 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
|
|||
})
|
||||
}
|
||||
|
||||
if form.EnableIssueDependencies{
|
||||
units = append(units, models.RepoUnit{
|
||||
RepoID: repo.ID,
|
||||
Type: models.UnitTypeIssueDependencies,
|
||||
Index: int(models.UnitTypeIssueDependencies),
|
||||
Config: new(models.UnitConfig),
|
||||
})
|
||||
}
|
||||
|
||||
if err := models.UpdateRepositoryUnits(repo, units); err != nil {
|
||||
ctx.Handle(500, "UpdateRepositoryUnits", err)
|
||||
return
|
||||
|
|
|
|||
|
|
@ -138,6 +138,12 @@
|
|||
<label>{{.i18n.Tr "repo.settings.use_internal_issue_tracker"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<input name="enable_issue_dependencies" type="checkbox">
|
||||
<label>Issues can have dependencies</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui radio checkbox">
|
||||
<input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="true" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.UnitTypeExternalTracker}}checked{{end}}/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user