Support status.openstack.org header/footer
Add a openstack_status magic parameter in config.js which toggles the use of openstack-specific CSS and JS files to better integrate in status.openstack.org.
This commit is contained in:
parent
0a2dfc1032
commit
a878b43380
|
@ -29,7 +29,8 @@ def create_files(templatepath, outputpath, projects):
|
||||||
indexfile = os.path.join(outputpath, "index.html")
|
indexfile = os.path.join(outputpath, "index.html")
|
||||||
if not os.path.exists(indexfile):
|
if not os.path.exists(indexfile):
|
||||||
template = env.get_template('index.html')
|
template = env.get_template('index.html')
|
||||||
template.stream(projects=projects).dump(indexfile)
|
template.stream(projects=projects,
|
||||||
|
openstack_status=openstack_status).dump(indexfile)
|
||||||
|
|
||||||
# Create each project file
|
# Create each project file
|
||||||
for project in projects:
|
for project in projects:
|
||||||
|
@ -57,7 +58,6 @@ def update_stats(outputpath, project_name, rotation):
|
||||||
for record in json_data['records']:
|
for record in json_data['records']:
|
||||||
if rotation:
|
if rotation:
|
||||||
if (now - record['date']) > (rotation * 24 * 60 * 60):
|
if (now - record['date']) > (rotation * 24 * 60 * 60):
|
||||||
print "skip"
|
|
||||||
continue
|
continue
|
||||||
records.append(record)
|
records.append(record)
|
||||||
except IOError:
|
except IOError:
|
||||||
|
@ -162,6 +162,7 @@ if __name__ == '__main__':
|
||||||
config = json.load(configfile)
|
config = json.load(configfile)
|
||||||
projects = config['projects']
|
projects = config['projects']
|
||||||
rotation = config.get('rotation')
|
rotation = config.get('rotation')
|
||||||
|
openstack_status = config.get('openstack_status')
|
||||||
|
|
||||||
# Create files in output directory, if needed
|
# Create files in output directory, if needed
|
||||||
create_files(templatepath, outputpath, projects)
|
create_files(templatepath, outputpath, projects)
|
||||||
|
|
|
@ -1,5 +1,20 @@
|
||||||
<HTML>
|
<HTML>
|
||||||
<TITLE>Bugsquashing day stats</TITLE>
|
<TITLE>Bugsquashing day stats</TITLE>
|
||||||
|
{% if openstack_status %}
|
||||||
|
<link rel="stylesheet"
|
||||||
|
href="http://www.openstack.org/themes/openstack/css/blueprint/screen.css"
|
||||||
|
type="text/css" media="screen, projection"/>
|
||||||
|
<link rel="stylesheet"
|
||||||
|
href="http://www.openstack.org/themes/openstack/css/blueprint/print.css"
|
||||||
|
type="text/css" media="print"/>
|
||||||
|
<link href='http://fonts.googleapis.com/css?family=PT+Sans&subset=latin'
|
||||||
|
rel='stylesheet' type='text/css'/>
|
||||||
|
<link rel="stylesheet" type="text/css"
|
||||||
|
href="http://www.openstack.org/themes/openstack/css/main.css" />
|
||||||
|
<script type="text/javascript"
|
||||||
|
src="http://status.openstack.org/common.js"></script>
|
||||||
|
<script type="text/javascript">header('Bugday');</script>
|
||||||
|
{% endif %}
|
||||||
<h1>Bugsquashing day stats</h1>
|
<h1>Bugsquashing day stats</h1>
|
||||||
<TABLE BORDER=0>
|
<TABLE BORDER=0>
|
||||||
{% for project in projects %}
|
{% for project in projects %}
|
||||||
|
@ -15,4 +30,7 @@
|
||||||
</IFRAME></TD></TR>
|
</IFRAME></TD></TR>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</TABLE>
|
</TABLE>
|
||||||
|
{% if openstack_status %}
|
||||||
|
<script type="text/javascript">footer();</script>
|
||||||
|
{% endif %}
|
||||||
</HTML>
|
</HTML>
|
||||||
|
|
Loading…
Reference in New Issue