-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Use configurable remote name in snippets #35172
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
c483167
765b2c6
88776de
fcae5b5
967ab29
dd51628
eb02be9
1d3b20c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -542,6 +542,7 @@ func RepoAssignment(ctx *Context) { | |
ctx.Data["CanWriteIssues"] = ctx.Repo.CanWrite(unit_model.TypeIssues) | ||
ctx.Data["CanWritePulls"] = ctx.Repo.CanWrite(unit_model.TypePullRequests) | ||
ctx.Data["CanWriteActions"] = ctx.Repo.CanWrite(unit_model.TypeActions) | ||
ctx.Data["SnippetRemoteName"] = setting.Config().Repository.SnippetRemoteName.Value(ctx) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here and above: we can remove this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it is used in several places in the template, I think it makes sense to extract it into a variable, which is what I did. |
||
|
||
canSignedUserFork, err := repo_module.CanUserForkRepo(ctx, ctx.Doer, ctx.Repo.Repository) | ||
if err != nil { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,19 @@ | |
</div> | ||
</form> | ||
</div> | ||
|
||
<h4 class="ui top attached header"> | ||
{{ctx.Locale.Tr "admin.config.repository_snippets"}} | ||
</h4> | ||
<div class="ui attached segment"> | ||
<form class="ui form form-fetch-action" method="post" action="{{AppSubUrl}}/-/admin/config?key={{.SystemConfig.Repository.SnippetRemoteName.DynKey}}"> | ||
<div class="field" data-field-patched="true"> | ||
<label for="remote_name">{{ctx.Locale.Tr "admin.config.repository_snippets.remote_name"}}</label> | ||
<input id="remote_name" name="value" value="{{.SystemConfig.Repository.SnippetRemoteName.Value ctx}}" maxlength="100" dir="auto" placeholder="{{.SystemConfig.Repository.SnippetRemoteName.Def}}"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the The value is always filled by So I think we should remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main reason for In current architecture There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
But if the case IMO we should fix such edge from root cause, but not add a |
||
</div> | ||
<div class="field"> | ||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button> | ||
</div> | ||
</form> | ||
</div> | ||
{{template "admin/layout_footer" .}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
Snippet
a proper name?IMO it is not a "snippet", it is for "git guide for users"
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What name would you use here? Can it be just
RemoteName
?