-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1186 from Metro-Records/hcg/wagtail
* Transition alerts to Wagtail * Remove custom alert handling * Clean up custom Wagtail JavaScript * Update styles * Remove unused dep * flake8 * Fix flake8 pre-commit config * Use rich text instead of markdown for alerts * Add missing migration * Update label style for light/dark mode, eliminate unneeded loop * Add default border for empty alert select
- Loading branch information
Showing
19 changed files
with
221 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 3.2.25 on 2024-12-04 19:18 | ||
|
||
from django.db import migrations | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("lametro", "0016_alter_aboutpage_body"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="alert", | ||
name="description", | ||
field=wagtail.fields.RichTextField(default="No content"), | ||
preserve_default=False, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -814,3 +814,7 @@ caption { | |
.scroll-anchor { | ||
scroll-margin-top: 80px; | ||
} | ||
|
||
.alert p:last-of-type { | ||
margin: unset; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[class*="alert"] { | ||
--font-color: #fff; | ||
--a: 0.6; | ||
background-color: rgba(var(--r), var(--g), var(--b), var(--a)); | ||
color: var(--font-color); | ||
border: 1px solid rgba(var(--r), var(--g), var(--b), 1)!important; | ||
} | ||
|
||
.button[class*="alert"]:hover { | ||
background-color: rgba(var(--r), var(--g), var(--b), var(--a)); | ||
color: var(--font-color); | ||
} | ||
|
||
/* Add default border to empty alert select */ | ||
.alert- { | ||
border: 1px solid var(--w-color-border-field-default)!important; | ||
} | ||
|
||
.alert-primary { | ||
--r: 235; | ||
--g: 104; | ||
--b: 100; | ||
} | ||
|
||
.alert-secondary { | ||
--r: 170; | ||
--g: 170; | ||
--b: 170; | ||
} | ||
|
||
.alert-success { | ||
--r: 34; | ||
--g: 178; | ||
--b: 76; | ||
} | ||
|
||
.alert-danger { | ||
--r: 51; | ||
--g: 153; | ||
--b: 153; | ||
} | ||
|
||
.alert-warning { | ||
--font-color: #000; | ||
--r: 245; | ||
--g: 230; | ||
--b: 37; | ||
} | ||
|
||
.alert-info { | ||
--r: 245; | ||
--g: 122; | ||
--b: 0; | ||
} | ||
|
||
.list-display-wrapper { | ||
font-weight: normal!important; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
ALERT_COLORS = { | ||
"primary": "#eb6864", | ||
"secondary": "#aaa", | ||
"success": "#22b24c", | ||
"danger": "#369", | ||
"warning": "#f5e625", | ||
"info": "#f57a00", | ||
} | ||
|
||
function styleParent(e) { | ||
if (e.target.classList.length > 0) { | ||
e.target.classList = "" | ||
} | ||
e.target.classList.add(`alert-${e.target.value}`); | ||
} | ||
|
||
// Callback function to execute when mutations are observed | ||
const styleAlertTypeSelect = (mutationList, observer) => { | ||
mutationList.map(mu => { | ||
mu.addedNodes && mu.addedNodes.forEach(node => { | ||
if (node.id === "id_type") { | ||
styleParent({target: node}) | ||
node.addEventListener("change", styleParent) | ||
observer.disconnect() | ||
return | ||
} | ||
}) | ||
}) | ||
}; | ||
|
||
// Create an observer instance linked to the callback function | ||
const observer = new MutationObserver(styleAlertTypeSelect); | ||
|
||
const config = {childList: true, subtree: true}; | ||
|
||
// Start observing the target node for configured mutations | ||
observer.observe(document.body, config); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.