Commit 2ac9cabf authored by myk%mozilla.org's avatar myk%mozilla.org

Fix for bug 249868: makes series pages validate

parent b087d683
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
'reports/series-common.html.tmpl' => [ 'reports/series-common.html.tmpl' => [
'sel.name', 'sel.name',
'sel.accesskey', 'sel.accesskey',
'"onchange=\'$sel.onchange\'" IF sel.onchange', '"onchange=\"$sel.onchange\"" IF sel.onchange',
], ],
'reports/chart.csv.tmpl' => [ 'reports/chart.csv.tmpl' => [
......
...@@ -71,9 +71,9 @@ function subcatSelected() { ...@@ -71,9 +71,9 @@ function subcatSelected() {
[% ELSE %] [% ELSE %]
<tr> <tr>
<th>Category:</th> <th>Category:</th>
<noscript><th></th></noscript> <th></th>
<th>Sub-category:</th> <th>Sub-category:</th>
<noscript><th></th></noscript> <th></th>
<th>Name:</th> <th>Name:</th>
<th><br> <th><br>
</th> </th>
...@@ -85,30 +85,34 @@ function subcatSelected() { ...@@ -85,30 +85,34 @@ function subcatSelected() {
onchange = "catSelected(); onchange = "catSelected();
subcatSelected();" } %] subcatSelected();" } %]
<noscript> <td>
<td> <noscript>
<input type="submit" name="action-assemble" value="Update --&gt;"> <input type="submit" name="action-assemble" value="Update --&gt;">
</td> </noscript>
</noscript> </td>
[% PROCESS series_select sel = { name => 'subcategory', [% PROCESS series_select sel = { name => 'subcategory',
size => 5, size => 5,
onchange = "subcatSelected()" } %] onchange = "subcatSelected()" } %]
<noscript> <td>
<td> <noscript>
<input type="submit" name="action-assemble" value="Update --%gt;"> <input type="submit" name="action-assemble" value="Update --&gt;">
</td> </noscript>
</noscript> </td>
<td align="left"> <td align="left">
<label for="name" accesskey="N"> <label for="name" accesskey="N">
<select name="name" id="name" style="width: 15em" <select name="name" id="name" style="width: 15em"
size="5" multiple="multiple" size="5" multiple="multiple"
[%+ "disabled=\"disabled\"" UNLESS name.keys.size %]>
[% FOREACH x = name.keys.sort %] [% FOREACH x = name.keys.sort %]
<option value="[% name.$x FILTER html %]"> <option value="[% name.$x FILTER html %]">
[% x FILTER html %]</option> [% x FILTER html %]</option>
[% END %] [% END %]
[% UNLESS name.keys.size %]
<option value="" disabled="disabled"></option>
[% END %]
</select> </select>
</label> </label>
</td> </td>
...@@ -122,6 +126,8 @@ function subcatSelected() { ...@@ -122,6 +126,8 @@ function subcatSelected() {
<script language="JavaScript" type="text/javascript"> <script language="JavaScript" type="text/javascript">
document.chartform.category[0].selected = true; document.chartform.category[0].selected = true;
document.chartform.subcategory.disabled = '';
document.chartform.name.disabled = '';
catSelected(); catSelected();
subcatSelected(); subcatSelected();
</script> </script>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
[% subcategory = category.${default.category} %] [% subcategory = category.${default.category} %]
[% name = subcategory.${default.subcategory} %] [% name = subcategory.${default.subcategory} %]
<script> <script type="text/javascript">
[%# This structure holds details of the series the user can select from. %] [%# This structure holds details of the series the user can select from. %]
var series = { var series = {
[% FOREACH c = category.keys.sort %] [% FOREACH c = category.keys.sort %]
...@@ -102,7 +102,8 @@ function checkNewState() { ...@@ -102,7 +102,8 @@ function checkNewState() {
<label for="[% sel.name %]" accesskey="[% sel.accesskey %]"> <label for="[% sel.name %]" accesskey="[% sel.accesskey %]">
<select name="[% sel.name %]" id="[% sel.name %]" <select name="[% sel.name %]" id="[% sel.name %]"
size="[% sel.size %]" style="width: 15em" size="[% sel.size %]" style="width: 15em"
[%+ "onchange='$sel.onchange'" IF sel.onchange %]> [%+ "disabled=\"disabled\"" UNLESS ${sel.name}.keys.size || newtext %]
[%+ "onchange=\"$sel.onchange\"" IF sel.onchange %]>
[% FOREACH x = ${sel.name}.keys.sort %] [% FOREACH x = ${sel.name}.keys.sort %]
<option value="[% x FILTER html %]" <option value="[% x FILTER html %]"
[% " selected" IF default.${sel.name} == x %]> [% " selected" IF default.${sel.name} == x %]>
...@@ -110,6 +111,8 @@ function checkNewState() { ...@@ -110,6 +111,8 @@ function checkNewState() {
[% END %] [% END %]
[% IF newtext %] [% IF newtext %]
<option value="">[% newtext FILTER html %]</option> <option value="">[% newtext FILTER html %]</option>
[% ELSIF NOT ${sel.name}.keys.size %]
<option value="" disabled="disabled"></option>
[% END %] [% END %]
</select> </select>
</label> </label>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<tbody> <tbody>
<tr> <tr>
<th>Category:</th> <th>Category:</th>
<noscript><th></th></noscript> <th></th>
<th>Sub-category:</th> <th>Sub-category:</th>
<th>Name:</th> <th>Name:</th>
<td></td> <td></td>
...@@ -45,11 +45,11 @@ ...@@ -45,11 +45,11 @@
[% PROCESS series_select sel = { name => 'category', [% PROCESS series_select sel = { name => 'category',
size => 5, size => 5,
onchange => "catSelected()" } %] onchange => "catSelected()" } %]
<noscript> <td>
<td> <noscript>
<input type="submit" name="action-edit" value="Update -->"> <input type="submit" name="action-edit" value="Update --&gt;">
</td> </noscript>
</noscript> </td>
[% PROCESS series_select sel = { name => 'subcategory', [% PROCESS series_select sel = { name => 'subcategory',
size => 5, size => 5,
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<input type="text" style="width: 100%" name="newcategory" <input type="text" style="width: 100%" name="newcategory"
maxlength="64" value="[% default.newcategory.0 FILTER html %]"> maxlength="64" value="[% default.newcategory.0 FILTER html %]">
</td> </td>
<noscript><td></td></noscript> <td></td>
<td> <td>
<input type="text" style="width: 100%" name="newsubcategory" <input type="text" style="width: 100%" name="newsubcategory"
maxlength="64" maxlength="64"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment