From b520e530479e52697b8d0b1a194f5df28ed3a426 Mon Sep 17 00:00:00 2001 From: Saivann Date: Sun, 14 Jul 2013 01:04:26 -0400 Subject: [PATCH] Handle alert banners in alerts.rb --- README.md | 23 ++------------ _alerts/2012-02-18-protocol-change.html | 1 + .../2012-03-16-critical-vulnerability.html | 1 + _alerts/2012-05-14-dos.html | 1 + _alerts/2013-03-11-chain-fork.html | 1 + _alerts/2013-03-15-upgrade-deadline.html | 1 + _config.yml | 30 ------------------- _layouts/base.html | 8 ++--- _less/screen.less | 16 ++-------- _plugins/alerts.rb | 3 ++ css/ie.css | 7 +++++ 11 files changed, 24 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 2d2104d8..b8a9a655 100644 --- a/README.md +++ b/README.md @@ -70,26 +70,7 @@ Any change in the english texts can be done through a pull request on github. If ## Advanced Usage -### Alert banner - -You can put an alert banner on the website by changing the ALERT and ALERT\_CLASS variables in _config.yml. -You can both set one fallback alert for all languages and many translated alerts for specific languages. - -Example: - -``` -ALERT: - all: Security alert: Please upgrade to 0.8.1 as soon as possible! - fr: Alerte de sécurité: Mettez Bitcoin à jour vers la version 0.8.1 sans délais! -ALERT_CLASS: - all: error - fr: error -``` - -This will produce an english red alert box for all languages, and a translated red alert box for french language. -Possible classes are: **error** (red), **info** (blue), **success** (green) and **warning** (yellow) - -### Network alerts +### Alerts Network alerts should be placed in `_alerts/YYYY-MM-DD-SHORTITLE.html` and adhere to this format: @@ -99,6 +80,7 @@ title: "11/12 March 2013 Chain Fork" lastmod: "Fri Mar 16 22:58:00 UTC 2012" alias: "chainfork" active: true +banner: "Chain fork - Please stop mining on bitcoin version 0.8.0. Click here for more information." ---

@@ -114,6 +96,7 @@ More information will follow. * `lastmod: ...` will be used as the last modification date in the layout. * `alias: ...` (optional) a short alias to be used for Bitcoin-Qt alerts. Ex. "dos" will produce /dos.html * `active: ...` (true or false) define if the alert should appear as ongoing in the network status page. +* `banner: ...` (optional) a short text that will be displayed in a red alert banner and link to the alert page. ### Release Notes diff --git a/_alerts/2012-02-18-protocol-change.html b/_alerts/2012-02-18-protocol-change.html index 7e6a8a0a..7a6ae243 100644 --- a/_alerts/2012-02-18-protocol-change.html +++ b/_alerts/2012-02-18-protocol-change.html @@ -3,6 +3,7 @@ title: "February 20, 2012 Protocol Changes" lastmod: "Mon Feb 20 00:10:00 UTC 2012" alias: "feb20" active: false +banner: "" ---

In June 2010 the Bitcoin reference software version 0.2.10 introduced diff --git a/_alerts/2012-03-16-critical-vulnerability.html b/_alerts/2012-03-16-critical-vulnerability.html index 80a6d57e..994dcbdc 100644 --- a/_alerts/2012-03-16-critical-vulnerability.html +++ b/_alerts/2012-03-16-critical-vulnerability.html @@ -3,6 +3,7 @@ title: "Potentially Critical Security Vulnerability" lastmod: "Fri Mar 16 22:58:00 UTC 2012" alias: "critfix" active: false +banner: "" ---

A potential security vulnerability has been discovered in the Windows diff --git a/_alerts/2012-05-14-dos.html b/_alerts/2012-05-14-dos.html index 019140ac..f69e77d3 100644 --- a/_alerts/2012-05-14-dos.html +++ b/_alerts/2012-05-14-dos.html @@ -3,6 +3,7 @@ title: "CVE-2012-2459: Critical Vulnerability (denial-of-service)" lastmod: "Mon May 14 17:00:00 UTC 2012" alias: "dos" active: false +banner: "" ---

Risks

diff --git a/_alerts/2013-03-11-chain-fork.html b/_alerts/2013-03-11-chain-fork.html index d79889fc..f4428a29 100644 --- a/_alerts/2013-03-11-chain-fork.html +++ b/_alerts/2013-03-11-chain-fork.html @@ -3,6 +3,7 @@ title: "11/12 March 2013 Chain Fork Information" lastmod: "16 May 2013 01:37 UTC" alias: "chainfork" active: false +banner: "" ---

What happened

diff --git a/_alerts/2013-03-15-upgrade-deadline.html b/_alerts/2013-03-15-upgrade-deadline.html index 60fe5ae5..691cd465 100644 --- a/_alerts/2013-03-15-upgrade-deadline.html +++ b/_alerts/2013-03-15-upgrade-deadline.html @@ -3,6 +3,7 @@ title: "15 May 2013 Upgrade Deadline" lastmod: "10 May 2013 21:30 UTC" alias: "may15" active: false +banner: "" ---

What is happening

diff --git a/_config.yml b/_config.yml index 3f42ffd6..f21d5362 100644 --- a/_config.yml +++ b/_config.yml @@ -1,35 +1,5 @@ DOWNLOAD_VERSION: 0.8.3 -ALERT_CLASS: - all: - ar: - de: - en: - es: - fa: - fr: - it: - nl: - pl: - ru: - tr: - zh_TW: - -ALERT: - all: - ar: - de: - en: - es: - fa: - fr: - it: - nl: - pl: - ru: - tr: - zh_TW: - langsorder: - id: de - id: en diff --git a/_layouts/base.html b/_layouts/base.html index 640f1bcd..b0883997 100644 --- a/_layouts/base.html +++ b/_layouts/base.html @@ -28,11 +28,9 @@ menu: -{% if site.ALERT.all or site.ALERT[page.lang] %} - {% if site.ALERT_CLASS.all %}{% assign class = site.ALERT_CLASS.all%}{% endif %}{% if site.ALERT_CLASS[page.lang] %}{% assign class = site.ALERT_CLASS[page.lang]%}{% endif %} - {% if site.ALERT.all %}{% assign alert = site.ALERT.all%}{% endif %}{% if site.ALERT[page.lang] %}{% assign alert = site.ALERT[page.lang] %}{% endif %} -

-
{{ alert }}
+{% if site.ALERT %} +
+
{{ site.ALERT }}
{% endif %}