Merge pull request #311 from domenkozar/product-list-table

product list: convert to a proper table
This commit is contained in:
Eelco Dolstra 2016-08-19 13:40:42 +02:00 committed by GitHub
commit 682b4bcc73
2 changed files with 172 additions and 104 deletions

View file

@ -19,7 +19,13 @@
[% BLOCK renderProductList %] [% BLOCK renderProductList %]
<table class="productList"> <table class="table table-striped">
<tr>
<th></th>
<th>Type</th>
<th>Link</th>
<th>Actions</th>
</tr>
[% FOREACH product IN build.buildproducts %] [% FOREACH product IN build.buildproducts %]
@ -37,10 +43,17 @@
[% uri = c.uri_for('/build' build.id 'nix' 'closure' filename ) %] [% uri = c.uri_for('/build' build.id 'nix' 'closure' filename ) %]
<tr class="product"> <tr class="product">
<td> <td>
<a href="[% contents %]">
<img src="[% c.uri_for("/static/images/error_32.png") %]" alt="Source" /> <img src="[% c.uri_for("/static/images/error_32.png") %]" alt="Source" />
</td>
<td>
Error
</td>
<td>
<a href="[% contents %]">
Failed build produced output. Click here to inspect the output. Failed build produced output. Click here to inspect the output.
</a> </a>
</td>
<td>
[% WRAPPER makePopover title="Help" classes="btn-mini" %] [% WRAPPER makePopover title="Help" classes="btn-mini" %]
<p>If you have Nix installed on your machine, this failed build output and <p>If you have Nix installed on your machine, this failed build output and
all its dependencies can be unpacked into your local Nix store by doing:</p> all its dependencies can be unpacked into your local Nix store by doing:</p>
@ -54,12 +67,19 @@
[% ELSE %] [% ELSE %]
<tr class="product"> <tr class="product">
<td>
<img src="[% c.uri_for("/static/images/nix-build.png") %]" alt="Source" />
</td>
<td>
One-Click install
</td>
<td> <td>
[% uri = c.uri_for('/build' build.id 'nix' 'pkg' "${build.nixname}-${build.system}.nixpkg") %] [% uri = c.uri_for('/build' build.id 'nix' 'pkg' "${build.nixname}-${build.system}.nixpkg") %]
<a href="[% uri %]"> <a href="[% uri %]">
<img src="[% c.uri_for("/static/images/nix-build.png") %]" alt="Source" /> <tt>[% build.nixname %]</tt>
One-click install of Nix package <tt>[% build.nixname %]</tt>
</a> </a>
</td>
<td>
[% WRAPPER makePopover title="Help" classes="btn-mini" %] [% WRAPPER makePopover title="Help" classes="btn-mini" %]
<p>If you have Nix installed on your machine, you can <p>If you have Nix installed on your machine, you can
install this package and all its dependencies automatically install this package and all its dependencies automatically
@ -80,15 +100,20 @@
</tr> </tr>
<tr class="product"> <tr class="product">
<td> <td>
<img src="[% c.uri_for("/static/images/nix-build.png") %]" alt="Source" />
</td>
<td>
Nix closure
</td>
<td>
[% filename = build.nixname _ (product.subtype ? "-" _ product.subtype : "") _ ".closure.gz" %] [% filename = build.nixname _ (product.subtype ? "-" _ product.subtype : "") _ ".closure.gz" %]
[% uri = c.uri_for('/build' build.id 'nix' 'closure' filename ) %] [% uri = c.uri_for('/build' build.id 'nix' 'closure' filename ) %]
<a href="[% uri %]"> <a href="[% uri %]">
<img src="[% c.uri_for("/static/images/nix-build.png") %]" alt="Source" /> <tt>[% product.path %]</tt>
Nix closure of path <tt>[% product.path %]</tt>
</a> </a>
</td>
<td>
[% WRAPPER makePopover title="Help" classes="btn-mini" %] [% WRAPPER makePopover title="Help" classes="btn-mini" %]
<p>If you have Nix installed on your machine, this build and <p>If you have Nix installed on your machine, this build and
all its dependencies can be unpacked into your local Nix all its dependencies can be unpacked into your local Nix
@ -112,7 +137,6 @@
sufficient access rights to the Nix store, e.g., run the sufficient access rights to the Nix store, e.g., run the
command as <tt>root</tt>.</p> command as <tt>root</tt>.</p>
[% END %] [% END %]
</td> </td>
</tr> </tr>
[% END %] [% END %]
@ -120,31 +144,57 @@
[% CASE ["file", "channel"] %] [% CASE ["file", "channel"] %]
<tr class="product"> <tr class="product">
<td>
<a href="[% uri %]">
[% SWITCH product.subtype %] [% SWITCH product.subtype %]
[% CASE "source-dist" %] [% CASE "source-dist" %]
<img src="[% c.uri_for("/static/images/source-dist.png") %]" alt="Source" /> Source distribution <tt>[% product.name %]</tt> <td>
<img src="[% c.uri_for("/static/images/source-dist.png") %]" alt="Source" />
</td>
<td>Source distribution</td>
[% CASE "rpm" %] [% CASE "rpm" %]
<img src="[% c.uri_for("/static/images/rpm.png") %]" alt="RPM" /> RPM package <tt>[% product.name %]</tt> <td>
<img src="[% c.uri_for("/static/images/rpm.png") %]" alt="RPM" />
</td>
<td>RPM package</td>
[% CASE "srpm" %] [% CASE "srpm" %]
<img src="[% c.uri_for("/static/images/rpm.png") %]" alt="Source RPM" /> Source RPM package <tt>[% product.name %]</tt> <td>
<img src="[% c.uri_for("/static/images/rpm.png") %]" alt="Source RPM" />
</td>
<td>Source RPM package</td>
[% CASE "deb" %] [% CASE "deb" %]
<img src="[% c.uri_for("/static/images/debian.png") %]" alt="RPM" /> Debian package <tt>[% product.name %]</tt> <td>
<img src="[% c.uri_for("/static/images/debian.png") %]" alt="DEB" />
</td>
<td>Debian package</td>
[% CASE "iso" %] [% CASE "iso" %]
<img src="[% c.uri_for("/static/images/iso.png") %]" alt="ISO" /> ISO-9660 CD/DVD image <tt>[% product.name %]</tt> <td>
<img src="[% c.uri_for("/static/images/iso.png") %]" alt="ISO" />
</td>
<td>ISO-9660 CD/DVD image</td>
[% CASE "binary-dist" %] [% CASE "binary-dist" %]
<img src="[% c.uri_for("/static/images/binary-dist.png") %]" alt="Binary distribution" /> Binary distribution <tt>[% product.name %]</tt> <td>
<img src="[% c.uri_for("/static/images/binary-dist.png") %]" alt="Binary distribution" />
</td>
<td>Binary distribution</td>
[% CASE DEFAULT %] [% CASE DEFAULT %]
[% IF product.type == "channel" %] [% IF product.type == "channel" %]
<td>
<img src="[% c.uri_for("/static/images/channel.png") %]" alt="Channel" /> <img src="[% c.uri_for("/static/images/channel.png") %]" alt="Channel" />
Channel expression tarball <tt>[% product.name %]</tt> </td>
<td>
Channel expression tarball
[% IF product.subtype != "-" %]for <tt>[% product.subtype %]</tt>[% END %] [% IF product.subtype != "-" %]for <tt>[% product.subtype %]</tt>[% END %]
</td>
[% ELSE %] [% ELSE %]
File <tt>[% product.name %]</tt> of type <tt>[% product.subtype %]</tt> <td>File</td>
<td>[% product.subtype %]</td>
[% END %] [% END %]
[% END %] [% END %]
<td>
<a href="[% uri %]">
<tt>[% product.name %]</tt>
</a> </a>
</td>
<td>
[% WRAPPER makePopover title="Details" classes="btn-mini" %] [% WRAPPER makePopover title="Details" classes="btn-mini" %]
<table class="info-table"> <table class="info-table">
[% INCLUDE renderProductLinks %] [% INCLUDE renderProductLinks %]
@ -162,28 +212,42 @@
<tr class="product"> <tr class="product">
<td> <td>
<a href="[% uri %]">
<img src="[% c.uri_for("/static/images/report.png") %]" alt="Report" /> <img src="[% c.uri_for("/static/images/report.png") %]" alt="Report" />
</td>
[% SWITCH product.subtype %] [% SWITCH product.subtype %]
[% CASE "coverage" %] [% CASE "coverage" %]
Code coverage analysis report <td>Code coverage</td>
[% CASE DEFAULT %] <td>
Report of type <tt>[% product.subtype %]</tt> <a href="[% uri %]">
[% END %] Analysis report
</a> </a>
</td> </td>
[% CASE DEFAULT %]
<td>Report</td>
<td>
<a href="[% uri %]">
<tt>[% product.subtype %]</tt>
</a>
</td>
[% END %]
<td></td>
</tr> </tr>
[% CASE ["doc", "doc-pdf"] %] [% CASE ["doc", "doc-pdf"] %]
<tr class="product"> <tr class="product">
<td> <td>
<a href="[% uri %]">
[% IF product.type == "doc-pdf" %] [% IF product.type == "doc-pdf" %]
<img src="[% c.uri_for("/static/images/pdf.png") %]" alt="PDF document" /> <img src="[% c.uri_for("/static/images/pdf.png") %]" alt="PDF document" />
[% ELSE %] [% ELSE %]
<img src="[% c.uri_for("/static/images/document.png") %]" alt="Document" /> <img src="[% c.uri_for("/static/images/document.png") %]" alt="Document" />
[% END %] [% END %]
</td>
<td>
Documentation
</td>
<td>
<a href="[% uri %]">
[% SWITCH product.subtype %] [% SWITCH product.subtype %]
[% CASE "readme" %] [% CASE "readme" %]
Read Me! Read Me!
@ -192,9 +256,11 @@
[% CASE "release-notes" %] [% CASE "release-notes" %]
Release notes Release notes
[% CASE DEFAULT %] [% CASE DEFAULT %]
Documentation of type <tt>[% product.subtype %]</tt> [% product.subtype %]
[% END %] [% END %]
</a> </a>
</td>
<td>
[% WRAPPER makePopover title="Details" classes="btn-mini" %] [% WRAPPER makePopover title="Details" classes="btn-mini" %]
<table class="info-table"> <table class="info-table">
[% INCLUDE renderProductLinks %] [% INCLUDE renderProductLinks %]
@ -207,7 +273,14 @@
<tr class="product"> <tr class="product">
<td> <td>
Something of type <tt>[% product.type %]</tt> [% product %] <tt>[% product.type %]</tt>
</td>
<td>
</td>
<td>
[% product %]
</td>
<td>
</td> </td>
</tr> </tr>

View file

@ -24,11 +24,6 @@ th {
display: none; display: none;
} }
table.productList {
border-collapse: separate;
border-spacing: 0em 1em;
}
table.table-small { table.table-small {
width: auto !important; width: auto !important;
} }