mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	fix hidden bug on tpl rendering
This commit is contained in:
		@@ -282,6 +282,7 @@ func WebHooksNew(ctx *middleware.Context) {
 | 
				
			|||||||
	ctx.Data["PageIsSettingsHooksNew"] = true
 | 
						ctx.Data["PageIsSettingsHooksNew"] = true
 | 
				
			||||||
	ctx.Data["Webhook"] = models.Webhook{HookEvent: &models.HookEvent{}}
 | 
						ctx.Data["Webhook"] = models.Webhook{HookEvent: &models.HookEvent{}}
 | 
				
			||||||
	renderHookTypes(ctx)
 | 
						renderHookTypes(ctx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	orCtx, err := getOrgRepoCtx(ctx)
 | 
						orCtx, err := getOrgRepoCtx(ctx)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		ctx.Handle(500, "WebHooksNew(getOrgRepoCtx)", err)
 | 
							ctx.Handle(500, "WebHooksNew(getOrgRepoCtx)", err)
 | 
				
			||||||
@@ -296,6 +297,7 @@ func WebHooksNewPost(ctx *middleware.Context, form auth.NewWebhookForm) {
 | 
				
			|||||||
	ctx.Data["PageIsSettingsHooks"] = true
 | 
						ctx.Data["PageIsSettingsHooks"] = true
 | 
				
			||||||
	ctx.Data["PageIsSettingsHooksNew"] = true
 | 
						ctx.Data["PageIsSettingsHooksNew"] = true
 | 
				
			||||||
	ctx.Data["Webhook"] = models.Webhook{HookEvent: &models.HookEvent{}}
 | 
						ctx.Data["Webhook"] = models.Webhook{HookEvent: &models.HookEvent{}}
 | 
				
			||||||
 | 
						renderHookTypes(ctx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	orCtx, err := getOrgRepoCtx(ctx)
 | 
						orCtx, err := getOrgRepoCtx(ctx)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
@@ -364,15 +366,11 @@ func WebHooksEdit(ctx *middleware.Context) {
 | 
				
			|||||||
	// set data per HookTaskType
 | 
						// set data per HookTaskType
 | 
				
			||||||
	switch w.HookTaskType {
 | 
						switch w.HookTaskType {
 | 
				
			||||||
	case models.SLACK:
 | 
						case models.SLACK:
 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
		ctx.Data["SlackHook"] = w.GetSlackHook()
 | 
							ctx.Data["SlackHook"] = w.GetSlackHook()
 | 
				
			||||||
		ctx.Data["HookType"] = "Slack"
 | 
							ctx.Data["HookType"] = "Slack"
 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
		ctx.Data["HookType"] = "Gogs"
 | 
							ctx.Data["HookType"] = "Gogs"
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	w.GetEvent()
 | 
						w.GetEvent()
 | 
				
			||||||
	ctx.Data["Webhook"] = w
 | 
						ctx.Data["Webhook"] = w
 | 
				
			||||||
	orCtx, err := getOrgRepoCtx(ctx)
 | 
						orCtx, err := getOrgRepoCtx(ctx)
 | 
				
			||||||
@@ -403,6 +401,15 @@ func WebHooksEditPost(ctx *middleware.Context, form auth.NewWebhookForm) {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// set data per HookTaskType
 | 
				
			||||||
 | 
						switch w.HookTaskType {
 | 
				
			||||||
 | 
						case models.SLACK:
 | 
				
			||||||
 | 
							ctx.Data["SlackHook"] = w.GetSlackHook()
 | 
				
			||||||
 | 
							ctx.Data["HookType"] = "Slack"
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							ctx.Data["HookType"] = "Gogs"
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	w.GetEvent()
 | 
						w.GetEvent()
 | 
				
			||||||
	ctx.Data["Webhook"] = w
 | 
						ctx.Data["Webhook"] = w
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user