list.tmpl 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <div class="twelve wide column content">
  2. {{template "base/alert" .}}
  3. <h4 class="ui top attached header">
  4. {{.i18n.Tr "repo.settings.hooks"}}
  5. <div class="ui right">
  6. <div class="ui types jump dropdown">
  7. {{if .Types}}
  8. <div class="ui blue tiny button">{{.i18n.Tr "repo.settings.add_webhook"}}</div>
  9. <div class="menu">
  10. {{range .Types}}
  11. {{if eq . "gogs"}}
  12. <a class="item" href="{{$.BaseLink}}/settings/hooks/gogs/new">
  13. <img class="img-12" src="{{AppSubUrl}}/img/favicon.png">Gogs
  14. </a>
  15. {{else if eq . "slack"}}
  16. <a class="item" href="{{$.BaseLink}}/settings/hooks/slack/new">
  17. <img class="img-12" src="{{AppSubUrl}}/img/slack.png">Slack
  18. </a>
  19. {{else if eq . "discord"}}
  20. <a class="item" href="{{$.BaseLink}}/settings/hooks/discord/new">
  21. <img class="img-12" src="{{AppSubUrl}}/img/discord.png">Discord
  22. </a>
  23. {{end}}
  24. {{end}}
  25. </div>
  26. {{end}}
  27. </div>
  28. </div>
  29. </h4>
  30. <div class="ui attached table segment">
  31. <div class="ui hook list">
  32. <div class="item">
  33. {{.Description | Str2html}}
  34. </div>
  35. {{range .Webhooks}}
  36. <div class="item">
  37. {{if eq .LastStatus 1}}
  38. <span class="text green"><i class="octicon octicon-check"></i></span>
  39. {{else if eq .LastStatus 2}}
  40. <span class="text red"><i class="octicon octicon-alert"></i></span>
  41. {{else}}
  42. <span class="text grey"><i class="octicon octicon-primitive-dot"></i></span>
  43. {{end}}
  44. <a href="{{$.BaseLink}}/settings/hooks/{{.ID}}">{{.URL}}</a>
  45. <div class="ui right">
  46. <span class="text blue"><a href="{{$.BaseLink}}/settings/hooks/{{.ID}}"><i class="fa fa-pencil"></i></a></span>
  47. <span class="text red"><a class="delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"><i class="fa fa-times"></i></a></span>
  48. </div>
  49. </div>
  50. {{end}}
  51. </div>
  52. </div>
  53. </div>
  54. {{template "repo/settings/webhook/delete_modal" .}}