Documentation - Refactor promotion banner without jQuery (#11554)

- Use HTML template in layout for content
- Use non-jQuery JS
- Ensure that the cookie has the sameSite value set correctly
- Set closed cookie duration to 90 days (instead of 30)
- Add upcoming Wagtail Space events 2024 & adjust styles to suit two links
pull/11754/head
LB Johnston 2024-01-31 07:38:42 +10:00
rodzic 8f6bdb1f12
commit a661e143d9
6 zmienionych plików z 120 dodań i 50 usunięć

Wyświetl plik

@ -152,7 +152,6 @@ module.exports = {
// Files that use jquery via a global
{
files: [
'docs/_static/**',
'wagtail/contrib/search_promotions/static_src/wagtailsearchpromotions/js/query-chooser-modal.js',
'wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/includes/searchpromotions_formset.js',
'wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/queries/chooser_field.js',

Wyświetl plik

@ -108,6 +108,7 @@ Changelog
* Docs: Update spelling on customizing admin template and page model section from British to American English (Victoria Poromon)
* Docs: Add documentation for how to override the file locations for custom image models via `get_upload_to` methods (Osaf AliSayed, Dharmik Gangani)
* Docs: Update documentation theme (Sphinx Wagtail Theme) to 6.2.0, fixing the incorrect favicon (LB (Ben) Johnston, Sahil Jangra)
* Docs: Refactor promotion banner without jQuery and use sameSite cookies when storing if cleared (LB (Ben) Johnston)
* Maintenance: Update BeautifulSoup upper bound to 4.12.x (scott-8)
* Maintenance: Migrate initialization of classes (such as `body.ready`) from multiple JavaScript implementations to one Stimulus controller `w-init` (Chiemezuo Akujobi)
* Maintenance: Adopt the usage of translate string literals using `arg=_('...')` in all `wagtailadmin` module templates (Chiemezuo Akujobi)

Wyświetl plik

@ -23,8 +23,9 @@ body.body--autocomplete-open .sidebar-container .collapse {
z-index: 1021;
}
/* Wagtail Space */
.wagtailspace {
/* Promotion banner */
.promotion-banner {
background: #00676a;
color: white;
border-radius: 6px;
@ -32,36 +33,43 @@ body.body--autocomplete-open .sidebar-container .collapse {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 1rem;
position: relative;
}
.wagtailspace svg {
margin-right: 1em;
width: 56px;
.promotion-banner svg {
position: absolute;
width: 3.5rem;
top: -0.5rem;
left: 0;
}
.wagtailspace a {
.promotion-banner a {
display: flex;
color: inherit;
padding: 15px;
padding: 1rem;
text-align: left;
flex-grow: 2;
flex: 1 1 50%;
border: 0;
text-decoration: none;
}
.wagtailspace strong {
.promotion-banner strong {
font-size: 1.25em;
}
.wagtailspace .wagtailspace-close {
.promotion-banner .close {
padding: 10px;
width: 56px;
width: 3.5rem;
cursor: pointer;
font-weight: bold;
font-size: 1.5em;
color: inherit;
border: 0;
background: none;
position: absolute;
top: 0;
right: 0;
}
@keyframes bounce {
@ -75,7 +83,7 @@ body.body--autocomplete-open .sidebar-container .collapse {
}
}
.wagtailspace a:hover svg {
.promotion-banner:hover svg {
animation-duration: 0.5s;
animation-fill-mode: both;
animation-timing-function: linear;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -148,6 +148,7 @@ This feature was implemented by Nick Lee, Thibaud Colas, and Sage Abdullah.
* Update spelling on customizing admin template and page model section from British to American English (Victoria Poromon)
* Add documentation for how to override the file locations for custom image models [](custom_image_model_upload_location) (Osaf AliSayed, Dharmik Gangani)
* Update documentation theme (Sphinx Wagtail Theme) to 6.2.0, fixing the incorrect favicon (LB (Ben) Johnston, Sahil Jangra)
* Refactor promotion banner without jQuery and use sameSite cookies when storing if cleared (LB (Ben) Johnston)
### Maintenance