Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web, banner: Add dynamic messages for mobile version #369

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
317 changes: 97 additions & 220 deletions static/messages.json
Original file line number Diff line number Diff line change
@@ -1,222 +1,99 @@
[
{
"desktop": {
"title": "Buildroot system development training",
"body": "Jan 13-15, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/106"
},
"mobile": {
"title": "Buildroot system development training",
"body": "Jan 13-15, 2025",
"link": "https://shop.bootlin.com/en/event/106"
}
},
{
"desktop": {
"title": "Embedded Linux training",
"body": "Mar 31-Apr 8, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/122"
},
"mobile": {
"title": "Embedded Linux training",
"body": "Mar 31-Apr 8, 2025",
"link": "https://shop.bootlin.com/en/event/122"
}
},
{
"desktop": {
"title": "Embedded Linux training",
"body": "Mar 10-20, 2025, special US time zones",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/114"
},
"mobile": {
"title": "Embedded Linux training",
"body": "Mar 10-20, 2025, special US time zones",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/114"
}
},
{
"desktop": {
"title": "Linux kernel drivers training",
"body": "May 6-19, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/123"
},
"mobile": {
"title": "Linux kernel drivers training",
"body": "May 6-19, 2025",
"link": "https://shop.bootlin.com/en/event/123"
}
},
{
"desktop": {
"title": "Linux kernel drivers training",
"body": "Mar 31-Apr 9, 2025, special US time zones",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/118"
},
"mobile": {
"title": "Linux kernel drivers training",
"body": "Mar 31-Apr 9, 2025, special US time zones",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/118"
}
},
{
"desktop": {
"title": "Yocto / OpenEmbedded training",
"body": "Jan 20-23, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/121"
},
"mobile": {
"title": "Yocto / OpenEmbedded training",
"body": "Jan 20-23, 2025",
"link": "https://shop.bootlin.com/en/event/121"
}
},
{
"desktop": {
"title": "Yocto / OpenEmbedded training",
"body": "Feb 10-13, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/125"
},
"mobile": {
"title": "Yocto / OpenEmbedded training",
"body": "Feb 10-13, 2025",
"link": "https://shop.bootlin.com/en/event/125"
}
},
{
"desktop": {
"title": "Yocto / OpenEmbedded training",
"body": "Mar 24-27, 2025, special US time zones",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/116"
},
"mobile": {
"title": "Yocto / OpenEmbedded training",
"body": "Mar 24-27, 2025, special US time zones",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/116"
}
},
{
"desktop": {
"title": "Audio with Embedded Linux training",
"body": "Jan 13-17, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/105"
},
"mobile": {
"title": "Audio with Embedded Linux training",
"body": "Jan 13-17, 2025",
"link": "https://shop.bootlin.com/en/event/105"
}
},
{
"desktop": {
"title": "Real-Time Linux with PREEMPT_RT training",
"body": "Feb 18-20, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/104"
},
"mobile": {
"title": "Real-Time Linux with PREEMPT_RT training",
"body": "Feb 18-20, 2025",
"link": "https://shop.bootlin.com/en/event/104"
}
},
{
"desktop": {
"title": "Linux debugging, profiling, tracing and performance analysis training",
"body": "Apr 14-17, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/124"
},
"mobile": {
"title": "Linux debugging, profiling, tracing and performance analysis training",
"body": "Apr 14-17, 2025",
"link": "https://shop.bootlin.com/en/event/124"
}
},
{
"desktop": {
"title": "Linux debugging, profiling, tracing and performance analysis training",
"body": "Mar 24-27, 2025, special US time zones",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/117"
},
"mobile": {
"title": "Linux debugging, profiling, tracing and performance analysis training",
"body": "Mar 24-27, 2025, special US time zones",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/117"
}
},
{
"desktop": {
"title": "Linux BSP development engineering services",
"body": "Need help to port Linux and bootloaders to your hardware?",
"link": "https://bootlin.com/engineering/linux-board-support-package/"
},
"mobile": {
"title": "Linux BSP development engineering services",
"body": "Need help to port Linux and bootloaders to your hardware?",
"link": "https://bootlin.com/engineering/linux-board-support-package/"
}
},
{
"desktop": {
"title": "Open-source upstreaming",
"body": "Need help get the support for your hardware in upstream Linux?",
"link": "https://bootlin.com/engineering/upstreaming/"
},
"mobile": {
"title": "Open-source upstreaming",
"body": "Need help get the support for your hardware in upstream Linux?",
"link": "https://bootlin.com/engineering/upstreaming/"
}
},
{
"desktop": {
"title": "Linux BSP upgrade and security maintenance",
"body": "Need help to get security updates for your Linux BSP?",
"link": "https://bootlin.com/engineering/linux-board-support-package/"
},
"mobile": {
"title": "Linux BSP upgrade and security maintenance",
"body": "Need help to get security updates for your Linux BSP?",
"link": "https://bootlin.com/engineering/linux-board-support-package/"
}
},
{
"desktop": {
"title": "Yocto distribution development and maintenance",
"body": "Need a Yocto distribution for your embedded project?",
"link": "https://bootlin.com/engineering/linux-board-support-package/"
},
"mobile": {
"title": "Yocto distribution development and maintenance",
"body": "Need a Yocto distribution for your embedded project?",
"link": "https://bootlin.com/engineering/linux-board-support-package/"
}
},
{
"desktop": {
"title": "Buildroot integration, development and maintenance",
"body": "Need a Buildroot system for your embedded project?",
"link": "https://bootlin.com/engineering/linux-board-support-package/"
},
"mobile": {
"title": "Buildroot integration, development and maintenance",
"body": "Need a Buildroot system for your embedded project?",
"link": "https://bootlin.com/engineering/linux-board-support-package/"
}
}
{
"title": "Buildroot system development training",
"body": "Jan 13-15, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/106"
},
{
"title": "Embedded Linux training",
"body": "Mar 31-Apr 8, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/122"
},
{
"title": "Embedded Linux training",
"body": "Mar 10-20, 2025, special US time zones",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/114"
},
{
"title": "Linux kernel drivers training",
"body": "May 6-19, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/123"
},
{
"title": "Linux kernel drivers training",
"body": "Mar 31-Apr 9, 2025, special US time zones",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/118"
},
{
"title": "Yocto / OpenEmbedded training",
"body": "Jan 20-23, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/121"
},
{
"title": "Yocto / OpenEmbedded training",
"body": "Feb 10-13, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/125"
},
{
"title": "Yocto / OpenEmbedded training",
"body": "Mar 24-27, 2025, special US time zones",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/116"
},
{
"title": "Audio with Embedded Linux training",
"body": "Jan 13-17, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/105"
},
{
"title": "Real-Time Linux with PREEMPT_RT training",
"body": "Feb 18-20, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/104"
},
{
"title": "Linux debugging, profiling, tracing and performance analysis training",
"body": "Apr 14-17, 2025",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/124"
},
{
"title": "Linux debugging, profiling, tracing and performance analysis training",
"body": "Mar 24-27, 2025, special US time zones",
"action": "Register",
"link": "https://shop.bootlin.com/en/event/117"
},
{
"title": "Linux BSP development engineering services",
"body": "Need help to port Linux and bootloaders to your hardware?",
"link": "https://bootlin.com/engineering/linux-board-support-package/"
},
{
"title": "Open-source upstreaming",
"body": "Need help get the support for your hardware in upstream Linux?",
"link": "https://bootlin.com/engineering/upstreaming/"
},
{
"title": "Linux BSP upgrade and security maintenance",
"body": "Need help to get security updates for your Linux BSP?",
"link": "https://bootlin.com/engineering/linux-board-support-package/"
},
{
"title": "Yocto distribution development and maintenance",
"body": "Need a Yocto distribution for your embedded project?",
"link": "https://bootlin.com/engineering/linux-board-support-package/"
},
{
"title": "Buildroot integration, development and maintenance",
"body": "Need a Buildroot system for your embedded project?",
"link": "https://bootlin.com/engineering/linux-board-support-package/"
}
]
9 changes: 7 additions & 2 deletions static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,15 @@ function updateMessageBanner() {
fetch('/static/messages.json')
.then(r => r.json())
.then(messages => {
const msg = randomChoice(messages);
// TODO compatibility with old messages format, remove after ~march 2025
const pickedMsg = randomChoice(messages);
const msg = pickedMsg.desktop ? pickedMsg.desktop : pickedMsg;

const desktopBanner = document.querySelector('.message-banner-desktop');
addBannerContents(desktopBanner, msg.desktop);
addBannerContents(desktopBanner, msg);

const mobileBanner = document.querySelector('.message-banner-mobile');
addBannerContents(mobileBanner, msg);
});
}

Expand Down
Loading