feat: update auto render
This commit is contained in:
3
web/templates/builtin/field/category.html
Normal file
3
web/templates/builtin/field/category.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{define "field-category"}}
|
||||
<span class="text-gray-900">{{.Value}}</span>
|
||||
{{end}}
|
||||
9
web/templates/builtin/field/markdown.html
Normal file
9
web/templates/builtin/field/markdown.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{define "field-markdown"}}
|
||||
{{if .Value}}
|
||||
<div class="prose prose-sm max-w-none">
|
||||
{{.Value}}
|
||||
</div>
|
||||
{{else}}
|
||||
<span class="text-gray-400">-</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
3
web/templates/builtin/field/raw.html
Normal file
3
web/templates/builtin/field/raw.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{define "field-raw"}}
|
||||
<span class="text-gray-900">{{.Value}}</span>
|
||||
{{end}}
|
||||
14
web/templates/builtin/field/tag.html
Normal file
14
web/templates/builtin/field/tag.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{{define "field-tag"}}
|
||||
{{if .Value}}
|
||||
{{$tag := index .Column.values .Value}}
|
||||
{{if $tag}}
|
||||
<span class="px-2 py-1 text-xs font-medium rounded-full" style="background-color: {{$tag.color}}; color: white;">
|
||||
{{$tag.label}}
|
||||
</span>
|
||||
{{else}}
|
||||
<span class="text-gray-900">{{.Value}}</span>
|
||||
{{end}}
|
||||
{{else}}
|
||||
<span class="text-gray-400">-</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
17
web/templates/builtin/field/text.html
Normal file
17
web/templates/builtin/field/text.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{define "field-text"}}
|
||||
<span class="text-gray-900">{{.Value}}</span>
|
||||
{{end}}
|
||||
|
||||
{{define "field"}}
|
||||
{{if eq .Type "time"}}
|
||||
{{template "field-time" .}}
|
||||
{{else if eq .Type "tag"}}
|
||||
{{template "field-tag" .}}
|
||||
{{else if eq .Type "markdown"}}
|
||||
{{template "field-markdown" .}}
|
||||
{{else if eq .Type "raw"}}
|
||||
{{template "field-raw" .}}
|
||||
{{else}}
|
||||
{{template "field-text" .}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
9
web/templates/builtin/field/time.html
Normal file
9
web/templates/builtin/field/time.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{define "field-time"}}
|
||||
<span class="text-gray-900">
|
||||
{{if .Value}}
|
||||
{{.Value}}
|
||||
{{else}}
|
||||
-
|
||||
{{end}}
|
||||
</span>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user