MISC: minor fixes in webhook

pull/4722/merge
Unknwon 2017-11-18 00:38:46 -05:00
parent 43d6ad5fda
commit 0f14b92bce
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
5 changed files with 18 additions and 8 deletions

View File

@ -353,9 +353,10 @@ const (
)
var hookTaskTypes = map[string]HookTaskType{
"gogs": GOGS,
"slack": SLACK,
"discord": DISCORD,
"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 ""
}

View File

@ -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;
}

View File

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

View File

@ -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

View File

@ -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}}