aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--NEWS3
-rw-r--r--config_default2
-rw-r--r--static/advisories.css12
-rw-r--r--tmpl/CVE.html6
-rw-r--r--tmpl/advisories.html6
-rw-r--r--tmpl/advisory.html17
-rw-r--r--tmpl/body_top.html5
-rw-r--r--tmpl/by_cve.html6
-rw-r--r--tmpl/by_rel.html6
-rw-r--r--tmpl/by_src.html6
-rw-r--r--tmpl/head.html3
-rw-r--r--tmpl/index.html29
13 files changed, 93 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 92043aa..34acbcd 100644
--- a/Makefile
+++ b/Makefile
@@ -4,22 +4,26 @@ PROJECTNAME=mga-advisories
BINFILES=mgaadv
CFGFILES=mga-advisories.conf
TMPLFILES=tmpl/*.html tmpl/*.txt tmpl/*.adv tmpl/*.rss
+STATICFILES=static/*
sysconfdir=/etc
bindir=/usr/bin
sharedir=/usr/share
projectdir=$(sharedir)/$(PROJECTNAME)
tmpldir=$(projectdir)/tmpl
+staticdir=$(projectdir)/static
perldir=/usr/lib/perl5/site_perl
all:
install:
install -d $(DESTDIR)$(projectdir) $(DESTDIR)$(tmpldir) \
- $(DESTDIR)$(bindir) $(DESTDIR)$(sysconfdir)
+ $(DESTDIR)$(bindir) $(DESTDIR)$(sysconfdir) \
+ $(DESTDIR)$(staticdir)
install -m 755 $(BINFILES) $(DESTDIR)$(bindir)
install -m 644 $(CFGFILES) $(DESTDIR)$(sysconfdir)
install -m 644 $(TMPLFILES) $(DESTDIR)$(tmpldir)
+ install -m 644 $(STATICFILES) $(DESTDIR)$(staticdir)
install -m 644 config_default $(DESTDIR)$(projectdir)/config
install -d $(DESTDIR)$(perldir)/MGA
install -m 644 lib/MGA/Advisories.pm $(DESTDIR)$(perldir)/MGA
diff --git a/NEWS b/NEWS
index f4645de..c81285d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+
+- add stylesheet and mageia navigation bar
+
Version 0.11
- fix next free id assignement
diff --git a/config_default b/config_default
index b746257..c3fb396 100644
--- a/config_default
+++ b/config_default
@@ -5,6 +5,8 @@ dump_url: http://advisories.mageia.org/advisories.yaml
advisories_dir: /var/lib/mga-advisories/advisories
status_dir: /var/lib/mga-advisories/status
tmpl_dir: /usr/share/mga-advisories/tmpl
+staticdir_url: //advisories.mageia.org/static
+links_protocol: //
output_format:
- txt
- html
diff --git a/static/advisories.css b/static/advisories.css
new file mode 100644
index 0000000..462a148
--- /dev/null
+++ b/static/advisories.css
@@ -0,0 +1,12 @@
+.content {
+ background: #fff;
+ padding: 1em 2em;
+ text-align: left;
+ float: left;
+ min-width: 60%;
+}
+
+.section {
+ padding-top: 1em;
+ padding-bottom: 1em;
+}
diff --git a/tmpl/CVE.html b/tmpl/CVE.html
index 10e599b..24e0f85 100644
--- a/tmpl/CVE.html
+++ b/tmpl/CVE.html
@@ -3,14 +3,18 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CVE list</title>
+ [%- INCLUDE head.html -%]
</head>
<body>
- <h1>CVE list</h1>
+ [%- INCLUDE body_top.html -%]
+ <h1 id='mgnavt'><a href="index.html">Advisories</a> » CVE list</h1>
+ <div class='content'>
<ul>
[% FOREACH CVE IN advdb.by_cve.keys.sort.reverse %]
<li><a href="[% basename.CVE(CVE) %].html">[% CVE %]</a></li>
[% END %]
</ul>
+ </div>
</body>
</html>
diff --git a/tmpl/advisories.html b/tmpl/advisories.html
index 5ff26f1..0b95ac2 100644
--- a/tmpl/advisories.html
+++ b/tmpl/advisories.html
@@ -4,10 +4,14 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mageia Advisories</title>
<link rel="alternate" type="application/rss+xml" title="RSS" href="[% config.site_url %]/advisories.rss" />
+ [%- INCLUDE head.html -%]
</head>
<body>
- <h1>Mageia Advisories <a href="advisories.rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></h1>
+ [%- INCLUDE body_top.html -%]
+ <h1 id='mgnavt'><a href="index.html">Advisories</a> » All <a href="advisories.rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></h1>
+ <div class="content">
[% INCLUDE advisories_table.html advlst = advdb.sorted %]
+ </div>
</body>
</html>
diff --git a/tmpl/advisory.html b/tmpl/advisory.html
index f0a6a52..dd49031 100644
--- a/tmpl/advisory.html
+++ b/tmpl/advisory.html
@@ -4,9 +4,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mageia Advisory: [% advisory %] - [% adv.subject %]</title>
+ [%- INCLUDE head.html -%]
</head>
<body>
- <h1>[% advisory %] - [% adv.subject %]</h1>
+ [%- INCLUDE body_top.html -%]
+ <h1 id='mgnavt'><a href="index.html">Advisories</a> » [% advisory %]</h1>
+
+ <div class='content'>
+ <div class='section'>
+ <h2>[% adv.subject %]</h2>
Publication date: [% date.format(adv.status.published, format => '%d %b %Y', gmt => 1) %]<br />
Type: [% adv.type %]<br />
@@ -28,12 +34,16 @@
<a href="[% basename.CVE(cve) %].html">[% cve %]</a>
[% END %]
[% END %]
+ </div>
+ <div class='section'>
<h2>Description</h2>
<pre>
[%- adv.description -%]
</pre>
+ </div>
+ <div class='section'>
<h2>References</h2>
<ul>
[% FOREACH ref IN adv.references -%]
@@ -45,7 +55,9 @@
[%- END -%]
[%- END -%]
</ul>
+ </div>
+ <div class='section'>
<h2>SRPMS</h2>
[% FOREACH rel IN adv.src.keys -%]
[% FOREACH media IN adv.src.$rel.keys -%]
@@ -57,6 +69,7 @@
</ul>
[% END -%]
[% END -%]
-
+ </div>
+ </div>
</body>
</html>
diff --git a/tmpl/body_top.html b/tmpl/body_top.html
new file mode 100644
index 0000000..a5081a4
--- /dev/null
+++ b/tmpl/body_top.html
@@ -0,0 +1,5 @@
+<header class='support' id='hmgn'></header>
+<script src="[% config.links_protocol %]static.mageia.org/g/js/jquery-1.10.1.min.js"></script>
+<script>
+ $("#hmgn").load("[% config.links_protocol %]nav.mageia.org/html/").delay(10).slideDown();
+</script>
diff --git a/tmpl/by_cve.html b/tmpl/by_cve.html
index bd4aedd..1102d9f 100644
--- a/tmpl/by_cve.html
+++ b/tmpl/by_cve.html
@@ -3,10 +3,14 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>[% CVE %]</title>
+ [%- INCLUDE head.html -%]
</head>
<body>
- <h1><a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=[% CVE %]">[% CVE %]</a></h1>
+ [%- INCLUDE body_top.html -%]
+ <h1 id='mgnavt'><a href="index.html">Advisories</a> » <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=[% CVE %]">[% CVE %]</a></h1>
+ <div class='content'>
[% INCLUDE advisories_table.html advlst = advdb.by_cve.$CVE %]
+ </div>
</body>
</html>
diff --git a/tmpl/by_rel.html b/tmpl/by_rel.html
index 883d9f6..7989f75 100644
--- a/tmpl/by_rel.html
+++ b/tmpl/by_rel.html
@@ -4,10 +4,14 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mageia [% rel %] Advisories</title>
<link rel="alternate" type="application/rss+xml" title="RSS" href="[% config.site_url %]/[% basename.rel(rel) %].rss" />
+ [%- INCLUDE head.html -%]
</head>
<body>
- <h1>Mageia [% rel %] Advisories <a href="[% basename.rel(rel) %].rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></h1>
+ [%- INCLUDE body_top.html -%]
+ <h1 id='mgnavt'><a href="index.html">Advisories</a> » Mageia [% rel %] <a href="[% basename.rel(rel) %].rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></h1>
+ <div class='content'>
[% INCLUDE advisories_table.html advlst = advdb.by_rel.$rel %]
+ </div>
</body>
</html>
diff --git a/tmpl/by_src.html b/tmpl/by_src.html
index 7456918..6426e8f 100644
--- a/tmpl/by_src.html
+++ b/tmpl/by_src.html
@@ -4,10 +4,14 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mageia advisories for package [% src %]</title>
<link rel="alternate" type="application/rss+xml" title="RSS" href="[% config.site_url %]/[% basename.src(src) %].rss" />
+ [%- INCLUDE head.html -%]
</head>
<body>
- <h1>Mageia advisories for package [% src %] <a href="[% basename.src(src) %].rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></h1>
+ [%- INCLUDE body_top.html -%]
+ <h1 id='mgnavt'><a href="index.html">Advisories</a> » Package [% src %] <a href="[% basename.src(src) %].rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></h1>
+ <div class='content'>
[% INCLUDE advisories_table.html advlst = advdb.by_src.$src %]
+ </div>
</body>
</html>
diff --git a/tmpl/head.html b/tmpl/head.html
new file mode 100644
index 0000000..aa4fd30
--- /dev/null
+++ b/tmpl/head.html
@@ -0,0 +1,3 @@
+<link rel="stylesheet" type="text/css" href="[% config.links_protocol %]static.mageia.org/g/style/all.css">
+<link rel="stylesheet" type="text/css" href="[% config.links_protocol %]nav.mageia.org/css/">
+<link rel="stylesheet" type="text/css" href="[% config.staticdir_url %]/advisories.css">
diff --git a/tmpl/index.html b/tmpl/index.html
index cf68929..91e20e6 100644
--- a/tmpl/index.html
+++ b/tmpl/index.html
@@ -3,32 +3,49 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mageia Advisories</title>
+ [%- INCLUDE head.html -%]
</head>
<body>
- <h1>Mageia Advisories</h1>
+ [%- INCLUDE body_top.html -%]
+ <h1 id='mgnavt'>Mageia Advisories</h1>
+ <div class="content">
+ <div class="section">
+ <h2>Advisories</h2>
<ul>
[% FOREACH rel IN advdb.by_rel.keys.sort -%]
<li><a href="[% basename.rel(rel) %].html">Mageia [% rel %] advisories</a> <a href="[% basename.rel(rel) %].rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></li>
[%- END -%]
<li><a href="advisories.html">All advisories</a> <a href="advisories.rss"><img src="http://static.mageia.org/g/images/smi/feed-16x16.png" alt="rss" /></a></li>
</ul>
+ </div>
- <h1>CVE list</h1>
+ <div class="section">
+ <h2>CVE list</h2>
A list of fixed CVE <a href="CVE.html">is available</a>.
+ </div>
- <h1>Command line tool</h1>
+ <div class="section">
+ <h2>Command line tool</h2>
A command line tool is available to list and display advisories.
<a href="https://wiki.mageia.org/en/Mgaadv#Command_line_tool">More details</a>.
+ </div>
- <h1>Older Advisories</h1>
+ <div class="section">
+ <h2>Older Advisories</h2>
Older advisories are available on <a href="https://wiki.mageia.org/en/Support/Advisories/">Mageia wiki</a>.
+ </div>
- <h1>DB Dump</h1>
+ <div class="section">
+ <h2>DB Dump</h2>
A dump of all advisories is available as <a href="advisories.yaml">a yaml file</a>.
+ </div>
- <h1>Source code</h1>
+ <div class="section">
+ <h2>Source code</h2>
Source code for the tool used to generate this website is
<a href="http://svnweb.mageia.org/soft/mga-advisories/trunk/">available on svn</a>.
Patches or ideas can be posted on the <a href="https://ml.mageia.org/l/info/sysadmin-discuss">sysadmin-discuss</a> mailing list.
+ </div>
+ </div>
</body>
</html>