list.tmpl 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 logo" 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 logo" 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 logo" href="{{$.BaseLink}}/settings/hooks/discord/new">
  21. <img class="img-12" src="{{AppSubURL}}/img/discord.png">Discord
  22. </a>
  23. {{else if eq . "dingtalk"}}
  24. <a class="item logo" href="{{$.BaseLink}}/settings/hooks/dingtalk/new">
  25. <img class="img-12" src="{{AppSubURL}}/img/dingtalk.png">Dingtalk
  26. </a>
  27. {{end}}
  28. {{end}}
  29. </div>
  30. {{end}}
  31. </div>
  32. </div>
  33. </h4>
  34. <div class="ui attached table segment">
  35. <div class="ui hook list">
  36. <div class="item">
  37. {{.Description | Str2HTML}}
  38. </div>
  39. {{range .Webhooks}}
  40. <div class="item">
  41. {{if eq .LastStatus 1}}
  42. <span class="text green"><i class="octicon octicon-check"></i></span>
  43. {{else if eq .LastStatus 2}}
  44. <span class="text red"><i class="octicon octicon-alert"></i></span>
  45. {{else}}
  46. <span class="text grey"><i class="octicon octicon-primitive-dot"></i></span>
  47. {{end}}
  48. <a href="{{$.BaseLink}}/settings/hooks/{{.ID}}">{{.URL}}</a>
  49. <div class="ui right">
  50. <span class="text blue"><a href="{{$.BaseLink}}/settings/hooks/{{.ID}}"><i class="fa fa-pencil"></i></a></span>
  51. <span class="text red"><a class="delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"><i class="fa fa-times"></i></a></span>
  52. </div>
  53. </div>
  54. {{end}}
  55. </div>
  56. </div>
  57. </div>
  58. {{template "repo/settings/webhook/delete_modal" .}}