2024-01-15 22:26:51 +00:00
|
|
|
package html
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
type RepoHeaderComponentContext struct {
|
2024-05-25 02:31:35 +00:00
|
|
|
Name string
|
|
|
|
Ref string
|
|
|
|
Description string
|
|
|
|
CloneURL string
|
2024-07-16 17:33:41 +00:00
|
|
|
Tags []string
|
2024-01-15 22:26:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
templ repoHeaderComponent(rhcc RepoHeaderComponentContext) {
|
2024-01-16 03:11:52 +00:00
|
|
|
<div class="mb-1 text-text">
|
|
|
|
<a class="text-lg underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL("/" + rhcc.Name) }>{ rhcc.Name }</a>
|
|
|
|
if rhcc.Ref != "" {
|
|
|
|
{ " " }
|
2024-01-20 02:34:27 +00:00
|
|
|
<a class="text-text/80 text-sm underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(fmt.Sprintf("/%s/tree/%s/", rhcc.Name, rhcc.Ref)) }>{ "@" + rhcc.Ref }</a>
|
2024-01-16 03:11:52 +00:00
|
|
|
}
|
|
|
|
{ " - " }
|
2024-01-17 03:37:25 +00:00
|
|
|
<a class="underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(fmt.Sprintf("/%s/refs", rhcc.Name)) }>refs</a>
|
2024-01-16 03:11:52 +00:00
|
|
|
{ " - " }
|
2024-01-17 03:37:25 +00:00
|
|
|
<a class="underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(fmt.Sprintf("/%s/log/%s", rhcc.Name, rhcc.Ref)) }>log</a>
|
2024-01-20 02:34:27 +00:00
|
|
|
{ " - " }
|
2024-05-25 02:31:35 +00:00
|
|
|
<form class="inline-block" action={ templ.SafeURL(fmt.Sprintf("/%s/search", rhcc.Name)) } method="get"><input class="rounded p-1 bg-mantle focus:border-lavender focus:outline-none focus:ring-0" id="search" type="text" name="q" placeholder="search"/></form>
|
2024-03-01 17:58:05 +00:00
|
|
|
{ " - " }
|
2024-01-20 02:34:27 +00:00
|
|
|
<pre class="text-text inline select-all bg-base dark:bg-base/50 p-1 rounded">{ fmt.Sprintf("%s/%s.git", rhcc.CloneURL, rhcc.Name) }</pre>
|
2024-01-16 03:11:52 +00:00
|
|
|
</div>
|
2024-07-16 17:33:41 +00:00
|
|
|
<div class="text-subtext0 mb-1">
|
|
|
|
for _, tag := range rhcc.Tags {
|
|
|
|
<span class="rounded border-rosewater border-solid border pb-0.5 px-1 mr-1 mb-1 inline-block">{ tag }</span>
|
|
|
|
}
|
|
|
|
</div>
|
2024-01-15 22:26:51 +00:00
|
|
|
<div class="text-text/80 mb-1">{ rhcc.Description }</div>
|
|
|
|
}
|