3479 refactor table builder helper
Created by: teddywing
Refactor the table_builder helper (in NewapplicationHelper).
This doesn't touch the existing table_builder method. It provides a new table_builder_2 helper that can be used to do a slow migration to the new helper. After migrating, it will have to be renamed to table_builder.
table_builder_2 is based on table_builder but changes a number of things in light of the following requirements:
- Allow column-level activation & deactivation of sorting
- Take the links from the header of the show page of the objects in the table. Display those links in the row's gear menu
The links are now abstracted into decorators on each object. This enables us to define the links in one place, and render them all in both the header and gear menu.
Header link updates
Pages to test:
| Page | URL |
|---|---|
Referentials#show |
/referentials/:id |
Lines#show |
/line_referentials/:id/lines/:id |
TimeTables#show |
/referentials/:id/time_tables/:id |
Routes#show |
/referentials/:id/lines/:id/routes/:id |
RoutingConstraintZones#show |
/referentials/:id/lines/:id/routing_constraint_zones |
Calendars#show |
/calendars/:id |