81 lines
4.8 KiB
HTML
81 lines
4.8 KiB
HTML
{{define "title"}}Edit Repo{{end}}
|
|
|
|
{{define "content"}}
|
|
{{with .Data}}
|
|
<div class="mx-auto max-w-lg">
|
|
<div class="mb-4">
|
|
<a href="/repos" class="text-sm text-blue-600 hover:text-blue-500">← Back to repos</a>
|
|
</div>
|
|
|
|
<h1 class="text-2xl font-bold text-gray-900 mb-6">Edit Repo</h1>
|
|
|
|
{{if .Repo.WebhookVerified}}
|
|
<div class="mb-6 rounded-md bg-green-50 p-4 ring-1 ring-green-200">
|
|
<div class="flex items-center gap-2">
|
|
<svg class="h-5 w-5 text-green-600" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
</svg>
|
|
<p class="text-sm font-semibold text-green-800">Webhook verified</p>
|
|
</div>
|
|
{{if .Repo.WebhookVerifiedAt}}
|
|
<p class="mt-1 text-xs text-green-600">Verified at {{.Repo.WebhookVerifiedAt.Format "Jan 02, 2006 3:04 PM"}}</p>
|
|
{{end}}
|
|
</div>
|
|
{{else}}
|
|
<div class="mb-6 rounded-md bg-yellow-50 p-4 ring-1 ring-yellow-200">
|
|
<p class="text-sm font-semibold text-yellow-800 mb-3">Webhook setup required</p>
|
|
<p class="text-sm text-yellow-700 mb-3">Follow these steps to configure the Forgejo webhook:</p>
|
|
<ol class="list-decimal list-inside space-y-2 text-sm text-yellow-700">
|
|
<li>Go to <a href="{{.ForgejoURL}}/{{.Repo.ForgejoOwner}}/{{.Repo.ForgejoRepo}}/settings/hooks" target="_blank" class="text-blue-600 underline hover:text-blue-500">repo webhook settings in Forgejo</a></li>
|
|
<li>Click <strong>Add Webhook</strong> → <strong>Forgejo</strong></li>
|
|
<li>Set <strong>Target URL</strong> to:
|
|
<code class="block mt-1 bg-yellow-100 px-2 py-1 rounded text-xs font-mono select-all">{{.BaseURL}}/webhooks/forgejo/{{.Repo.Slug}}</code>
|
|
</li>
|
|
<li>Set <strong>Content Type</strong> to <code class="font-mono text-xs">application/json</code></li>
|
|
<li>Set <strong>Secret</strong> to:
|
|
<code class="block mt-1 bg-yellow-100 px-2 py-1 rounded text-xs font-mono select-all">{{.Repo.WebhookSecret}}</code>
|
|
</li>
|
|
<li>Under <strong>Trigger On</strong>, select <strong>Custom Events</strong> → check only <strong>Issues</strong></li>
|
|
<li>Click <strong>Add Webhook</strong>, then click into the webhook and hit <strong>Test Delivery</strong></li>
|
|
<li>Come back and <strong>reload this page</strong> to confirm verification</li>
|
|
</ol>
|
|
</div>
|
|
{{end}}
|
|
|
|
<form method="POST" action="/repos/{{.Repo.ID}}" class="space-y-6 bg-white p-6 rounded-lg shadow ring-1 ring-gray-200">
|
|
<div>
|
|
<label for="name" class="block text-sm font-medium text-gray-700">Display Name</label>
|
|
<input type="text" name="name" id="name" required value="{{.Repo.Name}}"
|
|
class="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="slug" class="block text-sm font-medium text-gray-700">Slug</label>
|
|
<input type="text" name="slug" id="slug" required value="{{.Repo.Slug}}"
|
|
class="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="forgejo_owner" class="block text-sm font-medium text-gray-700">Forgejo Owner</label>
|
|
<input type="text" name="forgejo_owner" id="forgejo_owner" required value="{{.Repo.ForgejoOwner}}"
|
|
class="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="forgejo_repo" class="block text-sm font-medium text-gray-700">Forgejo Repo</label>
|
|
<input type="text" name="forgejo_repo" id="forgejo_repo" required value="{{.Repo.ForgejoRepo}}"
|
|
class="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500">
|
|
</div>
|
|
|
|
<div class="flex items-center gap-2">
|
|
<input type="checkbox" name="active" id="active" {{if .Repo.Active}}checked{{end}}
|
|
class="h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500">
|
|
<label for="active" class="text-sm font-medium text-gray-700">Active</label>
|
|
</div>
|
|
|
|
<button type="submit" class="w-full rounded-md bg-blue-600 px-4 py-2 text-sm font-semibold text-white shadow hover:bg-blue-500">Save Changes</button>
|
|
</form>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|