diff zpt/project/infoblock/edit_items.zpt @ 81:975a8d88e315

new editable info blocks for projects. removed RelatedDigitalSources. updateAllProjects converts to info block.
author casties
date Fri, 10 May 2013 17:32:53 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/project/infoblock/edit_items.zpt	Fri May 10 17:32:53 2013 +0200
@@ -0,0 +1,56 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html metal:use-macro="here/edit_template/macros/page">
+<head>
+</head>
+<body>
+  <tal:block metal:fill-slot="navsel" tal:define="global menusel string:infoblocks" />
+  <tal:block metal:fill-slot="body" tal:define="blockid here/getId; items here/getItems">
+    <h2>Edit info block</h2>
+    <form action="editItems" method="post">
+      <h3>
+        Title: <input size="20" name="block_title" tal:attributes="value here/getTitle" />
+      </h3>
+
+      <table>
+        <tal:block tal:repeat="idx python:range(len(items))">
+          <tr tal:define="item python:items[idx];">
+            <td><a tal:attributes="href string:$root/$blockid/moveItem?idx=$idx&op=up">up</a><br> <a
+                tal:attributes="href string:$root/$blockid/moveItem?idx=$idx&op=down">down</a></td>
+            <td tal:content="string:[${idx}]" />
+            <td>
+              <p>
+                <b>text:</b> <input tal:attributes="name string:text_$idx; value item/text" size="60" />
+              </p>
+              <p>
+                <b>link:</b> <input tal:attributes="name string:link_$idx; value item/link" size="20" /> (optional)
+              </p>
+            </td>
+            <td><a tal:attributes="href string:$root/$blockid/deleteItem?idx=$idx">Delete</a></td>
+          </tr>
+        </tal:block>
+      </table>
+      <p>
+        <input type="submit" value="Change" />
+      </p>
+    </form>
+
+    <h3>Add an item</h3>
+    <form tal:attributes="action string:$root/$blockid/addItem" method="post">
+      <p>
+        <b>text:</b> <input name="text" size="60" />
+      </p>
+      <p>
+        <b>link:</b> <input name="link" size="20" /> (optional)
+      </p>
+      <p>
+        <input type="submit" value="Add" />
+      </p>
+    </form>
+
+    <h3>
+      <a tal:attributes="href string:$root/manageInfoBlocks">Back to info block list</a>
+    </h3>
+  </tal:block>
+</body>
+</html>