Display a status icon on the Network status menu entry

This commit is contained in:
Saivann 2014-10-28 00:14:51 -04:00
parent b7ef7f6bf4
commit 50203f5cc4
9 changed files with 22 additions and 3 deletions

View File

@ -94,7 +94,7 @@
</div>
<div class="footer">
<div class="footermenu">
<a href="/en/alerts">Network Status</a>
<a href="/en/alerts" class="statusmenu{% if site.STATUS == 1 %} alert{% endif %}">Network Status</a>
{% case page.lang %}
{% when 'fa' or 'pl' or 'tr' or 'zh_TW' %}
<a href="/en/legal">Legal</a>

View File

@ -48,6 +48,11 @@ p{
margin-right:0;
margin-left:15px;
}
.statusmenu{
padding-left:0;
padding-right:20px;
background-position:right center;
}
.titleicon{
margin-right:auto;
margin-left:5px;

View File

@ -405,6 +405,17 @@ table td,table th{
white-space:nowrap;
}
.statusmenu{
display:inline-block;
padding-left:20px;
background-position:left center;
background-repeat:no-repeat;
background-image:url(/img/netstatus_normal.svg);
}
.statusmenu.alert{
background-image:url(/img/netstatus_alert.svg);
}
/*Styles specific to elements in pages*/
.mainsummary,

View File

@ -35,6 +35,9 @@ module Jekyll
if self.data.has_key?('banner') and !self.data['banner'].nil? and self.data['banner'].length>0
site.config['ALERT']='<a href="/'+dstdir+'/'+dst.gsub('.html','')+'">'+self.data['banner']+'</a>'
end
if self.data.has_key?('active') and !self.data['active'].nil? and self.data['active'] == true
site.config['STATUS']=1
end
if self.data.has_key?('alias')
site.pages << AlertPage.new(site, base, lang, srcdir, src, '', self.data['alias']+'.html', date)
site.pages << AlertPage.new(site, base, lang, srcdir, src, '', self.data['alias']+'/index.html', date)
@ -46,6 +49,7 @@ module Jekyll
class AlertPageGenerator < Generator
def generate(site)
#generate each alert based on templates
site.config['STATUS'] = 0
Dir.foreach('_alerts') do |file|
next if file == '.' or file == '..'
lang = 'en'

View File

@ -7,8 +7,7 @@ title: Network status and alerts - Bitcoin
<link rel="alternate" type="application/rss+xml" href="/en/rss/alerts.rss" title="Bitcoin network status and alerts">
<div class="alerttext">
<h1>Network status and alerts<a type="application/rss+xml" href="/en/rss/alerts.rss"><img src="/img/icon_rss.svg" alt="rss" class="rssicon"></a></h1>
{% assign active = false %}{% filter_for p in site.pages reversed sort_by:date category:alert %}{% if p.active == true %}{% assign active = true %}{% endif %}{% endfilter_for %}
{% if active == false %}
{% if site.STATUS == 0 %}
<div class="alertstatusinactive">There is no ongoing event on the Bitcoin network.</div>
{% else %}
<div class="alertstatusactive"">The following network event is ongoing.</div>

BIN
img/netstatus_alert.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

BIN
img/netstatus_alert.svg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
img/netstatus_normal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

BIN
img/netstatus_normal.svg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB