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,82 +43,100 @@
[% 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" />
Failed build produced output. Click here to inspect the output. </td>
</a> <td>
[% WRAPPER makePopover title="Help" classes="btn-mini" %] Error
<p>If you have Nix installed on your machine, this failed build output and </td>
all its dependencies can be unpacked into your local Nix store by doing:</p> <td>
<a href="[% contents %]">
Failed build produced output. Click here to inspect the output.
</a>
</td>
<td>
[% WRAPPER makePopover title="Help" classes="btn-mini" %]
<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>
<pre><span class="shell-prompt">$ </span>curl [% uri %] | gunzip | nix-store --import</pre> <pre><span class="shell-prompt">$ </span>curl [% uri %] | gunzip | nix-store --import</pre>
<p>The build output can then be found in the path <tt>[% product.path %]</tt>.</p> <p>The build output can then be found in the path <tt>[% product.path %]</tt>.</p>
[% END %] [% END %]
</td> </td>
</tr> </tr>
[% ELSE %] [% ELSE %]
<tr class="product"> <tr class="product">
<td> <td>
[% uri = c.uri_for('/build' build.id 'nix' 'pkg' "${build.nixname}-${build.system}.nixpkg") %]
<a href="[% uri %]">
<img src="[% c.uri_for("/static/images/nix-build.png") %]" alt="Source" /> <img src="[% c.uri_for("/static/images/nix-build.png") %]" alt="Source" />
One-click install of Nix package <tt>[% build.nixname %]</tt> </td>
</a> <td>
[% WRAPPER makePopover title="Help" classes="btn-mini" %] One-Click install
<p>If you have Nix installed on your machine, you can </td>
install this package and all its dependencies automatically <td>
by clicking on the link above. This requires that you have [% uri = c.uri_for('/build' build.id 'nix' 'pkg' "${build.nixname}-${build.system}.nixpkg") %]
the <tt>application/nix-package</tt> MIME type associated <a href="[% uri %]">
with the <tt>nix-install-package</tt> program in your web <tt>[% build.nixname %]</tt>
browser. Alternatively, you can install it from the </a>
command-line:</p> </td>
<td>
[% WRAPPER makePopover title="Help" classes="btn-mini" %]
<p>If you have Nix installed on your machine, you can
install this package and all its dependencies automatically
by clicking on the link above. This requires that you have
the <tt>application/nix-package</tt> MIME type associated
with the <tt>nix-install-package</tt> program in your web
browser. Alternatively, you can install it from the
command-line:</p>
<pre><span class="shell-prompt">$ </span>nix-install-package --non-interactive --url [% uri %]</pre> <pre><span class="shell-prompt">$ </span>nix-install-package --non-interactive --url [% uri %]</pre>
<p>If you get an error message “Permission denied”, you <p>If you get an error message “Permission denied”, you
should make sure that you have sufficient access rights to should make sure that you have sufficient access rights to
the Nix store, e.g., run the command as <tt>root</tt>.</p> the Nix store, e.g., run the command as <tt>root</tt>.</p>
[% END %] [% END %]
<a class="btn btn-mini" href="[% contents %]">Contents</a> <a class="btn btn-mini" href="[% contents %]">Contents</a>
</td> </td>
</tr> </tr>
<tr class="product"> <tr class="product">
<td> <td>
[% filename = build.nixname _ (product.subtype ? "-" _ product.subtype : "") _ ".closure.gz" %]
[% uri = c.uri_for('/build' build.id 'nix' 'closure' filename ) %]
<a href="[% uri %]">
<img src="[% c.uri_for("/static/images/nix-build.png") %]" alt="Source" /> <img src="[% c.uri_for("/static/images/nix-build.png") %]" alt="Source" />
Nix closure of path <tt>[% product.path %]</tt> </td>
</a> <td>
Nix closure
</td>
<td>
[% filename = build.nixname _ (product.subtype ? "-" _ product.subtype : "") _ ".closure.gz" %]
[% uri = c.uri_for('/build' build.id 'nix' 'closure' filename ) %]
[% WRAPPER makePopover title="Help" classes="btn-mini" %] <a href="[% uri %]">
<p>If you have Nix installed on your machine, this build and <tt>[% product.path %]</tt>
all its dependencies can be unpacked into your local Nix </a>
store by doing:</p> </td>
<td>
[% WRAPPER makePopover title="Help" classes="btn-mini" %]
<p>If you have Nix installed on your machine, this build and
all its dependencies can be unpacked into your local Nix
store by doing:</p>
<pre><span class="shell-prompt">$ </span>gunzip &lt; [% filename %] | nix-store --import</pre> <pre><span class="shell-prompt">$ </span>gunzip &lt; [% filename %] | nix-store --import</pre>
<p>or to download and unpack in one command:</p> <p>or to download and unpack in one command:</p>
<pre><span class="shell-prompt">$ </span>curl [% uri %] | gunzip | nix-store --import</pre> <pre><span class="shell-prompt">$ </span>curl [% uri %] | gunzip | nix-store --import</pre>
<p>The package can then be found in the path <tt>[% <p>The package can then be found in the path <tt>[%
product.path %]</tt>. Youll probably also want to do</p> product.path %]</tt>. Youll probably also want to do</p>
<pre><span class="shell-prompt">$ </span>nix-env -i [% product.path %]</pre> <pre><span class="shell-prompt">$ </span>nix-env -i [% product.path %]</pre>
<p>to actually install the package in your Nix user environment.</p> <p>to actually install the package in your Nix user environment.</p>
<p>If you get the error message “imported
archive lacks a signature”, you should make sure that you have
sufficient access rights to the Nix store, e.g., run the
command as <tt>root</tt>.</p>
[% END %]
<p>If you get the error message “imported
archive lacks a signature”, you should make sure that you have
sufficient access rights to the Nix store, e.g., run the
command as <tt>root</tt>.</p>
[% END %]
</td> </td>
</tr> </tr>
[% END %] [% END %]
@ -120,41 +144,67 @@
[% CASE ["file", "channel"] %] [% CASE ["file", "channel"] %]
<tr class="product"> <tr class="product">
<td> [% SWITCH product.subtype %]
<a href="[% uri %]"> [% CASE "source-dist" %]
[% SWITCH product.subtype %] <td>
[% CASE "source-dist" %] <img src="[% c.uri_for("/static/images/source-dist.png") %]" alt="Source" />
<img src="[% c.uri_for("/static/images/source-dist.png") %]" alt="Source" /> Source distribution <tt>[% product.name %]</tt> </td>
[% CASE "rpm" %] <td>Source distribution</td>
<img src="[% c.uri_for("/static/images/rpm.png") %]" alt="RPM" /> RPM package <tt>[% product.name %]</tt> [% CASE "rpm" %]
[% CASE "srpm" %] <td>
<img src="[% c.uri_for("/static/images/rpm.png") %]" alt="Source RPM" /> Source RPM package <tt>[% product.name %]</tt> <img src="[% c.uri_for("/static/images/rpm.png") %]" alt="RPM" />
[% CASE "deb" %] </td>
<img src="[% c.uri_for("/static/images/debian.png") %]" alt="RPM" /> Debian package <tt>[% product.name %]</tt> <td>RPM package</td>
[% CASE "iso" %] [% CASE "srpm" %]
<img src="[% c.uri_for("/static/images/iso.png") %]" alt="ISO" /> ISO-9660 CD/DVD image <tt>[% product.name %]</tt> <td>
[% CASE "binary-dist" %] <img src="[% c.uri_for("/static/images/rpm.png") %]" alt="Source RPM" />
<img src="[% c.uri_for("/static/images/binary-dist.png") %]" alt="Binary distribution" /> Binary distribution <tt>[% product.name %]</tt> </td>
[% CASE DEFAULT %] <td>Source RPM package</td>
[% IF product.type == "channel" %] [% CASE "deb" %]
<td>
<img src="[% c.uri_for("/static/images/debian.png") %]" alt="DEB" />
</td>
<td>Debian package</td>
[% CASE "iso" %]
<td>
<img src="[% c.uri_for("/static/images/iso.png") %]" alt="ISO" />
</td>
<td>ISO-9660 CD/DVD image</td>
[% CASE "binary-dist" %]
<td>
<img src="[% c.uri_for("/static/images/binary-dist.png") %]" alt="Binary distribution" />
</td>
<td>Binary distribution</td>
[% CASE DEFAULT %]
[% 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 %]
[% ELSE %] </td>
File <tt>[% product.name %]</tt> of type <tt>[% product.subtype %]</tt> [% ELSE %]
[% END %] <td>File</td>
<td>[% product.subtype %]</td>
[% END %] [% END %]
</a>
[% WRAPPER makePopover title="Details" classes="btn-mini" %]
<table class="info-table">
[% INCLUDE renderProductLinks %]
<tr><th>File size:</th><td>[% product.filesize %] bytes ([% mibs(product.filesize / (1024 * 1024)) %] MiB)</td></tr>
<tr><th>SHA-1 hash:</th><td><tt>[% product.sha1hash %]</tt></td></tr>
<tr><th>SHA-256 hash:</th><td><tt>[% product.sha256hash %]</tt></td></tr>
<tr><th>Full path:</th><td><tt>[% product.path %]</tt></td></tr>
</table>
[% END %] [% END %]
<a class="btn btn-mini" href="[% contents %]">Contents</a> <td>
<a href="[% uri %]">
<tt>[% product.name %]</tt>
</a>
</td>
<td>
[% WRAPPER makePopover title="Details" classes="btn-mini" %]
<table class="info-table">
[% INCLUDE renderProductLinks %]
<tr><th>File size:</th><td>[% product.filesize %] bytes ([% mibs(product.filesize / (1024 * 1024)) %] MiB)</td></tr>
<tr><th>SHA-1 hash:</th><td><tt>[% product.sha1hash %]</tt></td></tr>
<tr><th>SHA-256 hash:</th><td><tt>[% product.sha256hash %]</tt></td></tr>
<tr><th>Full path:</th><td><tt>[% product.path %]</tt></td></tr>
</table>
[% END %]
<a class="btn btn-mini" href="[% contents %]">Contents</a>
</td> </td>
</tr> </tr>
@ -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" />
[% SWITCH product.subtype %]
[% CASE "coverage" %]
Code coverage analysis report
[% CASE DEFAULT %]
Report of type <tt>[% product.subtype %]</tt>
[% END %]
</a>
</td> </td>
[% SWITCH product.subtype %]
[% CASE "coverage" %]
<td>Code coverage</td>
<td>
<a href="[% uri %]">
Analysis report
</a>
</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,14 +256,16 @@
[% 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>
[% WRAPPER makePopover title="Details" classes="btn-mini" %] </td>
<table class="info-table"> <td>
[% INCLUDE renderProductLinks %] [% WRAPPER makePopover title="Details" classes="btn-mini" %]
</table> <table class="info-table">
[% END %] [% INCLUDE renderProductLinks %]
</table>
[% END %]
</td> </td>
</tr> </tr>
@ -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;
} }