coverpage: Update the coverpage to have the table collapse.

Add each doc's conf.py as a dependence to catalogue.xml.
This commit is contained in:
Chris Johns
2017-01-12 12:55:15 +11:00
parent 876035b7bd
commit 049097fc80
14 changed files with 51 additions and 20 deletions

View File

@@ -9,9 +9,9 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="static/css/bootstrap.min.css" />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script type="text/javascript" src="static/js/jquery.min.js"></script> <script type="text/javascript" src="static/js/jquery.min.js"></script>
<link rel="stylesheet" href="static/css/bootstrap.min.css" media="screen"/>
<script type="text/javascript" src="static/js/bootstrap.min.js"></script> <script type="text/javascript" src="static/js/bootstrap.min.js"></script>
<!-- Le HTML5 shim, for IE6-8 support of HTML elements --> <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]> <!--[if lt IE 9]>
@@ -47,11 +47,7 @@
</div> </div>
</div> </div>
<div id="rtems-catalogue-title"></div> <div id="rtems-catalogue-title"></div>
<div class="table-responsive"> <div id="rtems-catalogue"><h3> No catalogue found. </h3></div>
<div id="rtems-catalogue">
<h3> No catalogue found. </h3>
</div>
</div>
</div> </div>
<!-- Load the catalogues and generate the content --> <!-- Load the catalogues and generate the content -->
<script type="text/javascript" src="static/rtems/js/catalogue.js"></script> <script type="text/javascript" src="static/rtems/js/catalogue.js"></script>

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 979 B

After

Width:  |  Height:  |  Size: 979 B

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -1,3 +1,8 @@
@font-face {
font-family: "Glyphicons Halflings";
src: url("../../fonts/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"), url("../../fonts/glyphicons-halflings-regular.woff") format("woff"), url("../../fonts/glyphicons-halflings-regular.ttf") format("truetype"), url("../../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular") format("svg");
}
header { header {
background: #38532f; background: #38532f;
} }

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -19,14 +19,35 @@ function parseCatalogue(xml) {
return xmlDoc; return xmlDoc;
} }
function catalogueHeader(date) { function catalogueHeader(id, title, date) {
return '<table class="table table-condensed table-nonfluid">\n' + return '' +
' <tbody>\n' + ' <div class="table-responsive">' +
' <thead><tr><th>Built: ' + date + '</th><th>PDF</th><th>Single Page</th></tr></thead>\n'; ' <table class="table table-hover table-condensed table-nonfluid">' +
' <tbody>' +
' <thead>' +
' <tr id="' + id + '" class="accordion-toggle" data-toggle="collapse"' +
' data-parent="#rtems-catalogue" data-target=".' + id + 'Details">' +
' <th><span class="label label-default">' + date + '</span> ' + title + '</th>\n' +
' <th><i class="indicator glyphicon glyphicon-chevron-up pull-right"></i></th>' +
' </tr>' +
' </thead>' +
' <tr>' +
' <td colspan="3" class="hiddenRow">' +
' <div class="accordion-body collapse ' + id + 'Details" id="' + id + '1">' +
' <table class="table table-condensed table-nonfluid">' +
' <tbody>' +
' <thead><tr><th>Online</th><th>PDF</th><th>Single Page</th><tr></thead>';
} }
function catalogueFooter() { function catalogueFooter() {
return ' </tbody>\n' + return '' +
'</table>\n'; ' </tbody>' +
' </table>' +
' </div>' +
' </td>' +
' </tr>' +
' </tbody>' +
' </table>' +
' </dev/>';
} }
function paintCatalogue(xml) { function paintCatalogue(xml) {
@@ -40,7 +61,8 @@ function paintCatalogue(xml) {
var docs = $(xml).find('rtems-docs'); var docs = $(xml).find('rtems-docs');
var date = $(docs).attr('date'); var date = $(docs).attr('date');
var title = $(docs).find('catalogue'); var title = $(docs).find('catalogue');
var table = catalogueHeader(date); var id = 'xxx';
var table = catalogueHeader(id, title.text(), date);
$(docs).find('doc').each(function() { $(docs).find('doc').each(function() {
var name = $(this).find('name').text(); var name = $(this).find('name').text();
var title = $(this).find('title').text(); var title = $(this).find('title').text();
@@ -56,20 +78,27 @@ function paintCatalogue(xml) {
else else
table += empty; table += empty;
if (pdf) if (pdf)
table += '<td><a href="' + '/' + pdf + '">' + table += '<td><a href="' + pdf + '">' +
'<img src="' + pdfIcon + '" width="20" height="20"></a></td>\n'; '<img src="' + pdfIcon + '" width="20" height="20"></a></td>\n';
else else
table += empty; table += empty;
if (singlehtml) if (singlehtml)
table += '<td><a href="' + '/' + singlehtml + '">' + table += '<td><a href="' + singlehtml + '">' +
'<img src="' + htmlIcon + '" width="20" height="20"></a></td>\n'; '<img src="' + htmlIcon + '" width="20" height="20"></a></td>\n';
else else
table += empty; table += empty;
table += '</tr>\n'; table += '</tr>\n';
}); });
table += catalogueFooter(); table += catalogueFooter();
el_cat_title.html('<h3>' + $(title).text() + '</h3>'); //el_cat_title.html('<h3>' + $(title).text() + '</h3>');
el_cat.html(table); el_cat.html(table);
$('#' + id + '1').on('shown.bs.collapse', function () {
$("#" + id + " i.indicator").removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down");
});
$('#' + id + '1').on('hidden.bs.collapse', function () {
$("#" + id + " i.indicator").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up");
});
$('#' + id + '1').collapse('show');
} }
function loadCatalogue(path) { function loadCatalogue(path) {

View File

@@ -59,17 +59,17 @@ def build(ctx):
# #
ctx(rule = catalogue, ctx(rule = catalogue,
target = 'catalogue.xml', target = 'catalogue.xml',
source = ['wscript', 'common/waf.py']) source = ['wscript', 'common/waf.py'] + ['%s/conf.py' % x for x in building])
ctx.install_files('${PREFIX}', 'catalogue.xml') ctx.install_files('${PREFIX}', 'catalogue.xml')
ctx(rule = coverpage_js, ctx(rule = coverpage_js,
target = 'coverpage.js', target = 'coverpage.js',
source = ['wscript', 'catalogue.xml', 'common/html-coverpage/coverpage.js']) source = ['wscript', 'catalogue.xml', 'common/coverpage/coverpage.js'])
ctx.install_as('${PREFIX}/coverpage.js', 'coverpage.js') ctx.install_as('${PREFIX}/coverpage.js', 'coverpage.js')
# #
# Install the static content. # Install the static content.
# #
ctx.install_as('${PREFIX}/index.html', 'common/html-coverpage/coverpage.html') ctx.install_as('${PREFIX}/index.html', 'common/coverpage/coverpage.html')
static_dir = ctx.path.find_dir('common/html-coverpage/static') static_dir = ctx.path.find_dir('common/coverpage/static')
ctx.install_files('${PREFIX}/static', ctx.install_files('${PREFIX}/static',
static_dir.ant_glob('**'), static_dir.ant_glob('**'),
cwd = static_dir, cwd = static_dir,