Skip to content
Snippets Groups Projects
Commit 6098a9c4 authored by Antoine Lambert's avatar Antoine Lambert
Browse files

templates: Use the key_value filter only when needed

parent 9051a371
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ See top-level LICENSE file for more information
<table class="table swh-table swh-table-striped">
<thead>
<tr>
<th><i class="{{ swh_object_icons|key_value:'branch' }} fa-fw"></i>Name</th>
<th><i class="{{ swh_object_icons.branch }} fa-fw"></i>Name</th>
<th>Revision</th>
<th>Message</th>
<th>Date</th>
......@@ -25,7 +25,7 @@ See top-level LICENSE file for more information
<tbody>
{% for branch in displayed_branches %}
<tr class="swh-origin-branch">
<td style="max-width: 300px"><i class="{{ swh_object_icons|key_value:'branch' }} fa-fw"></i><a href="{{ branch.directory_url }}">{{ branch.name }}</a></td>
<td style="max-width: 300px"><i class="{{ swh_object_icons.branch }} fa-fw"></i><a href="{{ branch.directory_url }}">{{ branch.name }}</a></td>
<td><a href="{{ branch.revision_url }}">{{ branch.revision|slice:":7" }}</a></td>
<td class="swh-log-entry-message swh-table-cell-text-overflow" style="min-width: 500px" title="{{ branch.message }}">{{ branch.message }}</td>
<td style="min-width: 250px">{{ branch.date }}</td>
......
......@@ -12,7 +12,7 @@ See top-level LICENSE file for more information
{% block swh-browse-content %}
{% include "includes/top-navigation.html" %}
<div style="height: 35px;margin: 4px;">
<i class="{{ swh_object_icons|key_value:'release' }} fa-fw"></i>Release <b>{{ swh_object_metadata.name }}</b>
<i class="{{ swh_object_icons.release }} fa-fw"></i>Release <b>{{ swh_object_metadata.name }}</b>
created by {{ swh_object_metadata.author }} on <b>{{ swh_object_metadata.date }}</b>
</div>
<pre style="white-space: pre-wrap">
......
......@@ -15,7 +15,7 @@ See top-level LICENSE file for more information
<table class="table swh-table swh-table-striped">
<thead>
<tr>
<th><i class="{{ swh_object_icons|key_value:'release' }} fa-fw"></i>Name</th>
<th><i class="{{ swh_object_icons.release }} fa-fw"></i>Name</th>
<th>Target</th>
<th>Message</th>
<th>Date</th>
......@@ -24,7 +24,7 @@ See top-level LICENSE file for more information
<tbody>
{% for release in displayed_releases %}
<tr class="swh-origin-release">
<td><i class="{{ swh_object_icons|key_value:'release' }} fa-fw"></i><a href="{{ release.release_url }}">{{ release.name }}</a></td>
<td><i class="{{ swh_object_icons.release }} fa-fw"></i><a href="{{ release.release_url }}">{{ release.name }}</a></td>
<td><i class="{{ swh_object_icons|key_value:release.target_type }} fa-fw"></i><a href="{{ release.target_url }}">{{ release.target|slice:":7" }}</a></td>
<td class="swh-log-entry-message swh-table-cell-text-overflow" title="{{ release.message }}">{{ release.message }}</td>
<td>{{ release.date }}</td>
......
......@@ -27,7 +27,7 @@ See top-level LICENSE file for more information
<table class="table swh-table swh-table-striped">
<thead>
<tr>
<th><i class="{{ swh_object_icons|key_value:'revision' }} fa-fw"></i>Revision</th>
<th><i class="{{ swh_object_icons.revision }} fa-fw"></i>Revision</th>
<th>Author</th>
<th>Message</th>
<th>Date</th>
......@@ -37,7 +37,7 @@ See top-level LICENSE file for more information
<tbody>
{% for log in revision_log %}
<tr class="swh-revision-log-entry">
<td class="swh-revision-log-entry-id"><i class="{{ swh_object_icons|key_value:'revision' }} fa-fw"></i>{{ log.revision }}</td>
<td class="swh-revision-log-entry-id"><i class="{{ swh_object_icons.revision }} fa-fw"></i>{{ log.revision }}</td>
<td class="swh-revision-log-entry-author">{{ log.author }}</td>
<td class="swh-log-entry-message swh-table-cell-text-overflow" title="{{ log.message }}">{{ log.message }}</td>
<td class="swh-revision-log-entry-date">{{ log.date }}</td>
......
......@@ -18,7 +18,7 @@ See top-level LICENSE file for more information
{% block swh-browse-content %}
<div>
<i class="{{ swh_object_icons|key_value:'revision' }} fa-fw"></i>Revision <b>{{ swh_object_metadata.id }}</b>
<i class="{{ swh_object_icons.revision }} fa-fw"></i>Revision <b>{{ swh_object_metadata.id }}</b>
authored by {{ swh_object_metadata.author }} on <b>{{ swh_object_metadata.date }}</b>
</div>
......@@ -40,7 +40,7 @@ See top-level LICENSE file for more information
<div style="margin: 4px; padding-bottom: 5px;">
<b>{{ parents|length }} parent{% if parents|length > 1 %}s{% endif %}</b>
<i class="{{ swh_object_icons|key_value:'revision' }} fa-fw"></i>
<i class="{{ swh_object_icons.revision }} fa-fw"></i>
{% for parent in parents %}
<a href="{{ parent.url }}">{{ parent.id|slice:":7" }}</a>
{% if not forloop.last %}
......
......@@ -11,20 +11,20 @@ See top-level LICENSE file for more information
<div class="swh-origin-visit-details">
<ul>
{% if snapshot_context.origin_info %}
<li><i class="{{ swh_object_icons|key_value:'visits' }} fa-fw"></i><a href="{{ snapshot_context.browse_url }}">Visits</a></li>
<li><i class="{{ swh_object_icons.visits }} fa-fw"></i><a href="{{ snapshot_context.browse_url }}">Visits</a></li>
{% endif %}
{% if snapshot_context.visit_info %}
<li><i class="{{ swh_object_icons|key_value:'snapshot' }} fa-fw"></i> Snapshot date: <a href="{{ snapshot_context.visit_info.url }}">{{ snapshot_context.visit_info.fmt_date }}</a></li>
<li><i class="{{ swh_object_icons.snapshot }} fa-fw"></i> Snapshot date: <a href="{{ snapshot_context.visit_info.url }}">{{ snapshot_context.visit_info.fmt_date }}</a></li>
{% endif %}
{% if not snapshot_context.snapshot_size.revision %}
<li><i class="{{ swh_object_icons|key_value:'branches' }} fa-fw"></i> Branches (0)</li>
<li><i class="{{ swh_object_icons.branches }} fa-fw"></i> Branches (0)</li>
{% else %}
<li><i class="{{ swh_object_icons|key_value:'branches' }} fa-fw"></i> <a href="{{ snapshot_context.branches_url }}">Branches ({{ snapshot_context.snapshot_size.revision}})</a></li>
<li><i class="{{ swh_object_icons.branches }} fa-fw"></i> <a href="{{ snapshot_context.branches_url }}">Branches ({{ snapshot_context.snapshot_size.revision}})</a></li>
{% endif %}
{% if not snapshot_context.snapshot_size.release %}
<li><i class="{{ swh_object_icons|key_value:'releases' }} fa-fw"></i> Releases (0)</li>
<li><i class="{{ swh_object_icons.releases }} fa-fw"></i> Releases (0)</li>
{% else %}
<li><i class="{{ swh_object_icons|key_value:'releases' }} fa-fw"></i> <a href="{{ snapshot_context.releases_url }}">Releases ({{ snapshot_context.snapshot_size.release }})</a></li>
<li><i class="{{ swh_object_icons.releases }} fa-fw"></i> <a href="{{ snapshot_context.releases_url }}">Releases ({{ snapshot_context.snapshot_size.release }})</a></li>
{% endif %}
</ul>
</div>
......
......@@ -13,10 +13,10 @@ See top-level LICENSE file for more information
<div class="dropdown float-left" id="swh-branches-releases-dd">
<button class="btn btn-block btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown">
{% if snapshot_context.branch %}
<i class="{{ swh_object_icons|key_value:'branch' }} fa-fw" aria-hidden="true"></i>
<i class="{{ swh_object_icons.branch }} fa-fw" aria-hidden="true"></i>
Branch: <strong>{{ snapshot_context.branch }}</strong>
{% else %}
<i class="{{ swh_object_icons|key_value:'release' }} fa-fw" aria-hidden="true"></i>
<i class="{{ swh_object_icons.release }} fa-fw" aria-hidden="true"></i>
Release: <strong>{{ snapshot_context.release }}</strong>
{% endif %}
<span class="caret"></span>
......@@ -31,7 +31,7 @@ See top-level LICENSE file for more information
{% for b in snapshot_context.branches %}
<li class="swh-branch">
<a href="{{ b.url | safe }}">
<i class="{{ swh_object_icons|key_value:'branch' }} fa-fw" aria-hidden="true"></i>
<i class="{{ swh_object_icons.branch }} fa-fw" aria-hidden="true"></i>
{% if b.name == snapshot_context.branch %}
<i class="fa fa-check fa-fw" aria-hidden="true"></i>
{% else %}
......@@ -56,7 +56,7 @@ See top-level LICENSE file for more information
{% if r.target_type == 'revision' %}
<li class="swh-release">
<a href="{{ r.url | safe }}">
<i class="{{ swh_object_icons|key_value:'release' }} fa-fw" aria-hidden="true"></i>
<i class="{{ swh_object_icons.release }} fa-fw" aria-hidden="true"></i>
{% if r.name == snapshot_context.release %}
<i class="fa fa-check fa-fw" aria-hidden="true"></i>
{% else %}
......
......@@ -17,12 +17,12 @@ See top-level LICENSE file for more information
<div class="dropdown-menu">
{% if vault_cooking.directory_context %}
<button class="dropdown-item" type="button" tabindex="-1" data-toggle="modal" data-target="#vault-cook-directory-modal">
<i class="{{ swh_object_icons|key_value:'directory' }} fa-fw" aria-hidden="true"></i>Directory
<i class="{{ swh_object_icons.directory }} fa-fw" aria-hidden="true"></i>Directory
</button>
{% endif %}
{% if vault_cooking.revision_context %}
<button class="dropdown-item" type="button" tabindex="-1" data-toggle="modal" data-target="#vault-cook-revision-modal">
<i class="{{ swh_object_icons|key_value:'revision' }} fa-fw"></i>Revision
<i class="{{ swh_object_icons.revision }} fa-fw"></i>Revision
</button>
{% endif %}
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment