You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server name and version (for example: TFS 0.3): TFS 1.4 (latest main)
MyAAC Version: master
Client configuration (Your Computer)
Browser: Brave/Chromium
Operating System: Windows 10
Description:
The rules page renders the rules in a readonly textarea when you don't have permission to edit them, and in a single paragraph with no line breaks when you do have the permission to edit them.
Steps To Reproduce:
Log into your MyACC website as an account with any permissions, admin or normal. Navigate to the rules page via the sidebar, e.g. http://nova-secura.local/?rules
Observe that the rules are shown in a small, read-only textarea - we can't read all of the horrific examples without scrolling:
My initial instinct was that the textarea in rules.html.twig was unnecessary.
Changing the env in config.local.php to dev so I could live-edit the Twig templates, I disabled the textarea:
The formatting that is clearly visible in both the admin page and the textarea is being lost. Classic HTML not respecting line breaks 😀 The breaks are being written correctly into the page, but the browser won't render them unless they're <br> tags:
The good news is that Twig has an nl2br formatting function that we can use to turn those newlines in <br> tags:
I'll submit a PR in a couple of minutes 😀 I haven't got a fix for the formatting for rules_on_the_page as show in step 2, but this is only visible to admins so isn't that important. I'm not sure what code is writing the rules out there.
The text was updated successfully, but these errors were encountered:
The rules page uses a textarea to show lines break.
This commit replaces the textarea and uses the Twig
nl2br function to format the text for web browsers.
Fixesslawkens#176
The rules page uses a textarea to show lines break.
This commit replaces the textarea and uses the Twig
nl2br function to format the text for web browsers.
Fixesslawkens#176
The rules page uses a textarea to show lines break.
This commit replaces the textarea and uses the Twig
nl2br function to format the text for web browsers.
Fixes#176
Server configuration
main
)master
Client configuration (Your Computer)
Description:
The rules page renders the rules in a readonly
textarea
when you don't have permission to edit them, and in a single paragraph with no line breaks when you do have the permission to edit them.Steps To Reproduce:
Observe that the rules are shown in a small, read-only
textarea
- we can't read all of the horrific examples without scrolling:rules_on_the_page
item.Observe that we now have edit controls and a lack of line breaks:
My initial instinct was that the
textarea
in rules.html.twig was unnecessary.Changing the
env
inconfig.local.php
todev
so I could live-edit the Twig templates, I disabled thetextarea
:The formatting that is clearly visible in both the admin page and the textarea is being lost. Classic HTML not respecting line breaks 😀 The breaks are being written correctly into the page, but the browser won't render them unless they're
<br>
tags:The good news is that Twig has an nl2br formatting function that we can use to turn those newlines in
<br>
tags:I'll submit a PR in a couple of minutes 😀 I haven't got a fix for the formatting for
rules_on_the_page
as show in step 2, but this is only visible to admins so isn't that important. I'm not sure what code is writing the rules out there.The text was updated successfully, but these errors were encountered: