Browse Source

MISC: minor fixes in webhook

pull/4722/merge
Unknwon 7 years ago
parent
commit
0f14b92bce
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 3
      models/webhook.go
  2. 3
      public/css/gogs.css
  3. 4
      public/less/_repository.less
  4. 2
      routes/repo/pull.go
  5. 8
      templates/repo/settings/webhook/list.tmpl

3
models/webhook.go

@ -356,6 +356,7 @@ var hookTaskTypes = map[string]HookTaskType{
"gogs": GOGS,
"slack": SLACK,
"discord": DISCORD,
"dingtalk": DINGTALK,
}
// ToHookTaskType returns HookTaskType by given name.
@ -371,6 +372,8 @@ func (t HookTaskType) Name() string {
return "slack"
case DISCORD:
return "discord"
case DINGTALK:
return "dingtalk"
}
return ""
}

3
public/css/gogs.css

@ -2399,6 +2399,9 @@ footer .ui.language .menu {
.repository.settings.webhooks .types .menu .item {
padding: 10px !important;
}
.repository.settings.webhooks .logo.item img {
margin-top: -4px;
}
.repository.settings.webhook .text.desc {
margin-top: 5px;
}

4
public/less/_repository.less

@ -1407,6 +1407,10 @@
padding: 10px !important;
}
}
.logo.item img {
margin-top: -4px;
}
}
&.webhook {

2
routes/repo/pull.go

@ -275,7 +275,7 @@ func ViewPullCommits(c *context.Context) {
if c.Written() {
return
} else if prInfo == nil {
c.Handle(404, "ViewPullCommits", nil)
c.NotFound()
return
}
commits = prInfo.Commits

8
templates/repo/settings/webhook/list.tmpl

@ -9,19 +9,19 @@
<div class="menu">
{{range .Types}}
{{if eq . "gogs"}}
<a class="item" href="{{$.BaseLink}}/settings/hooks/gogs/new">
<a class="item logo" href="{{$.BaseLink}}/settings/hooks/gogs/new">
<img class="img-12" src="{{AppSubURL}}/img/favicon.png">Gogs
</a>
{{else if eq . "slack"}}
<a class="item" href="{{$.BaseLink}}/settings/hooks/slack/new">
<a class="item logo" href="{{$.BaseLink}}/settings/hooks/slack/new">
<img class="img-12" src="{{AppSubURL}}/img/slack.png">Slack
</a>
{{else if eq . "discord"}}
<a class="item" href="{{$.BaseLink}}/settings/hooks/discord/new">
<a class="item logo" href="{{$.BaseLink}}/settings/hooks/discord/new">
<img class="img-12" src="{{AppSubURL}}/img/discord.png">Discord
</a>
{{else if eq . "dingtalk"}}
<a class="item" href="{{$.BaseLink}}/settings/hooks/dingtalk/new">
<a class="item logo" href="{{$.BaseLink}}/settings/hooks/dingtalk/new">
<img class="img-12" src="{{AppSubURL}}/img/dingtalk.png">Dingtalk
</a>
{{end}}

Loading…
Cancel
Save