···
{{ define "title" }}new repo{{ end }}
4
-
<div class="px-6 py-2 mb-4">
5
-
<h1 class="text-xl font-bold dark:text-white mb-1">Create a new repository</h1>
6
-
<p class="text-gray-600 dark:text-gray-400 mb-1">
7
-
Repositories contain a project's files and version history.
4
+
<div class="grid grid-cols-12">
5
+
<div class="col-span-full md:col-start-3 md:col-span-8 px-6 py-2 mb-4">
6
+
<h1 class="text-xl font-bold dark:text-white mb-1">Create a new repository</h1>
7
+
<p class="text-gray-600 dark:text-gray-400 mb-1">
8
+
Repositories contain a project's files and version history. All
9
+
repositories are publicly accessible.
12
+
{{ template "newRepoPanel" . }}
11
-
<div class="bg-white dark:bg-gray-800 drop-shadow-sm rounded">
16
+
{{ define "newRepoPanel" }}
17
+
<div class="col-span-full md:col-start-3 md:col-span-8 bg-white dark:bg-gray-800 drop-shadow-sm rounded p-6 md:px-10">
18
+
{{ template "newRepoForm" . }}
22
+
{{ define "newRepoForm" }}
<form hx-post="/repo/new" hx-swap="none" hx-indicator="#spinner">
24
+
{{ template "step-1" . }}
25
+
{{ template "step-2" . }}
15
-
<!-- Step 1: General -->
16
-
<div class="flex gap-4">
17
-
<div class="flex flex-col items-center w-10 flex-shrink-0">
18
-
<div class="w-6 h-6 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 rounded-full flex items-center justify-center text-sm font-medium mt-1">
21
-
<div class="w-px bg-gray-300 dark:bg-gray-600 h-80 mt-1"></div>
23
-
<div class="flex-1">
25
-
<div class="text-lg font-semibold dark:text-white mb-1">General</div>
26
-
<div class="text-sm text-gray-500 dark:text-gray-400">Basic repository information.</div>
27
+
<div class="mt-8 flex justify-end">
28
+
<button type="submit" class="btn-create flex items-center gap-2">
29
+
{{ i "book-plus" "w-4 h-4" }}
31
+
<span id="spinner" class="group">
32
+
{{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }}
36
+
<div id="repo" class="error mt-2"></div>
29
-
<div class="space-y-2">
30
-
<!-- Repository Name with Owner -->
32
-
<label class="block text-sm font-bold uppercase dark:text-white mb-1">
35
-
<div class="flex flex-col md:flex-row md:items-center gap-2 md:gap-0">
36
-
{{ if .LoggedInUser.Handle }}
37
-
<div class="flex items-center px-2 py-2 gap-1 text-sm text-gray-700 dark:text-gray-300 md:border md:border-r-0 md:border-gray-300 md:dark:border-gray-600 md:rounded-l md:bg-gray-50 md:dark:bg-gray-700">
38
-
{{ template "user/fragments/picHandle" .LoggedInUser.Handle }}
39
-
<span class="md:hidden pr-2 py-2 text-gray-500 dark:text-gray-400">/</span>
41
-
<span class="hidden md:inline pr-2 py-2 text-gray-500 dark:text-gray-400 border-t border-b border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-700">/</span>
48
-
class="w-full max-w-md dark:bg-gray-700 dark:text-white dark:border-gray-600 border border-gray-300 rounded md:rounded-r md:rounded-l-none px-3 py-2"
49
-
placeholder="repository-name"
52
-
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">
53
-
Choose a unique, descriptive name for your repository. Use letters, numbers, and hyphens.
41
+
{{ define "step-1" }}
42
+
<div class="flex gap-4 relative border-l border-gray-200 dark:border-gray-700 pl-6">
43
+
<div class="absolute -left-3 -top-0">
44
+
{{ template "numberCircle" 1 }}
47
+
<!-- Content column -->
48
+
<div class="flex-1 pb-12">
49
+
<h2 class="text-lg font-semibold dark:text-white">General</h2>
50
+
<div class="text-sm text-gray-500 dark:text-gray-400 mb-4">Basic repository information.</div>
57
-
<!-- Description -->
59
-
<label for="description" class="block text-sm font-bold uppercase dark:text-white mb-1">
66
-
class="w-full max-w-md dark:bg-gray-700 dark:text-white dark:border-gray-600 border border-gray-300 rounded px-3 py-2"
67
-
placeholder="A brief description of your project..."
69
-
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">
70
-
Optional. A short description to help others understand what your project does.
52
+
<div class="space-y-2">
53
+
{{ template "name" . }}
54
+
{{ template "description" . }}
77
-
<!-- Step 2: Configuration -->
78
-
<div class="flex gap-4">
79
-
<div class="flex flex-col items-center w-10 flex-shrink-0">
80
-
<div class="w-6 h-6 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 rounded-full flex items-center justify-center text-sm font-medium mt-1">
84
-
<div class="flex-1">
86
-
<div class="text-lg font-semibold dark:text-white mb-1">Configuration</div>
87
-
<div class="text-sm text-gray-500 dark:text-gray-400">Repository settings and hosting.</div>
60
+
{{ define "step-2" }}
61
+
<div class="flex gap-4 relative border-l border-gray-200 dark:border-gray-700 pl-6">
62
+
<div class="absolute -left-3 -top-0">
63
+
{{ template "numberCircle" 2 }}
90
-
<div class="space-y-2">
91
-
<!-- Default Branch -->
93
-
<label for="branch" class="block text-sm font-bold uppercase dark:text-white mb-1">
102
-
class="w-full max-w-md dark:bg-gray-700 dark:text-white dark:border-gray-600 border border-gray-300 rounded px-3 py-2"
104
-
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">
105
-
The primary branch where development happens. Common choices are "main" or "master".
66
+
<div class="flex-1">
67
+
<h2 class="text-lg font-semibold dark:text-white">Configuration</h2>
68
+
<div class="text-sm text-gray-500 dark:text-gray-400 mb-4">Repository settings and hosting.</div>
109
-
<!-- Knot Selection -->
111
-
<label class="block text-sm font-bold uppercase dark:text-white mb-1">
114
-
<div class="w-full max-w-md dark:bg-gray-700 dark:text-white dark:border-gray-600 border border-gray-300 rounded p-3 space-y-2">
116
-
<div class="flex items-center">
122
-
id="domain-{{ . }}"
125
-
<label for="domain-{{ . }}" class="dark:text-white lowercase">{{ . }}</label>
128
-
<p class="dark:text-white">no knots available.</p>
131
-
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">
132
-
A knot hosts repository data and handles Git operations.
133
-
You can also <a href="/knots" class="underline">register your own knot</a>.
70
+
<div class="space-y-2">
71
+
{{ template "defaultBranch" . }}
72
+
{{ template "knot" . }}
141
-
<!-- Create Repository Button -->
142
-
<div class="p-6 border-t border-gray-200 dark:border-gray-700">
143
-
<div class="flex items-center justify-between">
144
-
<div class="text-sm text-gray-500 dark:text-gray-400">
145
-
All repositories are publicly accessible.
147
-
<button type="submit" class="btn-create flex items-center gap-2">
148
-
{{ i "book-plus" "w-4 h-4" }}
150
-
<span id="spinner" class="group">
151
-
{{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }}
79
+
<!-- Repository Name with Owner -->
81
+
<label class="block text-sm font-bold uppercase dark:text-white mb-1">
84
+
<div class="flex flex-col md:flex-row md:items-center gap-2 md:gap-0 w-full">
85
+
<div class="shrink-0 hidden md:flex items-center px-2 py-2 gap-1 text-sm text-gray-700 dark:text-gray-300 md:border md:border-r-0 md:border-gray-300 md:dark:border-gray-600 md:rounded-l md:bg-gray-50 md:dark:bg-gray-700">
86
+
{{ template "user/fragments/picHandle" .LoggedInUser.Did }}
155
-
<div id="repo" class="error mt-2"></div>
93
+
class="flex-1 dark:bg-gray-700 dark:text-white dark:border-gray-600 border border-gray-300 rounded md:rounded-r md:rounded-l-none px-3 py-2"
94
+
placeholder="repository-name"
97
+
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">
98
+
Choose a unique, descriptive name for your repository. Use letters, numbers, and hyphens.
103
+
{{ define "description" }}
104
+
<!-- Description -->
106
+
<label for="description" class="block text-sm font-bold uppercase dark:text-white mb-1">
113
+
class="w-full w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 border border-gray-300 rounded px-3 py-2"
114
+
placeholder="A brief description of your project..."
116
+
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">
117
+
Optional. A short description to help others understand what your project does.
122
+
{{ define "defaultBranch" }}
123
+
<!-- Default Branch -->
125
+
<label for="branch" class="block text-sm font-bold uppercase dark:text-white mb-1">
134
+
class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 border border-gray-300 rounded px-3 py-2"
136
+
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">
137
+
The primary branch where development happens. Common choices are "main" or "master".
142
+
{{ define "knot" }}
143
+
<!-- Knot Selection -->
145
+
<label class="block text-sm font-bold uppercase dark:text-white mb-1">
148
+
<div class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 border border-gray-300 rounded p-3 space-y-2">
150
+
<div class="flex items-center">
156
+
id="domain-{{ . }}"
159
+
<label for="domain-{{ . }}" class="dark:text-white lowercase">{{ . }}</label>
162
+
<p class="dark:text-white">no knots available.</p>
165
+
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1">
166
+
A knot hosts repository data and handles Git operations.
167
+
You can also <a href="/knots" class="underline">register your own knot</a>.
172
+
{{ define "numberCircle" }}
173
+
<div class="w-6 h-6 bg-gray-200 dark:bg-gray-600 rounded-full flex items-center justify-center text-sm font-medium mt-1">