githook_edit.tmpl 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {{template "base/head" .}}
  2. <div class="repository settings edit githook">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <div class="ui grid">
  6. {{template "repo/settings/navbar" .}}
  7. <div class="twelve wide column content">
  8. {{template "base/alert" .}}
  9. <h4 class="ui top attached header">
  10. {{.i18n.Tr "repo.settings.githooks"}}
  11. </h4>
  12. <div class="ui attached segment">
  13. <p>{{.i18n.Tr "repo.settings.githook_edit_desc"}}</p>
  14. <form class="ui form" action="{{.Link}}" method="post">
  15. {{.CsrfTokenHtml}}
  16. {{with .Hook}}
  17. <div class="inline field">
  18. <label>{{$.i18n.Tr "repo.settings.githook_name"}}</label>
  19. <span><code>{{.Name}}</code></span>
  20. </div>
  21. <div class="field">
  22. <label for="content">{{$.i18n.Tr "repo.settings.githook_content"}}</label>
  23. <textarea id="content" name="content" wrap="off" autofocus>{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea>
  24. </div>
  25. <div class="inline field">
  26. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_githook"}}</button>
  27. </div>
  28. {{end}}
  29. </form>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. <script>
  36. CodeMirror.autoLoadMode(CodeMirror.fromTextArea($('#content')[0], {
  37. lineNumbers: true,
  38. mode: 'shell'
  39. }), "shell");
  40. </script>
  41. {{template "base/footer" .}}