-
-
Notifications
You must be signed in to change notification settings - Fork 3
Display Modules Position Badge Background Color based on the Active Template Positions #3
base: dev
Are you sure you want to change the base?
Display Modules Position Badge Background Color based on the Active Template Positions #3
Conversation
PR is ready for review. |
The newest commit adds the tooltip for more accessibility. Thanks for the suggestion @chmst |
https://docs.google.com/document/d/1Pl8JGa2hkYkmJzQOn9_mS8a4imDmqc2a/edit?disco=AAAAM787hHY
Positions are coloured as red if they are invalid: |
https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-without-color.html |
If I understood this correctly, the article advocates the need of a supplementary text indication along with the color based indication of a message (invalid position in this case). I hope this suffices the success criterion |
Pull Request for Issue #2
Summary of Changes
Added a new model
getValidPositions
that performs the following:templateDetails.xml
file corresponding to the template received as a result of Step 1The array returned from the above model method will be used in the
_getList
function as:getValidPositions
method in an arrayIf
yes
, set$row->activePosition
totrue
If
no
, set$row->activePosition
tofalse
Finally, in the
tmpl
file, we use thisactivePosition
flag to conditionally select betweenbg-primary
andbg-secondary
Extra:

Added a few missing template positions to the XML file:
For example, Atum's cpanel-system:
Testing Instructions
Visit the database and change the value of one of the module's positions to a random string.
Note: Positions for multi-lingual website could be an edge case but I am unable to set up a multi-lingual site on my local workstation so I'm unable to confirm this
Actual result BEFORE applying this Pull Request
All badges have the same
bg-primary
classExpected result AFTER applying this Pull Request
Badges for In-active (not of the active template) Positions have a
bg-secondary
classDocumentation Changes Required
I don't know