7 | | Tickets can get noisy with lots of changes. This plugin hides a configurable set of changes to reduce this clutter. A button toggles between showing and hiding the changes. |
| 7 | Tickets can get noisy with lots of changes. This plugin hides a configurable set of changes to reduce this clutter. A button toggles between showing and hiding the changes. See [wiki:HideChangesPlugin#Examples examples below]. |
| 8 | |
| 9 | '''SECURITY WARNING! ''' This plugin processes freeform !JavaScript/jQuery code from the {{{trac.ini}}} file. If this can be a security concern in your Trac deployment, please do not use this plugin. |
| 10 | |
| 11 | |
| 12 | == Configuration == |
| 13 | 1. Install the plugin (after downloading and unzipping): |
| 14 | {{{ |
| 15 | cd hidechangesplugin/trunk |
| 16 | sudo python setup.py bdist_egg |
| 17 | sudo cp dist/TracHideChanges*.egg /your/trac/location/plugins/ |
| 18 | }}} |
| 19 | |
| 20 | See [http://trac.edgewall.org/wiki/TracPlugins TracPlugins] for more installation details and options. You'll likely need to restart Trac's web server after installation. |
| 21 | |
| 22 | 2. Enable the plugin: |
| 23 | {{{ |
| 24 | [components] |
| 25 | hidechanges.* = enabled |
| 26 | }}} |
| 27 | |
| 28 | You can alternatively use the Trac Web Admin GUI to enable any or all rules. |
| 29 | |
| 30 | 3. Create rules in the {{{[hidechanges]}}} section of {{{trac.ini}}} for which changes to hide. See [wiki:HideChangesPlugin#Examples examples below] for details and ideas. |
| 31 | |
27 | | Coming... |
| 52 | === Hide commentless changes === |
| 53 | The most common type of changes to want to hide are commentless changes - e.g., when just a field changes without any comment. Here's how you would configure this rule in {{{trac.ini}}}: |
| 54 | {{{ |
| 55 | [hidechanges] |
| 56 | rule.commentless = !changediv.find('div.comment').children().length |
| 57 | show_button_name = Show commentless changes |
| 58 | hide_button_name = Hide commentless changes |
| 59 | }}} |
| 60 | |
| 61 | The above rule is named {{{commentless}}}. It checks the change div's comment div for any children. If no children are found (length = {{{0}}}), that means the change is commentless. Since the rule needs to evaluate to {{{true}}} to hide a change, we negate the result with a {{{!}}}. In this example, we also changed the default button names to make it clear what type of comments are hidden. The button's name changes as the changes are shown or hidden. |
| 62 | |
| 63 | === Hide changeset changes === |
| 64 | To hide changeset changes that are in the Trac 0.12 wiki syntax: |
| 65 | {{{ |
| 66 | [hidechanges] |
| 67 | rule.changeset = changediv.find('p a.changeset').children().length |
| 68 | }}} |
| 69 | |
| 70 | The above rule is named {{{commentless}}}. It checks the change div's comment div for any children. If no children are found (length = {{{0}}}), that means the change is commentless. Since the rule needs to evaluate to {{{true}}} to hide a change, we negate the result with a {{{!}}}. In this example, we also changed the default button names to make it clear what type of comments are hidden. The button's name changes as the changes are shown or hidden. |