diff default/input/comment.html @ 10:8b5615a1bf3d

articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
author Goffi <goffi@goffi.org>
date Thu, 27 Apr 2017 01:07:28 +0200
parents default/input/comments.html@f1c773126f23
children 8cdcbe0d7dee
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/default/input/comment.html	Thu Apr 27 01:07:28 2017 +0200
@@ -0,0 +1,24 @@
+{% import 'input/form.html' as form %}
+
+{% macro head(service, node) %}
+    {# include data needed to identify the node to use for commenting #}
+    <input type="hidden" name="type" value="comment">
+    <input type="hidden" name="service" value="{{service}}">
+    <input type="hidden" name="node" value="{{node}}">
+{% endmacro %}
+
+{% macro body(rows=10, cols=50) %}
+    <textarea name="body" rows="{{rows}}" cols="{{cols}}"></textarea>
+{% endmacro %}
+
+{% macro submit() %}
+    <input type="submit" value="Send">
+{% endmacro %}
+
+{% macro comment(service, node, action='') %}
+{% call form.form(action=action) %}
+    {{ head(service, node) }}
+    {{ body() }}
+    {{ submit() }}
+{% endcall %}
+{% endmacro %}