On 23 January 2010 20:38, Milad <ick...@gmail.com> wrote:
>
> [...] For example, if you go here:
>
> http://trac.edgewall.org/ticket/8813#no1
>
> You can see that there is a heading called "Attachments" with a little
> arrow next to it that, when clicked, hides/shows the attachments part
> of the ticket.
How exactly do I enable this foldable behaviour?
TIA,
--
Jens Peter Secher.
_DD6A 05B0 174E BFB2 D4D9 B52E 0EE5 978A FE63 E8A1 jpsecher gmail com_.
A. Because it breaks the logical sequence of discussion.
Q. Why is top posting bad?
Start by installing Trac 0.12, which added this functionality. After
that, it's all in the little black arrows.
--
Roger Oberholtzer
I am stuck with 0.11.7 for the moment. But that does not seem to be a
hindrance: the collapse functionality works in other places, eg. the
Admin page's Plugins part has foldable elements on my screen. Each
plugin item is surrounded by a <div class="plugin"> but I cannot
figure out how the style sheet works.
What I would like is to make the ticket page as clean as possible by
having change history, comments, etc. collapsed by default so that
(most) tickets will fit a single screen, as well as guide users to
edit the description instead of adding new comments.
Is there an easily way to hack the page templates to introduce
specific foldable sections?
Cheers,
Seems it would be less work to upgrade to 0.12...
--
Roger Oberholtzer
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}" />
Hi,
Thanks for your reply. I have checked and I do have JavaScript enabled in my browser. I tried with both Firefox and Chrome. In the console I can see one single error thrown by JS : -
"[18:46:19.234] a.attributes is undefined @ http://path_to_trac/chrome/common/js/jquery.js:55"
Could this be the problem?
--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/e-W0lzbSl0IJ.
To post to this group, send email to trac-...@googlegroups.com.
To unsubscribe from this group, send email to trac-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.