1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +00:00

Finish edit and remove web hook

This commit is contained in:
Unknown
2014-05-05 21:36:08 -04:00
parent 24f614f6db
commit 94bccbb148
7 changed files with 159 additions and 53 deletions

View File

@@ -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>

View File

@@ -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/>&nbsp;&nbsp;
Active
<input type="checkbox" name="active" checked/>&nbsp;&nbsp;Active
</label>
<p class="help-block">We will deliver event details when this hook is triggered.</p>
</div>

View File

@@ -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/>&nbsp;&nbsp;
Active
<input type="checkbox" name="active" {{if .Webhook.IsActive}}checked{{end}}/>&nbsp;&nbsp;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>&nbsp;&nbsp;
<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>