summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 860fe74)
raw | patch | inline | side by side (parent: 860fe74)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 27 Mar 2003 01:36:19 +0000 (01:36 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 27 Mar 2003 01:36:19 +0000 (01:36 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1641 57a73879-2fb5-44c3-a270-3262357dd7e2
diff --git a/CHANGES.txt b/CHANGES.txt
index bc05c6815bda5fa1fe86c4b40718d57674dda7e8..5425e843034e8b14eb74e2d940f62ef99d345bb9 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- Class.find() may now find unset Links (sf bug 700620)
- more flexibility in classhelp link labelling (sf feature 608204)
- added command-line functionality for roundup-adming (sf feature 687664)
+- added nicer popup windows for topic, nosy, etc (has add/remove buttons)
+ thanks Gus Gollings
Fixed:
diff --git a/doc/index.txt b/doc/index.txt
index dd30c86a1d7eea52cebc1d68659b5a12b9a84758..1ad2b988e7f6085ddb8be6a33ad65ec01f43dea1 100644 (file)
--- a/doc/index.txt
+++ b/doc/index.txt
Roch'e Compaan,
Hernan Martinez Foffani,
Ajit George,
+Gus Gollings,
Dan Grassi,
Engelbert Gruber,
Juergen Hermann,
diff --git a/roundup/templates/classic/html/_generic.help b/roundup/templates/classic/html/_generic.help
index 9cb15354aff5c8f6dfb189eb70a7416ff9b31b28..0749525bbe8a1d9a75c7e026c5383626c498189c 100644 (file)
<head>
<link rel="stylesheet" type="text/css" href="_file/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8;">
+<script language="JavaScript"
+ tal:condition="python:request.form.has_key('property')"
+ tal:content="structure string:
+
+// this is the name of the field in the original form that we're working on
+field = '${request/form/property/value}';
+
+function listClose() {
+ window.close();
+}
+
+function listClear() {
+ window.opener.document.itemSynopsis[field].value = '';
+}
+
+function pick(opt) {
+ if (window.opener && !window.opener.closed) {
+ window.opener.document.itemSynopsis[field].value = opt;
+ }
+}
+
+// add a value to the form field
+function add(opt) {
+ val = window.opener.document.itemSynopsis[field].value;
+ if (/^\s*$$/.test(val)) {
+ newval = opt; // existing is all whitespace, so just replace
+ } else {
+ newval = val + ', ' + opt;
+ }
+ pick(newval);
+}
+
+// remove a value from the form field
+function remove(opt) {
+ // ((opt(,\s*)?)|(,\s*opt))
+ replaceStr = new String('(('+opt+'(,\\s*)?)|(,\\s*'+opt+'))');
+ re = new RegExp(replaceStr);
+
+ str = window.opener.document.itemSynopsis[field].value;
+
+ // replace occurences with empty string
+ newstr = str.replace(re, '');
+ pick(newstr);
+}
+">
+</script>
</head>
+
<body class="body" marginwidth="0" marginheight="0">
+<form>
+<div style="padding:10px;text-align:center;">
+ <script language="javascript">
+ // put up a 'reset' button if the field has values when we pop up this window
+
+ // this is the name of the field in the original form that we're working on
+ orig = window.opener.document.itemSynopsis[field].value;
+ if (/[^\s]/.test(orig)) {
+ reset = '<input type="button" onclick="pick(orig);" ' +
+ 'value="Reset to original values" /> | ';
+ document.write(reset);
+ }
+ </script>
+ <input type="button"
+ tal:attributes="value string:Clear all ${request/form/property/value} values"
+ onclick="listClear();" /> |
+ <input type="button" onclick="listClose();" value="Close this window" />
+</div>
<table class="classhelp"
tal:define="props python:request.form['properties'].value.split(',')">
-<tr><th tal:repeat="prop props" tal:content="prop"></th></tr>
+<tr>
+ <th tal:condition="python:request.form.has_key('property')">add/remove</th>
+ <th tal:repeat="prop props" tal:content="prop"></th>
+</tr>
<tr tal:repeat="item context/list">
+ <td tal:condition="python:request.form.has_key('property')">
+ <input type="button" tal:define="opt python: item[props[0]]"
+ tal:attributes="onclick string:add('${opt}')" value=" + ">
+ <input type="button" tal:define="opt python: item[props[0]]"
+ tal:attributes="onclick string:remove('${opt}')" value=" - " />
+ </td>
<td tal:repeat="prop props" tal:content="structure python:item[prop]"></td>
</tr>
</table>
-
+</form>
</body>
+</html>
index 18bb6231c7d0ac2c9448560554ce7a30be9175f5..8db909bff82633cc2b8fca432ffeba1d70a9d8bd 100644 (file)
You are not allowed to view this page.
</span>
-<form method="POST" onSubmit="return submit_once()"
+<form method="POST" name="itemSynopsis" onSubmit="return submit_once()"
enctype="multipart/form-data" tal:condition="context/is_edit_ok">
<input type="hidden" name=":template" value="item">
<th nowrap>Superseder</th>
<td>
<span tal:replace="structure python:context.superseder.field(showid=1, size=20)" />
- <span tal:replace="structure python:db.issue.classhelp('id,title')" />
+ <span tal:replace="structure python:db.issue.classhelp('id,title', property='superseder')" />
<span tal:condition="context/superseder" tal:repeat="sup context/superseder">
<br>View: <a tal:attributes="href string:issue${sup/id}"
tal:content="sup/id"></a>
<td>
<span tal:replace="structure context/nosy/field" />
<span tal:replace="structure
-python:db.user.classhelp('username,realname,address,phone')" /><br>
+python:db.user.classhelp('username,realname,address', property='nosy', width='600')" /><br>
</td>
</tr>
<th nowrap>Topics</th>
<td>
<span tal:replace="structure context/topic/field" />
- <span tal:replace="structure db/keyword/classhelp" />
+ <span tal:replace="structure python:db.keyword.classhelp(property='topic')" />
</td>
</tr>
diff --git a/roundup/templates/classic/html/keyword.item b/roundup/templates/classic/html/keyword.item
index 04d0878aa5850f8a768aa1b141953017547dae57..4572370865abc26e78c4e705625818573d07ae53 100644 (file)
enctype="multipart/form-data">
<input type="hidden" name=":required" value="name">
+ <input type="hidden" name=":template" value="item">
<table class="form">
<tr>