Commits

Leho Kraav committed 6d118b5

declutter custom query page: start with a collapsed query build panel

Comments (0)

Files changed (1)

custom-query-r9280-declutter.patch

+diff -r 208ea70c80f2 trac/ticket/templates/query.html
+--- a/trac/ticket/templates/query.html	Thu Sep 16 02:14:33 2010 +0300
++++ b/trac/ticket/templates/query.html	Thu Sep 16 02:23:35 2010 +0300
+@@ -15,18 +15,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)}
+@@ -232,6 +237,19 @@
+         };
+         initializeFilters();
+       </script>
++    </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 208ea70c80f2 trac/ticket/templates/query_results.html
+--- a/trac/ticket/templates/query_results.html	Thu Sep 16 02:14:33 2010 +0300
++++ b/trac/ticket/templates/query_results.html	Thu Sep 16 02:23:35 2010 +0300
+@@ -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">