Browse Source

创建模板时增加协议

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.7.1
zouap 3 years ago
parent
commit
7da1e4196e
2 changed files with 5 additions and 2 deletions
  1. +3
    -0
      routers/repo/repo.go
  2. +2
    -2
      templates/repo/create.tmpl

+ 3
- 0
routers/repo/repo.go View File

@@ -195,8 +195,11 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) {
}
ctx.Data["ContextUser"] = ctxUser
if !form.AutoAgree {
ctx.Data["CheckedAutoAgree"] = ""
ctx.RenderWithErr(ctx.Tr("repo.template.one_promise"), tplCreate, form)
return
} else {
ctx.Data["CheckedAutoAgree"] = "checked"
}
if ctx.HasError() {
ctx.HTML(200, tplCreate)


+ 2
- 2
templates/repo/create.tmpl View File

@@ -81,7 +81,7 @@
</div>
</div>
<div class="inline field">
<div class="ui checkbox" id="auto-init">
<div class="ui checkbox {{.CheckedAutoAgree}}" id="auto-init">
<input class="hidden" name="auto_agree" type="checkbox">
<label
style="width: 76%;text-align: justify;line-height: 1.5;">{{.i18n.Tr "repo.use_repo_agreement"}}
@@ -160,7 +160,7 @@
placeholder="master">
</div>
<div class="inline field">
<div class="ui checkbox" id="auto-init">
<div class="ui checkbox {{.CheckedAutoAgree}}" id="auto-init">
<input class="hidden" name="auto_agree" type="checkbox">
<label
style="width: 76%;text-align: justify;line-height: 1.5;">{{.i18n.Tr "repo.use_repo_agreement"}}


Loading…
Cancel
Save