From 2f73690ec5b9bf88d0932c2f90bffa6ef9924e04 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Wed, 5 Apr 2023 11:18:49 +0200 Subject: [PATCH] components, fields: use explicit parameters (no more '... merge ... jsonify') --- layouts/shortcodes/pv/button.html | 6 +++--- layouts/shortcodes/pv/data-field-line.html | 8 +++++--- layouts/shortcodes/pv/data.html | 7 ++++--- layouts/shortcodes/pv/list-column.html | 6 ++++-- layouts/shortcodes/pv/list.html | 7 ++++--- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/layouts/shortcodes/pv/button.html b/layouts/shortcodes/pv/button.html index a0e1eb4..ea0aeff 100644 --- a/layouts/shortcodes/pv/button.html +++ b/layouts/shortcodes/pv/button.html @@ -4,7 +4,7 @@ {{- $exec := .Get "exec" | default "exec" -}} {{- $action := .Get "action" | default "" -}} {{- $mode := .Get "mode" -}} - +{{- $params := dict "type" $type "name" $name "label" $label + "exec" $exec "action" $action "mode" $mode -}} +{{ partial "button" $params }} diff --git a/layouts/shortcodes/pv/data-field-line.html b/layouts/shortcodes/pv/data-field-line.html index 0ec0a86..7f481c5 100644 --- a/layouts/shortcodes/pv/data-field-line.html +++ b/layouts/shortcodes/pv/data-field-line.html @@ -1,11 +1,13 @@ {{- $type := .Get "type" | default "text" -}} {{- $name := .Get "name" | default "textline" -}} -{{- $meta := merge $.Params (dict "name" $name "type" $type) | jsonify -}}
diff --git a/layouts/shortcodes/pv/data.html b/layouts/shortcodes/pv/data.html index 20bdac3..bb86345 100644 --- a/layouts/shortcodes/pv/data.html +++ b/layouts/shortcodes/pv/data.html @@ -2,9 +2,10 @@ {{- $action := .Get "action" | default "data" -}} {{- $domain := .Get "domain" | default $.Page.Params.api.domain -}} {{- $comp := .Get "component" | default "Data" -}} -{{- $conf := merge $.Params (dict "domain" $domain "action" $action) - | jsonify -}} -
{{ .Inner }}
diff --git a/layouts/shortcodes/pv/list-column.html b/layouts/shortcodes/pv/list-column.html index 6c56179..2ee5b23 100644 --- a/layouts/shortcodes/pv/list-column.html +++ b/layouts/shortcodes/pv/list-column.html @@ -1,4 +1,6 @@ {{- $name := .Get "name" | default "column" -}} {{- $label := .Get "label" | default "Column" -}} -{{- $meta := $.Params | jsonify -}} -{{ $label }} +{{ $label }} + diff --git a/layouts/shortcodes/pv/list.html b/layouts/shortcodes/pv/list.html index 0b1d43d..5eda49e 100644 --- a/layouts/shortcodes/pv/list.html +++ b/layouts/shortcodes/pv/list.html @@ -2,10 +2,11 @@ {{- $action := .Get "action" | default "query" -}} {{- $domain := .Get "domain" | default $.Page.Params.api.domain -}} {{- $comp := .Get "component" | default "List" -}} -{{- $conf := merge $.Params (dict "domain" $domain "action" $action) - | jsonify -}} {{- .Inner -}}