Bug 34945 - Remove the use of event attributes from OPAC clubs tab
Summary: Remove the use of event attributes from OPAC clubs tab
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks: 34709
  Show dependency treegraph
 
Reported: 2023-09-28 11:43 UTC by Owen Leonard
Modified: 2023-10-17 17:24 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.05,22.11.11


Attachments
Bug 34945: Remove the use of event attributes from OPAC clubs tab (4.95 KB, patch)
2023-09-28 11:56 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34945: Remove the use of event attributes from OPAC clubs tab (6.33 KB, patch)
2023-09-28 12:11 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34945: Remove the use of event attributes from OPAC clubs tab (6.34 KB, patch)
2023-10-02 15:10 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34945: Remove the use of event attributes from OPAC clubs tab (6.40 KB, patch)
2023-10-02 18:29 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 34945: Remove the use of event attributes from OPAC clubs tab (6.45 KB, patch)
2023-10-03 11:03 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2023-09-28 11:43:20 UTC
There are some event attributes in the OPAC's clubs tab, shown on the user summary page. These should be removed in favor of defining events in JavaScript.
Comment 1 Owen Leonard 2023-09-28 11:56:54 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2023-09-28 12:11:04 UTC
Created attachment 156325 [details] [review]
Bug 34945: Remove the use of event attributes from OPAC clubs tab

This patch removes the use of event attributes (onclick) from the
template for the clubs tab shown in the OPAC to a logged-in user.
These events are defined now along with the other in-page JS.

The patch also makes some general improvements to the template for
consistency:

- Adding Bootstrap color classes to the "Enroll" and "Cancel enrollment"
  buttons.
- Enhancing the responsive configuration to the DataTable.

To test you should have a few patron clubs defined (Tools -> Patron
clubs).

- Apply the patch and log in to the OPAC.
- On the user summary page, click the "Clubs" tab.
- The "Enroll" and "Cancel enrollment" buttons should look correct and
  work as expected:
  - Click the "Enroll" button.
    - On the enrollment confirmation view, test both the "Finish
      enrollment" button and the "Cancel" link.
  - Test "Cancel enrollment" button.
- Test the responsive behavior of the page to confirm that it adjusts
  well to narrow browser widths.
Comment 3 Victor Grousset/tuxayo 2023-09-29 16:25:49 UTC
"Cancel enrollment" button doesn't work with width < 620 px.

Because the button is hidden and another one is created bellow. Which lacks the event handler.
Comment 4 Owen Leonard 2023-10-02 15:10:44 UTC
Created attachment 156456 [details] [review]
Bug 34945: Remove the use of event attributes from OPAC clubs tab

This patch removes the use of event attributes (onclick) from the
template for the clubs tab shown in the OPAC to a logged-in user.
These events are defined now along with the other in-page JS.

The patch also makes some general improvements to the template for
consistency:

- Adding Bootstrap color classes to the "Enroll" and "Cancel enrollment"
  buttons.
- Enhancing the responsive configuration to the DataTable.

To test you should have a few patron clubs defined (Tools -> Patron
clubs).

- Apply the patch and log in to the OPAC.
- On the user summary page, click the "Clubs" tab.
- The "Enroll" and "Cancel enrollment" buttons should look correct and
  work as expected:
  - Click the "Enroll" button.
    - On the enrollment confirmation view, test both the "Finish
      enrollment" button and the "Cancel" link.
  - Test "Cancel enrollment" button.
- Test the responsive behavior of the page to confirm that it adjusts
  well to narrow browser widths.
Comment 5 Victor Grousset/tuxayo 2023-10-02 18:29:41 UTC
Created attachment 156460 [details] [review]
Bug 34945: Remove the use of event attributes from OPAC clubs tab

This patch removes the use of event attributes (onclick) from the
template for the clubs tab shown in the OPAC to a logged-in user.
These events are defined now along with the other in-page JS.

The patch also makes some general improvements to the template for
consistency:

- Adding Bootstrap color classes to the "Enroll" and "Cancel enrollment"
  buttons.
- Enhancing the responsive configuration to the DataTable.

To test you should have a few patron clubs defined (Tools -> Patron
clubs).

- Apply the patch and log in to the OPAC.
- On the user summary page, click the "Clubs" tab.
- The "Enroll" and "Cancel enrollment" buttons should look correct and
  work as expected:
  - Click the "Enroll" button.
    - On the enrollment confirmation view, test both the "Finish
      enrollment" button and the "Cancel" link.
  - Test "Cancel enrollment" button.
- Test the responsive behavior of the page to confirm that it adjusts
  well to narrow browser widths.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 6 Victor Grousset/tuxayo 2023-10-02 18:30:03 UTC
Thanks, it works :D
Comment 7 Katrin Fischer 2023-10-03 11:03:59 UTC
Created attachment 156494 [details] [review]
Bug 34945: Remove the use of event attributes from OPAC clubs tab

This patch removes the use of event attributes (onclick) from the
template for the clubs tab shown in the OPAC to a logged-in user.
These events are defined now along with the other in-page JS.

The patch also makes some general improvements to the template for
consistency:

- Adding Bootstrap color classes to the "Enroll" and "Cancel enrollment"
  buttons.
- Enhancing the responsive configuration to the DataTable.

To test you should have a few patron clubs defined (Tools -> Patron
clubs).

- Apply the patch and log in to the OPAC.
- On the user summary page, click the "Clubs" tab.
- The "Enroll" and "Cancel enrollment" buttons should look correct and
  work as expected:
  - Click the "Enroll" button.
    - On the enrollment confirmation view, test both the "Finish
      enrollment" button and the "Cancel" link.
  - Test "Cancel enrollment" button.
- Test the responsive behavior of the page to confirm that it adjusts
  well to narrow browser widths.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Tomás Cohen Arazi 2023-10-04 13:45:01 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 9 Fridolin Somers 2023-10-05 20:29:14 UTC
Pushed to 23.05.x for 23.05.05
Comment 10 Matt Blenkinsop 2023-10-17 17:24:48 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x