Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trust model selection from repository creation on web page because it can be changed in settings later #28814

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion routers/web/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func CreatePost(ctx *context.Context) {
DefaultBranch: form.DefaultBranch,
AutoInit: form.AutoInit,
IsTemplate: form.Template,
TrustModel: repo_model.ToTrustModel(form.TrustModel),
TrustModel: repo_model.DefaultTrustModel,
ObjectFormatName: form.ObjectFormatName,
})
if err == nil {
Expand Down
8 changes: 0 additions & 8 deletions services/forms/repo_form.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ import (
"gitea.com/go-chi/binding"
)

// _______________________________________ _________.______________________ _______________.___.
// \______ \_ _____/\______ \_____ \ / _____/| \__ ___/\_____ \\______ \__ | |
// | _/| __)_ | ___// | \ \_____ \ | | | | / | \| _// | |
// | | \| \ | | / | \/ \| | | | / | \ | \\____ |
// |____|_ /_______ / |____| \_______ /_______ /|___| |____| \_______ /____|_ // ______|
// \/ \/ \/ \/ \/ \/ \/

// CreateRepoForm form for creating repository
type CreateRepoForm struct {
UID int64 `binding:"Required"`
Expand All @@ -50,7 +43,6 @@ type CreateRepoForm struct {
Avatar bool
Labels bool
ProtectedBranch bool
TrustModel string

ForkSingleBranch string
ObjectFormatName string
Expand Down
26 changes: 1 addition & 25 deletions templates/repo/create.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</div>
<div class="inline field {{if .Err_Description}}error{{end}}">
<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
<textarea id="description" name="description" placeholder="{{ctx.Locale.Tr "repo.repo_desc_helper"}}" maxlength="2048">{{.description}}</textarea>
<textarea id="description" rows="2" name="description" placeholder="{{ctx.Locale.Tr "repo.repo_desc_helper"}}" maxlength="2048">{{.description}}</textarea>
</div>
<div class="inline field">
<label>{{ctx.Locale.Tr "repo.template"}}</label>
Expand Down Expand Up @@ -185,29 +185,6 @@
<input id="default_branch" name="default_branch" value="{{.default_branch}}" placeholder="{{.default_branch}}">
<span class="help">{{ctx.Locale.Tr "repo.default_branch_helper"}}</span>
</div>
<div class="inline field">
<label>{{ctx.Locale.Tr "repo.settings.trust_model"}}</label>
<div class="ui selection owner dropdown">
<input type="hidden" id="trust_model" name="trust_model" value="default" required>
<div class="default text">{{ctx.Locale.Tr "repo.settings.trust_model"}}</div>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
<div class="item" data-value="default">{{ctx.Locale.Tr "repo.settings.trust_model.default"}}</div>
<div class="item" data-value="collaborator">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator"}}</div>
<div class="item" data-value="committer">{{ctx.Locale.Tr "repo.settings.trust_model.committer"}}</div>
<div class="item" data-value="collaboratorcommitter">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter"}}</div>
</div>
</div>
<div class="help">
{{ctx.Locale.Tr "repo.trust_model_helper"}}
<ul>
<li>{{ctx.Locale.Tr "repo.trust_model_helper_collaborator"}}</li>
<li>{{ctx.Locale.Tr "repo.trust_model_helper_committer"}}</li>
<li>{{ctx.Locale.Tr "repo.trust_model_helper_collaborator_committer"}}</li>
<li>{{ctx.Locale.Tr "repo.trust_model_helper_default"}}</li>
</ul>
</div>
</div>
<div class="inline field">
<label>{{ctx.Locale.Tr "repo.template"}}</label>
<div class="ui checkbox">
Expand All @@ -216,7 +193,6 @@
</div>
</div>
</div>

<br>
<div class="inline field">
<label></label>
Expand Down