forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview/pulls: info on creating a patch

anirudh.fi c3e8d05a 7a24d16c

verified
Changed files
+23 -17
appview
pages
templates
repo
+9 -8
appview/pages/templates/repo/new.html
···
<div class="p-6 bg-white drop-shadow-sm rounded">
<form hx-post="/repo/new" class="space-y-12" hx-swap="none">
<div class="space-y-2">
-
<label for="name" class="block uppercase font-bold text-sm">Repository name</label>
+
<label for="name" class="-mb-1">Repository name</label>
<input
type="text"
id="name"
···
/>
<p class="text-sm text-gray-500">All repositories are publicly visible.</p>
-
<label for="branch" class="block uppercase font-bold text-sm">Default branch</label>
+
<label for="branch">Default branch</label>
<input
type="text"
id="branch"
···
class="w-full max-w-md"
/>
-
<label for="description" class="block uppercase font-bold text-sm">Description</label>
+
<label for="description">Description</label>
<input
type="text"
id="description"
···
</div>
<fieldset class="space-y-3">
-
<legend class="uppercase font-bold text-sm">Select a knot</legend>
+
<legend>Select a knot</legend>
<div class="space-y-2">
+
<div class="flex flex-col">
{{ range .Knots }}
-
<div>
-
<label class="inline-flex items-center">
+
<div class="flex items-center">
<input
type="radio"
name="domain"
value="{{ . }}"
class="mr-2"
+
id="domain-{{ . }}"
/>
<span>{{ . }}</span>
-
</label>
-
</div>
+
</div>
{{ else }}
<p>No knots available.</p>
{{ end }}
+
</div>
</div>
<p class="text-sm text-gray-500">A knot hosts repository data. <a href="/knots" class="underline">Learn how to register your own knot.</a></p>
</fieldset>
+14 -9
appview/pages/templates/repo/pulls/new.html
···
{{ define "title" }}new pull | {{ .RepoInfo.FullName }}{{ end }}
{{ define "repoContent" }}
+
<section class="prose">
+
<p>
+
This is v1 of the pull request flow. Paste your patch in the form below.
+
Here are the steps to get you started:
+
<ul class="list-decimal pl-10 space-y-2 text-gray-700">
+
<li class="leading-relaxed">Clone this repository.</li>
+
<li class="leading-relaxed">Make your changes in your local repository.</li>
+
<li class="leading-relaxed">Grab the diff using <code class="bg-gray-100 px-1 py-0.5 rounded text-gray-800 font-mono text-sm">git diff</code>.</li>
+
<li class="leading-relaxed">Paste the diff output in the form below.</li>
+
</ul>
+
</p>
+
</section>
<form
hx-post="/{{ .RepoInfo.FullName }}/pulls/new"
class="mt-6 space-y-6"
···
</p>
<select
name="targetBranch"
-
class="p-1 border border-gray-200 bg-white"
+
class="p-1 mb-2 border border-gray-200 bg-white"
>
<option disabled selected>select a branch</option>
{{ range .Branches }}
···
</option>
{{ end }}
</select>
-
</div>
-
<div>
<label for="body">add a description</label>
<textarea
name="body"
···
id="patch"
rows="10"
class="w-full resize-y font-mono"
-
placeholder="Paste your git-format-patch output here."
-
hx-post="/pulls/validate"
-
hx-trigger="input changed delay:500ms"
-
hx-target="#patch-validation"
-
hx-include="[name='patch']"
+
placeholder="Paste your git diff output here."
></textarea>
-
<div id="pull-validate"></div>
</div>
</div>
<div>