Skip to content

Commit 4200f07

Browse files
author
Tobias Herp
committed
macro th_label:
- usage of th_label in user.item.html (for a start) - macro search_select_translated (for status and priority) - Javascript support for adding uses (just past the email address and leave the input field)
1 parent e3c97d0 commit 4200f07

File tree

6 files changed

+411
-92
lines changed

6 files changed

+411
-92
lines changed

templates/classic/html/help_controls.js

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ function determineList() {
4444
return list;
4545
}
4646

47+
/**
48+
* update the field in the opening window;
49+
* the text_field variable must be set in the calling page
50+
*/
51+
function updateOpener() {
52+
// write back to opener window
53+
if (document.frm_help.check==undefined) { return; }
54+
form[field].value = text_field.value;
55+
}
56+
4757
function updateList() {
4858
// write back to opener window
4959
if (document.frm_help.check==undefined) { return; }
@@ -64,6 +74,40 @@ function clearList() {
6474
}
6575
}
6676

77+
function reviseList_framed(form, textfield) {
78+
// update the checkboxes based on the preview field
79+
// alert('reviseList_framed')
80+
// alert(form)
81+
if (form.check==undefined)
82+
return;
83+
// alert(textfield)
84+
var to_check;
85+
var list = textfield.value.split(",");
86+
if (form.check.length==undefined) {
87+
check = form.check;
88+
to_check = false;
89+
for (val in list) {
90+
if (check.value==trim(list[val])) {
91+
to_check = true;
92+
break;
93+
}
94+
}
95+
check.checked = to_check;
96+
} else {
97+
for (box=0; box < form.check.length; box++) {
98+
check = form.check[box];
99+
to_check = false;
100+
for (val in list) {
101+
if (check.value==trim(list[val])) {
102+
to_check = true;
103+
break;
104+
}
105+
}
106+
check.checked = to_check;
107+
}
108+
}
109+
}
110+
67111
function reviseList(vals) {
68112
// update the checkboxes based on the preview field
69113
if (document.frm_help.check==undefined) { return; }
@@ -121,3 +165,41 @@ function selectField(name) {
121165
}
122166
}
123167

168+
function checkRequiredFields(fields)
169+
{
170+
var bonk='';
171+
var res='';
172+
var argv = checkRequiredFields.arguments;
173+
var argc = argv.length;
174+
var input = '';
175+
var val='';
176+
177+
for (var i=0; i < argc; i++) {
178+
fi = argv[i];
179+
input = document.getElementById(fi);
180+
if (input) {
181+
val = input.value
182+
if (val == '' || val == '-1' || val == -1) {
183+
if (res == '') {
184+
res = fi;
185+
bonk = input;
186+
} else {
187+
res += ', '+fi;
188+
}
189+
}
190+
} else {
191+
alert('Field with id='+fi+' not found!')
192+
}
193+
}
194+
if (res == '') {
195+
return submit_once();
196+
} else {
197+
alert('Missing value here ('+res+')!');
198+
if (window.event && window.event.returnvalue) {
199+
event.returnValue = 0; // work-around for IE
200+
}
201+
bonk.focus();
202+
return false;
203+
}
204+
}
205+

templates/classic/html/issue.index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- dollarId: issue.index,v 1.2 2001/07/29 04:07:37 richard Exp dollar-->
1+
<!-- $Id: issue.index.html,v 1.24 2006-09-17 23:27:21 tobias-herp Exp $ -->
22
<tal:block metal:use-macro="templates/page/macros/icing">
33
<title metal:fill-slot="head_title" >
44
<span tal:omit-tag="true" i18n:translate="" >List of issues</span>
@@ -30,7 +30,7 @@
3030
<th tal:condition="request/show/creator" i18n:translate="">Creator</th>
3131
<th tal:condition="request/show/assignedto" i18n:translate="">Assigned&nbsp;To</th>
3232
</tr>
33-
<tal:block tal:repeat="i batch">
33+
<tal:block tal:repeat="i batch" condition=true>
3434
<tr tal:define="group python:[r[1] for r in request.group]"
3535
tal:condition="python:group and batch.propchanged(*group)">
3636
<th tal:attributes="colspan python:len(request.columns)" class="group">
@@ -156,4 +156,5 @@
156156
</tal:block>
157157

158158
</td>
159-
</tal:block>
159+
</tal:block><tal:comment condition=false> vim: sw=1 ts=8 et si
160+
</tal:comment>

templates/classic/html/issue.search.html

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,23 @@
77

88
<form method="GET" name="itemSynopsis"
99
tal:attributes="action request/classname">
10-
10+
1111
<table class="form" tal:define="
1212
cols python:request.columns or 'id activity title status assignedto'.split();
13-
sort_on python:request.sort[1] or 'activity';
14-
group_on python:request.group[1] or 'priority';
13+
sort_on python:request.sort and request.sort[0] or nothing;
14+
sort_desc python:sort_on and sort_on[0] == '-';
15+
sort_on python:(sort_on and sort_on[1]) or 'activity';
16+
group_on python:request.group and request.group[0] or nothing;
17+
group_desc python:group_on and group_on[0] == '-';
18+
group_on python:(group_on and group_on[1]) or 'priority';
1519
1620
search_input templates/page/macros/search_input;
1721
search_date templates/page/macros/search_date;
1822
column_input templates/page/macros/column_input;
1923
sort_input templates/page/macros/sort_input;
2024
group_input templates/page/macros/group_input;
2125
search_select templates/page/macros/search_select;
26+
search_select_translated templates/page/macros/search_select_translated;
2227
search_multiselect templates/page/macros/search_multiselect;">
2328

2429
<tr>
@@ -111,7 +116,7 @@
111116
db_klass string:priority;
112117
db_content string:name;">
113118
<th i18n:translate="">Priority:</th>
114-
<td metal:use-macro="search_select">
119+
<td metal:use-macro="search_select_translated">
115120
<option metal:fill-slot="extra_options" value="-1" i18n:translate=""
116121
tal:attributes="selected python:value == '-1'">not selected</option>
117122
</td>
@@ -124,7 +129,7 @@
124129
db_klass string:status;
125130
db_content string:name;">
126131
<th i18n:translate="">Status:</th>
127-
<td metal:use-macro="search_select">
132+
<td metal:use-macro="search_select_translated">
128133
<tal:block metal:fill-slot="extra_options">
129134
<option value="-1,1,2,3,4,5,6,7" i18n:translate=""
130135
tal:attributes="selected python:value == '-1,1,2,3,4,5,6,7'">not resolved</option>
@@ -178,14 +183,14 @@
178183
<tr>
179184
<th i18n:translate="">Sort Descending:</th>
180185
<td><input type="checkbox" name="@sortdir"
181-
tal:attributes="checked python:request.sort[0] == '-' or request.sort[0] is None">
186+
tal:attributes="checked sort_desc">
182187
</td>
183188
</tr>
184189

185190
<tr>
186191
<th i18n:translate="">Group Descending:</th>
187192
<td><input type="checkbox" name="@groupdir"
188-
tal:attributes="checked python:request.group[0] == '-'">
193+
tal:attributes="checked group_desc">
189194
</td>
190195
</tr>
191196

0 commit comments

Comments
 (0)