Commits

Leho Kraav committed 64f09c4

update for 0.12.2

  • Participants
  • Parent commits 3800d82

Comments (0)

Files changed (3)

custom-query-declutter-0.12.1-hg-r7210.patch

-diff -r 29c1f606c918 trac/ticket/templates/query.html
---- a/trac/ticket/templates/query.html
-+++ b/trac/ticket/templates/query.html
-@@ -16,18 +16,23 @@
-           $("#groupdesc").enable(this.selectedIndex != 0)
-         }).change();
-         $("fieldset legend.foldable").enableFolding(false);
-+        $("div h1.foldable").enableFolding(false);
-         /* Hide the filters for saved queries. */
-         if (window.location.href.search(/[?&]report=[0-9]+/) != -1)
-           $("#filters").toggleClass("collapsed");
-         /* Hide the columns by default. */
-         $("#columns").toggleClass("collapsed");
-+        /* Hide the query panel by default. */
-+        $("#querypanel").parent().toggleClass("collapsed");
-       });
-     /*]]>*/</script>
-   </head>
- 
-   <body>
-     <div id="content" class="query">
--      <h1>$title <span class="numrows">(${ngettext('%(num)s match', '%(num)s matches', query.num_items)})</span></h1>
-+      <div>
-+      <h1 class="foldable">$title <span class="numrows">(${ngettext('%(num)s match', '%(num)s matches', query.num_items)})</span></h1>
-+      <div id="querypanel">
- 
-       <div py:if="description" id="description" xml:space="preserve">
-         ${wiki_to_html(context(report_resource), description)}
-@@ -211,6 +216,19 @@
-         </div>
-         <hr />
-       </form>
-+     </div>
-+     </div>
-+     <table class="listing tickets">
-+       <thead>
-+         <tr>
-+           <th py:for="header in headers"
-+             class="$header.name${query.order == header.name and (query.desc and ' desc' or ' asc') or ''}">
-+             <a title="Sort by $header.label${query.order == header.name and not query.desc and ' (descending)' or ''}"
-+               href="$header.href">${header.label}</a>
-+           </th>
-+         </tr>
-+       </thead>
-+      </table>
- 
-       <xi:include href="query_results.html" />
- 
-diff -r 29c1f606c918 trac/ticket/templates/query_results.html
---- a/trac/ticket/templates/query_results.html
-+++ b/trac/ticket/templates/query_results.html
-@@ -28,7 +28,7 @@
-       <span class="numrows">(${ngettext('%(num)s match', '%(num)s matches', len(results))})</span>
-     </h2>
-     <table class="listing tickets">
--      <thead>
-+      <!--<thead>
-         <tr>
-           <th py:for="header in headers"
-             class="$header.name${query.order == header.name and (query.desc and ' desc' or ' asc') or ''}">
-@@ -38,7 +38,7 @@
-                href="$header.href">${header.label}</a>
-           </th>
-         </tr>
--      </thead>
-+      </thead>-->
- 
-       <tbody>
-         <tr py:if="not results" class="even">

custom-query-declutter-0.12.2-hg-r7474.patch

+# HG changeset patch
+# Parent 65efd80abb5750dcb12101cbefdf948d24f84a2e
+
+diff -r 65efd80abb57 trac/ticket/templates/query.html
+--- a/trac/ticket/templates/query.html
++++ b/trac/ticket/templates/query.html
+@@ -14,6 +14,7 @@
+         initializeFilters();
+         $("#group").change(function() {
+           $("#groupdesc").enable(this.selectedIndex != 0)
++          $("div h1.foldable").enableFolding(false);
+         }).change();
+         $("fieldset legend.foldable").enableFolding(false);
+         /* Hide the filters for saved queries. */
+@@ -21,13 +22,17 @@
+           $("#filters").toggleClass("collapsed");
+         /* Hide the columns by default. */
+         $("#columns").toggleClass("collapsed");
++        /* Hide the query panel by default. */
++        $("#querypanel").parent().toggleClass("collapsed");
+       });
+     /*]]>*/</script>
+   </head>
+ 
+   <body>
+     <div id="content" class="query">
+-      <h1>$title <span class="numrows">(${ngettext('%(num)s match', '%(num)s matches', query.num_items)})</span></h1>
++      <div id="querypanel-header">
++      <h1 class="foldable">$title <span class="numrows">(${ngettext('%(num)s match', '%(num)s matches', query.num_items)})</span></h1>
++      <div id="querypanel">
+ 
+       <div py:if="description" id="description" xml:space="preserve">
+         ${wiki_to_html(context(report_resource), description)}
+@@ -211,6 +216,35 @@
+         </div>
+         <hr />
+       </form>
++      </div> <!-- querypanel -->
++      </div> <!-- querypanel-header --> 
++
++      <!-- 
++      We move this from query_results.html to get a single header for column list.
++
++      Previously we moved header stuff, but since 0.12.2, it's much simpler now to just hide
++      sub-group column headers with:
++        .query div .tr-columns { display: none; }
++
++      query_results.html is still able to access column_headers() defined in here just fine.
++      -->
++      <py:def function="column_headers()">
++      <tr class="trac-columns">
++        <th py:for="header in headers"
++          class="$header.name${query.order == header.name and (query.desc and ' desc' or ' asc') or ''}">
++          <?python asc = _('(ascending)'); desc = _('(descending)') ?>
++          <a title="${_('Sort by %(col)s %(direction)s', col=header.label,
++            direction=(query.order == header.name and not query.desc and desc or asc))}"
++            href="$header.href">${header.label}</a>
++        </th>
++      </tr>
++      </py:def>
++
++      <table class="listing tickets">
++        <thead py:strip="group_index">
++          ${column_headers()}
++        </thead>
++      </table>
+ 
+       <xi:include href="query_results.html" />
+ 
 trac-svn-hook-r9872.patch
 powered-by-lkraav.patch
-custom-query-declutter-0.12.1-hg-r7210.patch
+custom-query-declutter-0.12.2-hg-r7474.patch
 # Placed by Bitbucket