FYI: Here it what sort-of-works for getting foldable sections in the Ticket
page for Trac 11.7:


Index: trunk/trac/usr-share-pyshared-trac-ticket-templates-ticket.html
===================================================================
--- a/trunk/trac/usr-share-pyshared-trac-ticket-templates-ticket.html
+++ b/trunk/trac/usr-share-pyshared-trac-ticket-templates-ticket.html
@@ -19,4 +19,8 @@
       </py:choose>
     </title>
+
+    <!-- To enable foldable sections. -->
+    <link rel="stylesheet" href="/trac/chrome/common/css/report.css"
type="text/css" />
+
     <script type="text/javascript"
src="${chrome.htdocs_location}js/wikitoolbar.js"></script>
     <script type="text/javascript" py:choose="">
@@ -41,4 +44,18 @@
         $("#field-summary").focus();
       </py:otherwise>
+      });
+    </script>
+    <script type="text/javascript"
src="/trac/chrome/common/js/folding.js"></script>
+    <script type="text/javascript">
+      jQuery(document).ready(function($) {
+        $("#group").change(function() {
+          $("#groupdesc").enable(this.selectedIndex != 0)
+        }).change();
+        $("fieldset legend.foldable").enableFolding(false);
+        /* Hide the most sections by default. */
+        $("#action").toggleClass("collapsed");
+        $("#changelog-foldable").toggleClass("collapsed");
+        $("#addcomment-foldable").toggleClass("collapsed");
+        $("#attachments-foldable").toggleClass("collapsed");
       });
     </script>
@@ -204,11 +221,15 @@

       <py:if test="ticket.exists">
+        <fieldset id="attachments-foldable">
+          <legend class="foldable">Attachments</legend>
         <!--! do not show attachments for old versions of this ticket
or for new tickets -->
         <py:if test="not version and version != 0 and ticket.exists">
           ${list_of_attachments(attachments)}
         </py:if>
+        </fieldset>

         <py:if test="ticket.exists and changes">
-          <h2>Change History</h2>
+         <fieldset id="changelog-foldable">
+           <legend class="foldable">Change History</legend>
           <div id="changelog">
             <form py:for="change in changes" method="get"
action="#comment" class="printableform">
@@ -239,4 +260,5 @@
             </form>
           </div>
+          </fieldset>
         </py:if>
       </py:if>
@@ -245,6 +267,8 @@
       <form py:if="not version and version != 0 and (can_append or
can_modify or can_edit or can_create)"
             action="${ticket.exists and href.ticket(ticket.id) or
href.newticket()}" method="post" id="propertyform">
-        <h3 py:if="ticket.exists"><a id="edit"
onfocus="$('#comment').get(0).focus()">
-            Add/Change #${ticket.id} ($ticket.summary)</a></h3>
+
+         <fieldset id="addcomment-foldable">
+           <legend class="foldable" py:if="ticket.exists" id="edit">
+              <a onfocus="$('#comment').get(0).focus()">Add/Change
#${ticket.id} ($ticket.summary)</a></legend>
         <div py:if="authname == 'anonymous'" class="field">
           <fieldset>
@@ -276,4 +300,6 @@
           </fieldset>
         </div>
+      </fieldset>
+
         <fieldset id="properties" py:if="can_modify or can_edit or can_create"
                   py:with="fields = [f for f in fields if not f.skip]">
@@ -379,5 +405,5 @@
           <py:choose>
             <fieldset py:when="can_append or can_modify" id="action">
-              <legend>Action</legend>
+              <legend class="foldable">Action</legend>
               <div py:for="key, label, controls, hints in action_controls">
                   <input type="radio" id="action_$key" name="action"
value="$key" checked="${key == action or None}" />

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.

Reply via email to