Initial Commit

This commit is contained in:
2025-03-24 08:50:01 +01:00
commit 30611aa45d
26 changed files with 1477 additions and 0 deletions

38
cmd/ui/html/main.html Normal file
View File

@@ -0,0 +1,38 @@
{{block "main" .}}
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/ui/css/styles.css" />
<script src="https://unpkg.com/htmx.org@2.0.4"></script>
<title>SAP CDS-View Search</title>
</head>
<body>
{{template "search-bar" .}}
<div id="search-results" class="container-center">
{{template "search-placeholder-info" . }}
</div>
</body>
</html>
{{end}} {{block "search-bar" .}}
<form class="container-center linked-horizontal" style="margin-bottom: 30px">
<input
class="round min-w4 max-w21"
style="flex-grow: 1"
placeholder="Search here"
id="search-bar"
name="q"
/>
<button
type="submit"
class="round raised suggested-action max-w3"
style="flex-grow: 1"
hx-get="/search"
hx-params="*"
hx-include="#search-bar"
hx-target="#search-results"
hx-swap="innerHTML"
>
Search
</button>
</form>
{{end}}

View File

@@ -0,0 +1,126 @@
{{block "results" .}}
<div>
{{template "paging" .}}
<div class="boxed-list max-w24">
{{range .Views}} {{template "result" .}} {{end}}
</div>
</div>
{{end}} {{block "result" .}}
<label class="active expander" for="{{.TechnicalName}}">
<input class="expander-state" type="checkbox" id="{{.TechnicalName}}" />
<div class="title sans-serif">
{{.DisplayName}}
<div class="monospaced">{{.TechnicalName}}</div>
</div>
<div
class='tag pill suffix {{if eq .State "RELEASED"}} success {{else}} warning {{end}} min-w3'
>
{{.StateTitle}}
</div>
</label>
<div class="expander-content">
<div class="label heading">Field Properties</div>
<div class="container-center">{{template "fields" .Fields}}</div>
</div>
{{end}} {{block "fields" .}}
<table>
<tr>
<th class="table-field-left">Name</th>
<th class="table-field-left">Description</th>
<th class="table-field-left">Type</th>
<th class="table-field-right">Length</th>
</tr>
{{range .}} {{template "field" .}} {{end}}
</table>
{{end}} {{block "field" .}}
<tr>
<td class="table-field-left monospaced">{{.FieldName}}</td>
<td class="table-field-left">{{.DescriptionOut}}</td>
<td class="table-field-left">{{.DataTypeTitle}}</td>
<td class="table-field-right monospaced">{{.FieldLengthOut}}</td>
</tr>
{{end}} {{block "search-placeholder-no-result" .}}
<div>
<div class="container-center">
<div class="placeholder-image loupe"></div>
</div>
<div class="container-center">
<div class="label title-1">No Results Found</div>
</div>
<div class="container-center">
<div class="label">Try refining your search term</div>
</div>
</div>
{{end}} {{block "search-placeholder-info" .}}
<div>
<div class="container-center">
<div class="placeholder-image loupe"></div>
</div>
<div class="container-center">
<div class="label title-1">Search CDS-Views</div>
</div>
<div class="container-center">
<div class="label">Find CDS-Views from the Business Acceleator Hub</div>
</div>
</div>
{{end}} {{block "paging" .}}
<div>
<form style="float: right">
<input name="q" disabled hidden value="{{.SearchTerm}}" />
<div class="linked-horizontal">
<!--button
type="submit"
class="raised round"
style="margin-top: 9px"
hx-get="/search"
hx-params="*"
hx-include="#search-bar"
hx-target="#search-results"
hx-swap="innerHTML"
{{if
eq
.CurrentPage
0}}
disabled
{{end}}
>
←</button
--><input
class="round max-w2"
type="number"
name="p"
value="{{.CurrentPage}}"
min="0"
max="{{.MaxPage}}"
hx-get="/search"
hx-params="*"
hx-include="#search-bar"
hx-target="#search-results"
hx-swap="innerHTML"
/><input
class="round raised max-w2"
value="{{.MaxPage}}"
disabled
/><!--button
type="submit"
class="raised round"
style="margin-top: 9px"
hx-get="/search"
hx-params="*"
hx-include="#search-bar"
hx-target="#search-results"
hx-swap="innerHTML"
{{if
eq
.CurrentPage
.MaxPage}}
disabled
{{end}}
>
</button-->
</div>
</form>
</div>
{{end}}