summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-06-30 18:46:27 +0300
committermakkalot <makkalot@gmail.com>2008-06-30 18:46:27 +0300
commit2dddee52d4bb4d06a4853fd33db13f6635ae1beb (patch)
tree29c15c9ad89ff1b5615152b6c77469ee0a2dfda5
parent400d846d102e5a7af6059691851337d685174c20 (diff)
downloadfunc-2dddee52d4bb4d06a4853fd33db13f6635ae1beb.tar.gz
func-2dddee52d4bb4d06a4853fd33db13f6635ae1beb.tar.xz
func-2dddee52d4bb4d06a4853fd33db13f6635ae1beb.zip
template for repeating field,it is a simplle table may change it to divs later ...
-rw-r--r--funcweb/funcweb/templates/repeater_form.kid30
1 files changed, 30 insertions, 0 deletions
diff --git a/funcweb/funcweb/templates/repeater_form.kid b/funcweb/funcweb/templates/repeater_form.kid
new file mode 100644
index 0000000..606b30a
--- /dev/null
+++ b/funcweb/funcweb/templates/repeater_form.kid
@@ -0,0 +1,30 @@
+<div class="expanding_form" xmlns:py="http://purl.org/kid/ns#">
+<table id="${field_id}">
+<thead><tr>
+ <th py:for="field in fields">
+ <span class="fieldlabel" py:content="field.label" />
+ </th>
+ </tr></thead>
+ <tbody>
+ <tr py:for="repetition in repetitions"
+ class="${field_class}"
+ id="${field_id}_${repetition}">
+
+ <td py:for="field in fields">
+ <span py:content="field.display(value_for(field),
+ **params_for(field))" />
+ <span py:if="error_for(field)" class="fielderror"
+ py:content="error_for(field)" />
+ <span py:if="field.help_text" class="fieldhelp"
+ py:content="field_help_text" />
+ </td>
+ <td>
+ <a
+ href="javascript:ExpandingForm.removeItem('${field_id}_${repetition}')">Remove (-)</a>
+ </td>
+
+ </tr>
+ </tbody>
+</table>
+<a id="doclink" href="javascript:ExpandingForm.addItem('${field_id}');">Add ( + )</a>
+</div>