Patch #18770


Make issue history collapsable

Added by Olivier Houdas over 9 years ago. Updated over 4 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Here is a small patch to make the history of an issue collapsable/expandable in the same way as grouped issue lists (using the same already existing javascript).

The patch also adds an independent collapse/Expand button on the Description of the issue.

This was requested by our support team as they use email reception features of Redmine to manage support requests from clients, and sometimes, history can become very long, when there are many mails exchanged.

Feel free to include this code in a future version of Redmine. The patch is based on 2.6.0.
Note that this more or less addresses feature request #15409.


Collapsable-history.patch (3.35 KB) Collapsable-history.patch Olivier Houdas, 2015-01-07 11:27
18770-current.png (22.2 KB) 18770-current.png Layout with Redmine 2.6.0 Olivier Houdas, 2015-01-07 12:10
18770-new-collapsed.png (14.6 KB) 18770-new-collapsed.png Layout with the provided patch Olivier Houdas, 2015-01-07 12:13
Collapsable-history-divs.patch (6.15 KB) Collapsable-history-divs.patch Version to use Olivier Houdas, 2015-01-07 15:14
Collapsable-divs-History-and-roadmap.patch (9.91 KB) Collapsable-divs-History-and-roadmap.patch Collapsable issue history and versions in roadmap - RM 3.1.0 Olivier Houdas, 2015-08-11 17:18

Related issues

Related to Redmine - Feature #15409: Is it possible to view History section in pages?New

Actions #1

Updated by Olivier Houdas over 9 years ago

Note: Associated code repository revisions are displayed on their own line in the start of the history, with this change, instead of being a div aligned on the right, and at the same level as notes, as before. I had to add the notes into a table to be able to use the existing javascript, which creates this change of layout.

Actions #2

Updated by Olivier Houdas over 9 years ago

After some more testing, I realized I broke the DOM model by interlacing DIV and TR tags.
Here is another patch, completely re-written. It uses the same principle as for issues list with tables, but applied to DIV tags with specific classes.
With this new code, there is no more layout issue for displaying the revision history from the code repository.

Actions #3

Updated by Toshi MARUYAMA over 9 years ago

  • Related to Feature #15409: Is it possible to view History section in pages? added
Actions #4

Updated by Olivier Houdas almost 9 years ago

I have updated my patch to use the same css and js changes to add collapsable versions in the roadmap.
The new patch is built for Redmine 3.1.0.
I checked the generated HTML pages with Tidy and fixed a unclosed DIV in the first version of the patch.

Actions #5

Updated by Aleksandar Pavic over 4 years ago

Can you update for Redmine 4

also, can you create normal patch, not hg one, because I'm getting:

patch -p0 --dry-run < Collapsable-divs-History-and-roadmap.patch 
can't find file to patch at input line 13

which is how, it's supposed to be done:


and if I do:

patch -p1 --dry-run < Collapsable-divs-History-and-roadmap.patch 
checking file app/views/issues/_history.html.erb
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED
checking file app/views/issues/show.html.erb
Hunk #1 FAILED at 75.
1 out of 1 hunk FAILED
checking file app/views/versions/index.html.erb
Hunk #1 FAILED at 9.
Hunk #2 FAILED at 83.
2 out of 2 hunks FAILED
checking file public/javascripts/application.js
Hunk #1 succeeded at 69 (offset 7 lines).
checking file public/stylesheets/application.css
Hunk #1 succeeded at 284 (offset 101 lines).
Hunk #2 FAILED at 233.
1 out of 2 hunks FAILED

It fails on Redmine 4...


Also available in: Atom PDF