Skip to content

Commit

Permalink
Show vcs info on bundles #50
Browse files Browse the repository at this point in the history
  • Loading branch information
Zitrax committed Oct 28, 2016
1 parent 17908f2 commit 83bcbab
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 76 deletions.
9 changes: 8 additions & 1 deletion artifakt/static/css/artifakt.css
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,11 @@ span.comment_by, span.comment_age {

span.comment_reply a {
font-size: small;
}
}

tr.spacer > td {
height: 40px;
border-top: none !important;
/* Not optimal - would prefer to inherit default background instead of hardcoding white. */
background-color: white;
}
153 changes: 78 additions & 75 deletions artifakt/templates/artifact.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -36,95 +36,98 @@
<div class="panel-body">
{% if artifact.is_bundle %}
<table class="table table-striped table-hover table-condensed">
<tr>
<th>Filename</th>
<th>SHA1</th>
<th>Created</th>
<th>Comment</th>
<th>Size</th>
</tr>
{% for af in artifact.artifacts|sort(attribute='filename') %}
<tr>
<th>Filename</th>
<th>SHA1</th>
<th>Created</th>
<th>Comment</th>
<th>Size</th>
</tr>
{% for af in artifact.artifacts|sort(attribute='filename') %}
<tr>
<td><a href="/artifact/{{ af.sha1 }}">{{ af.bundle_filename(artifact) }}</a></td>
<td><code>{{ af.sha1 }}</code></td>
<td>{{ af.created }}</td>
<td>{{ af.comment if af.comment else '' }}</td>
<td>{{ af.size }}</td>
</tr>
{% endfor %}
<tr>
<th colspan="4">Total size</th>
<th>{{ artifact.size_h }}</th>
<td><a href="/artifact/{{ af.sha1 }}">{{ af.bundle_filename(artifact) }}</a></td>
<td><code>{{ af.sha1 }}</code></td>
<td>{{ af.created }}</td>
<td>{{ af.comment if af.comment else '' }}</td>
<td>{{ af.size }}</td>
</tr>
</table>
{% endfor %}
<tr>
<th colspan="4">Total size</th>
<th>{{ artifact.size_h }}</th>
</tr>

{% else %}
<table class="table table-striped table-hover">
<tr>
<th>File size</th>
<td id="file_size">{{ artifact.size_h }} ({{ artifact.size }} bytes)</td>
</tr>
<tr>
<th>SHA1</th>
<td><code>{{ artifact.sha1 }}</code></td>
</tr>
<tr>
<th>Created</th>
<td>
<script>
document.write(new Date('{{ artifact.created }} UTC').toLocaleString());
</script>
( {{ artifact.age }} ago )
</td>
</tr>
<tr>
<th>Uploader</th>
<td>{{ artifact.uploader.username if not artifact.uploader.firstname else
"{} {}".format(artifact.uploader.firstname, artifact.uploader.lastname) }}</td>
</tr>
<tr>
<th>Mime type</th>
<td>{{ artifact.mime or "Unknown" }}</td>
</tr>
{% if artifact.bundles %}
<tr>
<th>File size</th>
<td id="file_size">{{ artifact.size_h }} ({{ artifact.size }} bytes)</td>
</tr>
<tr>
<th>SHA1</th>
<td><code>{{ artifact.sha1 }}</code></td>
</tr>
<tr>
<th>Created</th>
<th>Bundles</th>
<td>
<script>
document.write(new Date('{{ artifact.created }} UTC').toLocaleString());
</script>
( {{ artifact.age }} ago )
{% for bundle in artifact.bundles %}
<code><a href="/artifact/{{ bundle.sha1 }}">{{ bundle.name }}</a></code>
{% endfor %}
</td>
</tr>
{% endif %}
{% if artifact.comment %}
<tr>
<th>Uploader</th>
<td>{{ artifact.uploader.username if not artifact.uploader.firstname else
"{} {}".format(artifact.uploader.firstname, artifact.uploader.lastname) }}</td>
</tr>
<tr>
<th>Mime type</th>
<td>{{ artifact.mime or "Unknown" }}</td>
<th>Comment</th>
<td>{{ artifact.comment }}</td>
</tr>
{% if artifact.bundles %}
<tr>
<th>Bundles</th>
<td>
{% for bundle in artifact.bundles %}
<code><a href="/artifact/{{ bundle.sha1 }}">{{ bundle.name }}</a></code>
{% endfor %}
</td>
</tr>
{% endif %}
{% if artifact.comment %}
<tr>
<th>Comment</th>
<td>{{ artifact.comment }}</td>
</tr>
{% endif %}
{% endif %}

{% if artifact.vcs is not none %}
<tr class="info">
<th colspan="2">Version information</th>
</tr>
<tr>
<th>Repository</th>
<td>
<a href="/repository/{{ artifact.vcs.repository.id }}">{{ artifact.vcs.repository.name }}</a>
</td>
</tr>
<tr>
<th>Type</th>
<td>{{ artifact.vcs.repository.type }}</td>
</tr>
<tr>
<th>Revision</th>
<td>{{ artifact.vcs.revision }}</td>
</tr>
{% endif %}
{% endif %}

</table>
{% if artifact.vcs is not none %}
<tr class="spacer"><td></td></tr>
<tr class="success">
<th colspan="{{ 5 if artifact.is_bundle else 2 }}">Version information</th>
</tr>
<tr>
<th>Repository</th>
<td>
<a href="/repository/{{ artifact.vcs.repository.id }}">{{ artifact.vcs.repository.name }}</a>
</td>
</tr>
<tr>
<th>Type</th>
<td colspan="{{ 4 if artifact.is_bundle else 1 }}">{{ artifact.vcs.repository.type }}</td>
</tr>
<tr>
<th>Revision</th>
<td colspan="{{ 4 if artifact.is_bundle else 1 }}">{{ artifact.vcs.revision }}</td>
</tr>
{% endif %}

</table>


<form style="display: inline;" action="/artifact/{{ artifact.sha1 }}/download">
<input type="submit" class="btn btn-sm btn-success"
value="{{ "Download Archive" if artifact.is_bundle else "Download" }}">
Expand Down

0 comments on commit 83bcbab

Please sign in to comment.