Mailing List Archive

customize foldable sections in ticket view
Hello.

I like very much the TRAC 0.12 feature of foldable sections in the
ticket view. I mean those little triangles which for example can expand
or close the "Ticket history" or "Attachment" section of a ticket.

Now I would like to change the default status of these foldable section.
I would like the "Ticket history", and "Attachment" to be closed by
default while the "Change Ticket" section shall be opened.

I searched in the internet and also studied the generated
HTML/CSS/Java-Script code for a ticket but could not see a solution. Can
you please advice me some pointers how to change the foldable behaviour
of tickets?

Thanks
Clemens

P.S.
Last week we migrated from Trac 0.11 to 0.12 and we were positively
surprised how smoothly the migration worked. My commendation goes to all
Trac developers. VERY GOOD JOB!!!

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to trac-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
Re: customize foldable sections in ticket view [ In reply to ]
Clemens Feige wrote:
> Now I would like to change the default status of these foldable section.
> I would like the "Ticket history", and "Attachment" to be closed by
> default while the "Change Ticket" section shall be opened.

Currently, there's no other way than to embed some JavaScript in your
site.html template. People usually complain about the "Change Ticket"
section, but I think you're the first one to mention the other sections.

I still have trouble understanding how a single additional click can
make elicit such strong reactions (not talking about you Clemens, rather
the people on #9807). But hey, maybe my way of using Trac must be strange.

Now, we're slowly coming to the point where enough people have
complained for long enough that we're going to be forced to do something
about it ;)

So, to reply to the original question, head over to #9807 and adapt the
snippet in comment:25 to additionally collapse the attachment and
history sections.

-- Remy
Re: customize foldable sections in ticket view [ In reply to ]
Remy Blank, 09.11.2011 20:07:
> Clemens Feige wrote:
>> Now I would like to change the default status of these foldable section.


> So, to reply to the original question, head over to #9807 and adapt the
> snippet in comment:25 to additionally collapse the attachment and
> history sections.
>
> -- Remy
>

Hi Remy.

Thanks for pointing me to #9807 on
http://trac.edgewall.org/ticket/9807#comment:25 .

The reason for why I want to collapse the "Change History" in the ticket
view is that in our work flow we never use ticket comments. If we want
to add something to a ticket, then we simply modify the description. Now
you can understand why the "Change History" with the comments is not
much interesting for us, instead the "Modify Ticket" section is much
more important for us.

I tried the snippet (see code below) for site.html in #9807:comment:25
and it expanded the "Modify Ticket" section as promised. But I do not
know how to change the code that it additionally also collapses the
"Change History". I assume that I need to target the <div
id="changelog"> section somehow. But how? Can you give help, please? Or
someone else please?

Here is the snipped from #9807:

<!--! Expand "Modify Ticket" by default -->
<div py:match="div[@id='content' and @class='ticket']//div[@id='modify']"
py:attrs="select('@*')">
${select('*|comment()|text()')}
<script type="text/javascript"
py:if="not 'preview' in req.args">
jQuery(document).ready(function($) {
$("#modify").parent().removeClass("collapsed");
});
</script>
</div>

Thanks
Clemens

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to trac-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
Re: customize foldable sections in ticket view [ In reply to ]
Clemens,

you could take a look at how I've decluttered Custom Query view in my patch
queue <https://bitbucket.org/lkraav/trac-lkraav/src>:

https://bitbucket.org/lkraav/trac-lkraav/src/64f09c45d679/custom-query-declutter-0.12.2-hg-r7474.patch

--
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/-/Ep8iN1QmOzEJ.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to trac-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
Re: customize foldable sections in ticket view [ In reply to ]
Clemens, 09.11.2011 18:05:
> Hello.
>
> I like very much the TRAC 0.12 feature of foldable sections in the
> ticket view. I mean those little triangles which for example can expand
> or close the "Ticket history" or "Attachment" section of a ticket.
>
> Now I would like to change the default status of these foldable section.
> I would like the "Ticket history", and "Attachment" to be closed by
> default while the "Change Ticket" section shall be opened.


Thanks to Remy and Leho and some own trial-and-error work I now solved
my above issue. Here is what you need to put into the site.html template:


<!-- Expand "Modify Ticket" by default.
inspired by http://trac.edgewall.org/ticket/9807#comment:18 -->
<div py:match="div[@id='content' and
@class='ticket']//div[@id='modify']" py:attrs="select('@*')">
${select('*|comment()|text()')}
<script type="text/javascript">
jQuery(document).ready(function($) {
$("#modify").parent().removeClass("collapsed");
});
</script>
</div>

<!-- Collapse "Ticket History" by default
inspired by http://trac.edgewall.org/ticket/9807#comment:18 -->
<div py:match="div[@id='content' and
@class='ticket']//div[@id='changelog']" py:attrs="select('@*')">
${select('*|comment()|text()')}
<script type="text/javascript">
jQuery(document).ready(function($) {
$("#changelog").parent().toggleClass("collapsed");
});
</script>
</div>


best regards
Clemens

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