Commit 8c02cce
Keep Package id / Resource id / Size on the resource page regardless of template precedence
The whitelist that limits the resource "Additional Information" table to
Package id, Resource id and Size lived in the theme's copy of
scheming/package/resource_read.html. That template only renders when
ckanext-iaea outranks ckanext-scheming in ckan.plugins (earlier in the list ==
higher template precedence). Where it loses, ckanext-scheming's copy renders
instead: the same fields come out as collapsible <tr class="toggle-more"> rows,
and custom.css was hiding both those rows and the "Show more" button that would
expand them, so the three fields disappeared with no way to reach them.
Move the whitelist and labels into a format_resource_items helper that
overrides the core helper of the same name. All three copies of
resource_read.html -- core's, scheming's and ours -- source their rows from
that helper, so the filtering holds whichever one renders.
Flip the CSS to force .toggle-more rows visible instead of hidden. Nothing
worth collapsing survives the helper now, and the toggle control stays hidden.
Verified both ways against a local resource page: with the theme template
present the output is unchanged, and with it removed (reproducing the losing
case) the same four rows render with the correct labels instead of 20 hidden
ones.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent c32d550 commit 8c02cce
3 files changed
Lines changed: 59 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
483 | | - | |
484 | | - | |
| 482 | + | |
485 | 483 | | |
486 | 484 | | |
487 | | - | |
488 | | - | |
489 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
490 | 495 | | |
491 | 496 | | |
492 | 497 | | |
| |||
495 | 500 | | |
496 | 501 | | |
497 | 502 | | |
| 503 | + | |
498 | 504 | | |
499 | | - | |
| 505 | + | |
500 | 506 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
79 | 116 | | |
80 | 117 | | |
81 | 118 | | |
82 | 119 | | |
| 120 | + | |
83 | 121 | | |
Lines changed: 8 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
88 | 87 | | |
89 | | - | |
90 | | - | |
91 | | - | |
| 88 | + | |
92 | 89 | | |
93 | 90 | | |
94 | 91 | | |
| |||
0 commit comments