File name
        Commit message
        Commit date
    File name
        Commit message
        Commit date
    File name
        Commit message
        Commit date
    File name
        Commit message
        Commit date
    File name
        Commit message
        Commit date
    @**
* Yona, 21st Century Project Hosting SW
*
* Copyright Yona & Yobi Authors & NAVER Corp. & NAVER LABS Corp.
* https://yona.io
**@
@(message: String, webhooks: List[models.Webhook], project:Project)
@import utils.TemplateHelper._
@import utils.AccessControl._
@projectLayout(message, project, utils.MenuType.PROJECT_SETTING) {
  @projectMenu(project, utils.MenuType.PROJECT_SETTING, "")
  <div class="page-wrap-outer">
    <div class="project-page-wrap webhook-editor-wrap">
      @partial_settingmenu(project)
      @if(isProjectResourceCreatable(UserApp.currentUser, project, ResourceType.WEBHOOK)) {
      <form id="formNewWebhook" action="@routes.ProjectApp.newWebhook(project.owner, project.name)" method="post" class="new-webhook-wrap">
        <strong class="form-legend">@Messages("project.webhook.new")</strong>
        <div class="form-wrap form-actions">
          <div>
            <input type="text" name="payloadUrl" class="input-webhook-payload" maxlength="2000" autocomplete="off" placeholder="@Messages("project.webhook.payloadUrl")">
            <input type="text" name="secret" class="input-webhook-secret" maxlength="250" autocomplete="off" placeholder="@Messages("project.webhook.secret")">
            <button type="submit" class="ybtn ybtn-primary btn-submit">@Messages("project.webhook.add")</button>
          </div>
          <div>
            <label class="radio inline">
              <input type="radio" name="webhookType" value="SIMPLE" checked> Messenger (Only text)
            </label>
            <label class="radio inline">
              <input type="radio" name="webhookType" value="DETAIL_SLACK"> Slack (Meta)
            </label>
            <label class="radio inline">
              <input type="radio" name="webhookType" value="DETAIL_HANGOUT_CHAT"> Google Chat (Thread)
            </label>
            <label class="radio inline">
              <input type="radio" name="webhookType" value="JSON"> Continuous Integration tool (Only push event)
            </label>
            <label class="radio inline"> | </label><label class="radio inline"></label>
            <label class="checkbox inline" for="gitPush">
              <input type="checkbox" id="gitPush" name="gitPush" class="form-check-input"> @Messages("project.webhook.includeGitPush")
            </label>
          </div>
        </div>
        <div>
          @Html(Messages("project.webhook.help"))
        </div>
      </form>
      }
      <div id="webhooksList" class="webhook-list-wrap">
        @partial_webhooks_list(project, webhooks)
      </div>
    </div>
  </div>
  <script type="text/javascript">
    $(function(){
      $yobi.loadModule("project.Webhook", {
        "form": "#formNewWebhook",
        "list": "#webhooksList"
      });
      $('input[type=radio][name=webhookType]').change(function() {
        if (this.value == 'JSON') {
          $("input:checkbox[name=gitPush]").attr('checked', true);
          $("input:checkbox[name=gitPush]").attr('onclick', 'return false;');
        } else {
          $("input:checkbox[name=gitPush]").attr('onclick', '');
          $("input:checkbox[name=gitPush]").attr('checked', false);
        }
      });
    });
  </script>
}