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

58 lines
2.0 KiB
Cheetah

<div class="twelve wide column content">
{{template "base/alert" .}}
<h4 class="ui top attached header">
{{.i18n.Tr "repo.settings.hooks"}}
</h4>
<div class="ui attached segment">
<p>{{.Description | Safe}}</p>
<div class="ui hook list">
{{range .Webhooks}}
<div class="item">
{{if eq .LastStatus 1}}
<span class="text green"><i class="octicon octicon-check"></i></span>
{{else if eq .LastStatus 2}}
<span class="text red"><i class="octicon octicon-alert"></i></span>
{{else}}
<span class="text grey"><i class="octicon octicon-primitive-dot"></i></span>
{{end}}
<a href="{{$.Link}}/{{.ID}}">{{.URL}}</a>
<div class="ui right">
<a class="text blue" href="{{$.Link}}/{{.ID}}"><i class="fa fa-pencil"></i></a>
<a class="text red delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"><i class="fa fa-trash-o"></i></a>
</div>
</div>
{{end}}
</div>
</div>
<div class="ui bottom attached segment">
<span><b>{{.i18n.Tr "repo.settings.webhooks.add_new"}}</b></span>
<div class="ui selection jump dropdown">
<i class="dropdown icon"></i>
<div class="default text">{{.i18n.Tr "repo.settings.webhooks.choose_a_type"}}</div>
<div class="menu">
{{range .Types}}
{{if eq . "gogs"}}
<a class="item logo" href="{{$.Link}}/gogs/new">
<img class="img-12" src="{{AppSubURL}}/img/favicon.png">Gogs
</a>
{{else if eq . "slack"}}
<a class="item logo" href="{{$.Link}}/slack/new">
<img class="img-12" src="{{AppSubURL}}/img/slack.png">Slack
</a>
{{else if eq . "discord"}}
<a class="item logo" href="{{$.Link}}/discord/new">
<img class="img-12" src="{{AppSubURL}}/img/discord.png">Discord
</a>
{{else if eq . "dingtalk"}}
<a class="item logo" href="{{$.Link}}/dingtalk/new">
<img class="img-12" src="{{AppSubURL}}/img/dingtalk.png">Dingtalk
</a>
{{end}}
{{end}}
</div>
</div>
</div>
</div>
{{template "repo/settings/webhook/delete_modal" .}}