forked from forgejo/forgejo
Rename ctx.Form() to ctx.FormString() and move code into own file (#16571)
Followup from #16562 prepare for #16567 * Rename ctx.Form() to ctx.FormString() * Reimplement FormX func to need less code and cpu cycles * Move code into own file
This commit is contained in:
parent
2eeae4edb6
commit
c4d70a0325
64 changed files with 236 additions and 449 deletions
|
@ -34,7 +34,7 @@ func SetEditorconfigIfExists(ctx *context.Context) {
|
|||
|
||||
// SetDiffViewStyle set diff style as render variable
|
||||
func SetDiffViewStyle(ctx *context.Context) {
|
||||
queryStyle := ctx.Form("style")
|
||||
queryStyle := ctx.FormString("style")
|
||||
|
||||
if !ctx.IsSigned {
|
||||
ctx.Data["IsSplitStyle"] = queryStyle == "split"
|
||||
|
@ -62,7 +62,7 @@ func SetDiffViewStyle(ctx *context.Context) {
|
|||
|
||||
// SetWhitespaceBehavior set whitespace behavior as render variable
|
||||
func SetWhitespaceBehavior(ctx *context.Context) {
|
||||
whitespaceBehavior := ctx.Form("whitespace")
|
||||
whitespaceBehavior := ctx.FormString("whitespace")
|
||||
switch whitespaceBehavior {
|
||||
case "ignore-all", "ignore-eol", "ignore-change":
|
||||
ctx.Data["WhitespaceBehavior"] = whitespaceBehavior
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue