1.1 --- a/examples/Common/PEP241/Resources/pep241_template.xhtml Fri Oct 14 13:58:12 2005 +0000
1.2 +++ b/examples/Common/PEP241/Resources/pep241_template.xhtml Fri Oct 14 15:01:44 2005 +0000
1.3 @@ -12,12 +12,12 @@
1.4 <script type="text/javascript" src="scripts/XSLForms.js"> </script>
1.5 </head>
1.6
1.7 -<body>
1.8 +<body template:element="package">
1.9 <h1>PEP 241 Package Registry</h1>
1.10
1.11 <form method="POST">
1.12
1.13 - <table cellspacing="0" cellpadding="5" template:element="package">
1.14 + <table cellspacing="0" cellpadding="5">
1.15 <tbody>
1.16 <tr>
1.17 <th class="heading" colspan="2">Summary</th>
1.18 @@ -155,41 +155,57 @@
1.19 <th colspan="2" class="heading">Authors</th>
1.20 </tr>
1.21 </tbody>
1.22 - <tbody template:element="authors,author">
1.23 - <tr>
1.24 - <th>Author name</th>
1.25 - <td><input template:attribute-field="name" name="..." value="..." type="text" size="20" />
1.26 - <input type="submit" value="Remove!" name="..." template:selector-field="remove_author" /></td>
1.27 - </tr>
1.28 - <tr>
1.29 - <th>Author contact</th>
1.30 - <td><input template:attribute-field="contact" name="..." value="..." type="text" size="20" /></td>
1.31 - </tr>
1.32 - <tr>
1.33 - <th>Author e-mail</th>
1.34 - <td><input template:attribute-field="e-mail" name="..." value="..." type="text" size="20" /></td>
1.35 - </tr>
1.36 - </tbody>
1.37 - <tbody>
1.38 + <tbody cellspacing="0" cellpadding="5" template:id="authors-node" id="authors-target">
1.39 + <div template:effect="replace" template:element="authors,author">
1.40 + <tr>
1.41 + <th>Author name</th>
1.42 + <td><input template:attribute-field="name" name="..." value="..." type="text" size="20" />
1.43 + <input type="submit" value="Remove!" name="..." template:selector-field="remove_author" onclick="
1.44 + return requestUpdate(
1.45 + 'authors',
1.46 + '{template:other-attributes('name', ../author)},{template:other-attributes('contact', ../author)},{template:other-attributes('e-mail', ../author)},{template:selector-name('remove_author', .)}',
1.47 + 'authors-target',
1.48 + '{template:other-attributes('name', ../author)},{template:other-attributes('contact', ../author)},{template:other-attributes('e-mail', ../author)},',
1.49 + '/package')
1.50 + "/></td>
1.51 + </tr>
1.52 + <tr>
1.53 + <th>Author contact</th>
1.54 + <td><input template:attribute-field="contact" name="..." value="..." type="text" size="20" /></td>
1.55 + </tr>
1.56 + <tr>
1.57 + <th>Author e-mail</th>
1.58 + <td><input template:attribute-field="e-mail" name="..." value="..." type="text" size="20" /></td>
1.59 + </tr>
1.60 + </div>
1.61 <tr>
1.62 <th></th>
1.63 <td>
1.64 - <input type="submit" value="Add author!" name="..." template:selector-field="add_author,author" /></td>
1.65 + <input type="submit" value="Add author!" name="..." template:selector-field="add_author,author" onclick="
1.66 +return requestUpdate(
1.67 + 'authors',
1.68 + '{template:other-attributes('name', .)},{template:other-attributes('name', authors/author)},{template:other-attributes('contact', authors/author)},{template:other-attributes('e-mail', authors/author)},{template:selector-name('add_author', .)}',
1.69 + 'authors-target',
1.70 + '{template:other-attributes('name', authors/author)},{template:other-attributes('contact', authors/author)},{template:other-attributes('e-mail', authors/author)}',
1.71 + '/package')
1.72 +"/></td>
1.73 </tr>
1.74 <tr>
1.75 <th colspan="2" class="heading">Dependencies</th>
1.76 </tr>
1.77 </tbody>
1.78 - <tbody template:element="dependencies,dependency">
1.79 - <tr>
1.80 - <th>Package name</th>
1.81 - <td><input template:attribute-field="name" name="..." value="..." type="text" size="20" />
1.82 - <input type="submit" value="Remove!" name="..." template:selector-field="remove_dependency" /></td>
1.83 - </tr>
1.84 - <tr>
1.85 - <th>Package version</th>
1.86 - <td><input template:attribute-field="version" name="..." value="..." type="text" size="10" /></td>
1.87 - </tr>
1.88 + <tbody cellspacing="0" cellpadding="5" template:id="dependencies-node" id="dependencies-target">
1.89 + <div template:effect="replace" template:element="dependencies,dependency">
1.90 + <tr>
1.91 + <th>Package name</th>
1.92 + <td><input template:attribute-field="name" name="..." value="..." type="text" size="20" />
1.93 + <input type="submit" value="Remove!" name="..." template:selector-field="remove_dependency" /></td>
1.94 + </tr>
1.95 + <tr>
1.96 + <th>Package version</th>
1.97 + <td><input template:attribute-field="version" name="..." value="..." type="text" size="10" /></td>
1.98 + </tr>
1.99 + </div>
1.100 </tbody>
1.101 <tbody>
1.102 <tr>
2.1 --- a/examples/Common/PEP241/__init__.py Fri Oct 14 13:58:12 2005 +0000
2.2 +++ b/examples/Common/PEP241/__init__.py Fri Oct 14 15:01:44 2005 +0000
2.3 @@ -32,7 +32,8 @@
2.4 in_page_resources = {
2.5 "platforms" : ("pep241_output_platforms.xsl", "platforms-node"),
2.6 "supported-platforms" : ("pep241_output_supported_platforms.xsl", "supported-platforms-node"),
2.7 - "keywords" : ("pep241_output_keywords.xsl", "keywords-node")
2.8 + "keywords" : ("pep241_output_keywords.xsl", "keywords-node"),
2.9 + "authors" : ("pep241_output_authors.xsl", "authors-node")
2.10 }
2.11
2.12 def respond_to_form(self, trans, form):
2.13 @@ -128,6 +129,7 @@
2.14 "platforms" : pep241_resource,
2.15 "supported-platforms" : pep241_resource,
2.16 "keywords" : pep241_resource,
2.17 + "authors" : pep241_resource,
2.18 # Main page:
2.19 "" : pep241_resource
2.20 })