Modify ↓
#11361 closed enhancement (fixed)
Hide batch modify form when there are no query results
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | ticket system | Version: | 1.0-stable |
Severity: | normal | Keywords: | batch-modify |
Cc: | Branch: | ||
Release Notes: |
The Batch Modify section on the Query page is hidden when there are no query results. |
||
API Changes: | |||
Internal Changes: |
Description
The batch modify form is shown when there are no query results, however the Action fieldset is empty and the form can't serve any function.
The proposed change will hide the #batchmod_form
when there are no query results.
-
trac/ticket/templates/query.html
diff --git a/trac/ticket/templates/query.html b/trac/ticket/templates/query.html index 4f8e682..6de55dd 100644
a b 223 223 </form> 224 224 225 225 <xi:include href="query_results.html" /> 226 <xi:include py:if=" batch_modify" href="batch_modify.html" />226 <xi:include py:if="tickets and batch_modify" href="batch_modify.html" /> 227 227 228 228 <div id="trac-report-buttons" class="buttons" 229 229 py:with="edit = report_resource and 'REPORT_MODIFY' in perm(report_resource);
Attachments (1)
Change History (4)
by , 11 years ago
Attachment: | NoTickets.png added |
---|
comment:1 by , 11 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:2 by , 11 years ago
Proposed further refinement: only add the group toggle checkbox if there are entries in the table:
-
trac/htdocs/js/query.js
index 3631344..eb8dd07 100644
a b 393 393 394 394 // Add a checkbox at the top of the column 395 395 // to select every ticket in the group. 396 $("table.listing tr th.id").each(function() { 397 $(this).before( 398 $('<th class="batchmod_selector sel">').append( 399 $('<input type="checkbox" name="batchmod_toggleGroup" />').attr({ 400 title: _("Toggle selection of all tickets shown in this group") 401 }))); 402 }); 396 if ($("table.listing tr td.id").length) { 397 $("table.listing tr th.id").each(function() { 398 $(this).before( 399 $('<th class="batchmod_selector sel">').append( 400 $('<input type="checkbox" name="batchmod_toggleGroup" />').attr({ 401 title: _("Toggle selection of all tickets shown in this group") 402 }))); 403 }); 404 } 403 405 404 406 // Add the click behavior for the group toggle. 405 407 $("input[name='batchmod_toggleGroup']").click(function() {
comment:3 by , 11 years ago
Note:
See TracTickets
for help on using tickets.
I was hoping to write a functional test for this, but since we can't test JavaScript with Twill, and after #11014 the Batch Modification section is hidden when JavaScript is disabled, it doesn't seem to be possible.
Committed to 1.0-stable in [12245] and merged to trunk in [12246].