move 'button' partial to pv subdirectory

This commit is contained in:
Helmut Merz 2023-04-09 11:30:31 +02:00
parent 2f73690ec5
commit 3addcf98ae
4 changed files with 13 additions and 13 deletions

View file

@ -5,7 +5,7 @@ img:
pageid: app_form_person pageid: app_form_person
domains: [App] domains: [App]
topics: [Examples] topics: [Examples]
date: 2023-03-27 date: 2023-04-09
draft: false draft: false
weight: 100 weight: 100
--- ---
@ -22,7 +22,6 @@ cyberscopes example site - view / edit person (user) data.
{{< pv/data-buttons include="view" >}} {{< pv/data-buttons include="view" >}}
<br>
{{< pv/data-display {{< pv/data-display
expr="`${data.firstname} ${data.lastname}`.trim() || '???'" >}} expr="`${data.firstname} ${data.lastname}`.trim() || '???'" >}}
{{< pv/data-display expr="state.id ? ` (Id: ${state.id})` : ''" >}} {{< pv/data-display expr="state.id ? ` (Id: ${state.id})` : ''" >}}

View file

@ -1,3 +1,3 @@
<button type="{{ .type }}" name="{{ .name }}" <button type="{{ .type }}" name="{{ .name }}"
{{- with .mode }}v-show="hasmode('{{ . }}')"{{ end -}} {{- with .mode }} v-show="hasmode('{{ . }}')" {{ end -}}
@click="{{ .exec }}('{{ .action }}')">{{.label}}</button> @click="{{ .exec }}('{{ .action }}')">{{.label}}</button>

View file

@ -7,4 +7,4 @@
{{- $params := dict "type" $type "name" $name "label" $label {{- $params := dict "type" $type "name" $name "label" $label
"exec" $exec "action" $action "mode" $mode -}} "exec" $exec "action" $action "mode" $mode -}}
{{ partial "button" $params }} {{ partial "pv/button" $params }}

View file

@ -1,26 +1,27 @@
{{- $defparams := dict "type" "button" "name" "submit" {{- $defparams := dict "type" "button" "name" "submit"
"exec" "exec" "action" "" "label" "Submit" -}} "exec" "exec" "action" "" "label" "Submit" -}}
{{- $params := merge $defparams ( <div>
{{ $params := merge $defparams (
dict "mode" "view" "exec" "chmode" "action" "edit" "label" "Edit") -}} dict "mode" "view" "exec" "chmode" "action" "edit" "label" "Edit") -}}
{{ partial "button" $params }} {{ partial "pv/button" $params }}
{{- $params = merge $params (dict "action" "new" "label" "New") -}} {{- $params = merge $params (dict "action" "new" "label" "New") -}}
{{ partial "button" $params }} {{ partial "pv/button" $params }}
{{- $params = merge $params ( {{- $params = merge $params (
dict "mode" "edit new" "action" "view" "label" "Cancel") -}} dict "mode" "edit new" "action" "view" "label" "Cancel") -}}
{{ partial "button" $params }} {{ partial "pv/button" $params }}
{{- $params = merge $defparams ( dict "mode" "edit" "label" "Save Changes") -}} {{- $params = merge $defparams ( dict "mode" "edit" "label" "Save Changes") -}}
{{ partial "button" $params }} {{ partial "pv/button" $params }}
{{- $params = merge $params (dict "exec" "copynew" "label" "Copy Data") -}} {{- $params = merge $params (dict "exec" "copynew" "label" "Copy Data") -}}
{{ partial "button" $params }} {{ partial "pv/button" $params }}
{{- $params = merge $params (dict "exec" "delete" "label" "Delete Item") -}} {{- $params = merge $params (dict "exec" "delete" "label" "Delete Item") -}}
{{ partial "button" $params }} {{ partial "pv/button" $params }}
{{- $params = merge $defparams ( dict "mode" "new" "label" "Create Item") -}} {{- $params = merge $defparams ( dict "mode" "new" "label" "Create Item") -}}
{{ partial "button" $params }} {{ partial "pv/button" $params }}
</div>