diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-05 21:36:08 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-05 21:36:08 -0400 |
commit | 94bccbb148a4ed897eb8332fc746aa75486c5c4d (patch) | |
tree | d731481cd20e375bb62c420abdadf788db02feda /templates/repo | |
parent | 24f614f6db13e5c6720efa518641ffcdcb0d8947 (diff) | |
download | gitea-94bccbb148a4ed897eb8332fc746aa75486c5c4d.tar.gz gitea-94bccbb148a4ed897eb8332fc746aa75486c5c4d.zip |
Finish edit and remove web hook
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/hooks.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/hooks_add.tmpl | 7 | ||||
-rw-r--r-- | templates/repo/hooks_edit.tmpl | 25 |
3 files changed, 17 insertions, 17 deletions
diff --git a/templates/repo/hooks.tmpl b/templates/repo/hooks.tmpl index eed35c3583..e1b36a67e8 100644 --- a/templates/repo/hooks.tmpl +++ b/templates/repo/hooks.tmpl @@ -15,7 +15,7 @@ <ul id="repo-hooks-list" class="list-unstyled"> {{range .Webhooks}} <li> - <span class="pull-left status text-success"><i class="fa fa-check"></i></span> + {{if .IsActive}}<span class="pull-left status text-success"><i class="fa fa-check"></i></span>{{else}}<span class="pull-left status"><i class="fa fa-times"></i></span>{{end}} <a class="link" href="{{$.RepoLink}}/settings/hooks/{{.Id}}">{{.Payload}}</a> <a href="{{$.RepoLink}}/settings/hooks?remove={{.Id}}" class="remove-hook pull-right"><i class="fa fa-times"></i></a> <a href="{{$.RepoLink}}/settings/hooks/{{.Id}}" class="edit-hook pull-right"><i class="fa fa-pencil"></i></a> diff --git a/templates/repo/hooks_add.tmpl b/templates/repo/hooks_add.tmpl index cd4e6e7a9e..df3ff3bdf4 100644 --- a/templates/repo/hooks_add.tmpl +++ b/templates/repo/hooks_add.tmpl @@ -21,12 +21,14 @@ <label for="payload-url">Payload URL</label> <input id="payload-url" name="url" class="form-control" type="url" required="required"/> </div> + <div class="form-group"> <label for="content-type">Content type</label> <select id="content-type" name="content_type" class="form-control"> - <option value="json">application/json</option> + <option value="1">application/json</option> </select> </div> + <div class="form-group"> <label for="payload-secret">Secret</label> <input id="payload-secret" name="secret" class="form-control" type="text"/> @@ -43,8 +45,7 @@ <hr/> <div class="form-group"> <label> - <input type="checkbox" name="active" checked/> - Active + <input type="checkbox" name="active" checked/> Active </label> <p class="help-block">We will deliver event details when this hook is triggered.</p> </div> diff --git a/templates/repo/hooks_edit.tmpl b/templates/repo/hooks_edit.tmpl index cac2ff6538..f98ccef6f3 100644 --- a/templates/repo/hooks_edit.tmpl +++ b/templates/repo/hooks_edit.tmpl @@ -6,7 +6,8 @@ {{template "repo/setting_nav" .}} <div id="repo-setting-container" class="col-md-10"> {{template "base/alert" .}} - <form id="repo-hooks-edit-form" action="/{{.Owner.Name}}/{{.Repository.Name}}/settings/hooks/edit" method="post"> + <form id="repo-hooks-edit-form" action="{{.RepoLink}}/settings/hooks/{{.Webhook.Id}}" method="post"> + {{.CsrfTokenHtml}} <div class="panel panel-default"> <div class="panel-heading"> Manage Webhook @@ -18,36 +19,34 @@ <hr/> <div class="form-group"> <label for="payload-url">Payload URL</label> - <input id="payload-url" class="form-control" type="url" required="required" name="url"/> + <input id="payload-url" name="url" class="form-control" type="url" required="required" value="{{.Webhook.Payload}}" /> </div> + <div class="form-group"> - <label for="payload-version">Payload Version</label> - <select name="version" id="payload-version" class="form-control"> - <option value="json">application/json</option> + <label for="payload-version">Content type</label> + <select id="content-type" name="content_type" class="form-control"> + <option value="1">application/json</option> </select> </div> + <div class="form-group"> <label for="payload-secret">Secret</label> - <input id="payload-secret" class="form-control" type="text" required="required" name="secret"/> + <input id="payload-secret" name="secret" class="form-control" type="text" value="{{.Webhook.Secret}}" /> </div> <hr/> <div class="form-group"> <label>Which events would you like to trigger this webhook?</label> - <div class="radio"> <label> - <input class="form-control" type="radio" value="push" checked name="trigger"/> Just the - <i>push</i> event. + <input class="form-control" name="push_only" type="radio" {{if .Webhook.HookEvent.PushOnly}}checked {{end}}name="trigger"/> Just the <i>push</i> event. </label> </div> </div> <hr/> <div class="form-group"> <label> - <input type="checkbox" name="active" value="Active" checked/> - Active + <input type="checkbox" name="active" {{if .Webhook.IsActive}}checked{{end}}/> Active </label> - <p class="help-block">We will deliver event details when this hook is triggered.</p> </div> </div> @@ -55,7 +54,7 @@ <div class="panel-footer"> <button class="btn btn-primary">Update Webhook</button> - <a href="/{{.Owner.Name}}/{{.Repository.Name}}/settings/hooks?remove="><button class="btn btn-danger">Delete Webhook</button></a> + <a type="button" href="{{.RepoLink}}/settings/hooks?remove={{.Webhook.Id}}" class="btn btn-danger">Delete Webhook</a> </div> </div> </form> |