Merge branch 'alertclass'

This commit is contained in:
Saivann 2015-07-06 11:05:38 -04:00
commit 6dfe019256
No known key found for this signature in database
GPG key ID: 5780F5D31B5577B0
5 changed files with 18 additions and 3 deletions

View file

@ -560,7 +560,8 @@ More information will follow.
* `title: ...` will be used as the title in the layout.
* `alias: ...` (optional) a short alias for Bitcoin Core 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.
* `banner: ...` (optional) a short text that will be displayed in an alert banner and link to the alert page.
* `bannerclass: ...` (optional) a CSS class that sets the color of the banner. Possible values: alert (default red), warning (orange), success (green), info (blue).
* `last updated: ...` should be kept up to date and be in RFC 2822 format ( date -uR ).
## Wallets

View file

@ -3,6 +3,7 @@ title: "Some Miners Generating Invalid Blocks"
alias: "spv-mining"
active: true
banner: "WARNING: many wallets currently vulnerable to double-spending of confirmed transactions (click here to read)"
bannerclass: "alert"
---
{% capture markdown %}
<p><em>This document is being updated as new information arrives. Last

View file

@ -23,7 +23,7 @@
<body>
<div id="detectmobile" class="detectmobile"></div>
{% if site.ALERT %}
<div class="banner-message alert">
<div class="banner-message {{ site.ALERTCLASS }}">
<a href="{{ site.ALERTURL }}"><span>{{ site.ALERT }}</span></a>
</div>
{% endif %}

View file

@ -153,9 +153,18 @@ table td,table th{
.banner-message a:hover{
text-decoration:underline;
}
.banner-message a{
background-color:#c5251f;
}
.banner-message.alert a{
background-color:#c5251f;
}
.banner-message.warning a{
background-color:#E58716;
}
.banner-message.success a{
background-color:#329239;
}
.banner-message.info a{
background-color:#0d579b;
}

View file

@ -39,6 +39,9 @@ module Jekyll
if self.data.has_key?('banner') and !self.data['banner'].nil? and self.data['banner'].length>0
site.config['ALERT']=self.data['banner']
site.config['ALERTURL']='/'+dstdir+'/'+dst.gsub('.html','')
if self.data.has_key?('bannerclass') and !self.data['bannerclass'].nil? and self.data['bannerclass'].length>0
site.config['ALERTCLASS'] = self.data['bannerclass']
end
end
if self.data.has_key?('active') and !self.data['active'].nil? and self.data['active'] == true
site.config['STATUS'] = 1
@ -55,6 +58,7 @@ module Jekyll
def generate(site)
#Generate each alert based on templates
site.config['STATUS'] = 0
site.config['ALERTCLASS'] = 'alert'
#Do nothing if plugin is disabled
if !ENV['ENABLED_PLUGINS'].nil? and ENV['ENABLED_PLUGINS'].index('alerts').nil?
print 'Alerts disabled' + "\n"