From 158b69051b69b99e856ee3e44f5a76bb3fdc4794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Mon, 29 Oct 2018 23:45:47 -0400 Subject: [PATCH] Brief experiment with UI patterns which would be great if could pass in label value --- .../patterns/detail/detail.ui_patterns.yml | 19 +++++++++++++++++++ .../patterns/detail/pattern-detail.html.twig | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 agaric/templates/patterns/detail/detail.ui_patterns.yml create mode 100644 agaric/templates/patterns/detail/pattern-detail.html.twig diff --git a/agaric/templates/patterns/detail/detail.ui_patterns.yml b/agaric/templates/patterns/detail/detail.ui_patterns.yml new file mode 100644 index 0000000..bdf6269 --- /dev/null +++ b/agaric/templates/patterns/detail/detail.ui_patterns.yml @@ -0,0 +1,19 @@ +detail: + label: Detail + description: Show a single detail field. + variants: + default: + label: Default + fields: + label: + type: text + label: Label + description: The field label. + preview: Project name + value: + type: text + label: Value + description: The field contents, or value. + preview: The Agaric Initiatives + libraries: + - octavia/global diff --git a/agaric/templates/patterns/detail/pattern-detail.html.twig b/agaric/templates/patterns/detail/pattern-detail.html.twig new file mode 100644 index 0000000..14a0937 --- /dev/null +++ b/agaric/templates/patterns/detail/pattern-detail.html.twig @@ -0,0 +1,8 @@ +{{ label }} +

+ {{ label }} + {% for item in items %} + {{ item.content }} + {% endfor %} +

+{{ value }}