Season Formatter: Each season week as individual table

Created on 21 April 2023, about 1 year ago
Updated 1 March 2024, 4 months ago

Problem/Motivation

When new season are added, the whole timetable is displayed as a single html table.
Each week should be separated in a single html table , for being able to style it in css properly.

Steps to reproduce

add seasons with different timetable.
Choose the table formatter.

Feature request
Status

Fixed

Version

1.15

Component

Code - formatter

Created by

🇫🇷France matoeil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @matoeil
  • 🇳🇱Netherlands johnv

    I will wait for the crowd to have some ideas.

  • First commit to issue fork.
  • Status changed to Needs review about 1 year ago
  • I've created a merge request with a new formatter - OfficeHoursFormatterSeparateTables, "Tables, split by season and exception". Where there are seasons and/or exceptions, the main hours are given the caption 'normal hours', and the seasons or exceptions are given their relevant labels.

    I would suggest that separate tables is actually what I would have expected in terms of both UX and DX for this functionality, so this new formatter could just replace OfficeHoursFormatterTable anyway, but I've created it as a separate formatter for now.

  • 🇳🇱Netherlands johnv

    Off topic: After having seen your screen dumps, what is your opinion of #3152911: Move 'Closed text' to Comment column if enabled ?
    (Please respond in that issue.)

  • 🇳🇱Netherlands johnv

    This is a nice addition, thanks.

    Some initial remarks:
    In the newest version, variable 'current' is renamed to 'is_current'.
    The titles are centered. Is left-handed better?

    I think, from UX, thisis good to go. @matoeil, what do you think?

    However, before committing, some refactoring is needed, where this new formatter calls the existing formater for each week / exceptions set / season. The current patch seems too complicated to read and maintain.

    regards, John

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.1 & MySQL 5.7
    last update 8 months ago
    Patch Failed to Apply
  • 🇳🇱Netherlands johnv

    Thank you,

    I have used your MR to make the formatter code more reuseable in 🐛 Formatter table has incorrect header Fixed .
    I noticed your code mixes up the '$table_class'.
    I refactored your code to a drop-in patch. Sorry for not using the MR.

    I have one big problem with the new 'multiple tables' approach: the columns are not nicely aligned anymore. Please see the attached screenshots.

    Also, we need to decide on where to put the Season/Exceptions title.
    In attached screenshots 3 options are visible (Using Table Select List formatter - you can use Table formatter, too):
    - as caption of the new table (in yellow, your addition),
    - as column header of the new table ('Day'),
    - as first column of a special timeslot (in green, like 'Wednesday' vs. 'Summer 2024')

  • 🇳🇱Netherlands johnv

    Also,
    multiple table breaks backwards compatibility, see office_hours_exceptions_preprocess_field(),
    where
    $formatter_rows = &$element['content']['#table']['#rows'];
    now becomes
    $formatter_rows = &$element['content']['#table'][$index]['#rows'];

    (ITMT, this code seems redundant - only $exception_header['id'] must be set, but it is not documented for what reason.)

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.1 & MySQL 5.7
    last update 8 months ago
    Patch Failed to Apply
  • 🇳🇱Netherlands johnv

    Please find attached a reroll of the patch. Sorry for not using MR's.
    It solves the BC problems, since the original is now splitted in several elements, instead of subdivided.

    Still 2 open points, as stated in #9:
    - Due to the new 'multiple tables' approach, the columns are not nicely aligned anymore. Please see the attached screenshots from #9.
    - Also, we need to decide on where to put the Season/Exceptions title. In the screenshots 3 options are visible (Using Table Select List formatter - you can use Table formatter, too):
    -- as caption of the new table (in yellow, your addition),
    -- as column header of the new table ('Day'),
    -- as first column of a special timeslot (in green, like 'Day'/'Wednesday' vs. 'Summer 2024')

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.1 & MySQL 5.7
    last update 6 months ago
    Patch Failed to Apply
  • 🇳🇱Netherlands johnv

    reroll from #11

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7
    last update 5 months ago
    Patch Failed to Apply
  • 🇳🇱Netherlands johnv

    This reroll decides to use the table caption, removing seasonHeader and ExceptionHeader items from the formatter, leaving the replacement of the 'Day' table header column as an alternative.

  • Status changed to Fixed 4 months ago
  • 🇳🇱Netherlands johnv

    Committed a final patch.
    - It also contains necessary corrections for Add Formatter with Select list display Fixed
    - Season/Exceptions title is now in the column headers, which are visible upon multiple tables. So, not in captions, not in extra table items/rows.

    Still some open points:
    - Due to the new 'multiple tables' approach, the columns are not nicely aligned anymore. Please see the attached screenshots from #9.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024