#13597 closed enhancement (fixed)
Accept rows with missing columns
Reported by: | anonymous | Owned by: | jonny |
---|---|---|---|
Priority: | normal | Component: | TablePlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.3 |
Description
I made a small hack to make TablePlugin accept rows that don't contain all columns.
This is a correct syntax, without my fix:
{{{ #!styledtable @table (@default) @column task @column details @column status #! Header row @task: Task @details: Details @status: Status #! Rows @task: Task 1 @details: Details of Task 1. @status: Complete @task: Task 2 @details: Details of Task 2. @status: Complete }}}
However, if one were to leave out (by mistake or choice) a column somewhere, an unclear error message would show instead.
So I adjusted the code to allow for missing columns, which makes the missing cell just show up as empty. To make this work one needs to add @endrow
to end of row. If one doesn't do that, the plugin works just as before, it's backward compatible. This means that if one have a lot of columns, where many cells in rows are empty, it will be drastically shorter to work with the syntax for it.
With my adjustment, this is working just fine:
{{{ #!styledtable @table (@default) @column task @column details @column status #! Header row @task: Task @details: Details @status: Status #! Rows @task: Task 1 @details: Details of Task 1. @status: Complete @task: Task 2 @endrow }}}
I haven't got the first clue on how to use SVN, I hope it's ok to just attach my modified code to this ticket and hopefully @rjollos will consider and possibly act on it.
(Sidenote: I'm using this with Trac 1.3.6 so I can confirm that this version (and the one already published) works fine.)
Attachments (1)
Change History (5)
Changed 5 years ago by
comment:1 Changed 5 years ago by
Replying to anonymous:
I haven't got the first clue on how to use SVN,
See TracDev/SubmittingPatches.
$ svn co ... $ ed ... $ svn diff > patch
comment:4 Changed 5 years ago by
Please document on the TablePlugin page.
Done. And thank you for acting on this...
See TracDev/SubmittingPatches.
...and thank you for showing that page, I had completely missed it.
Updated table.py