mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-27 10:22:17 +00:00
Versioning template improvements
//TODO Rather than have seperate asset templates, convert 'id' into a template variable
This commit is contained in:
37
versioning/templates/partials/activity_table_body.html
Normal file
37
versioning/templates/partials/activity_table_body.html
Normal file
@@ -0,0 +1,37 @@
|
||||
{% load to_class_name from filters %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">Date</th>
|
||||
<th scope="col">Object</th>
|
||||
<th scope="col">Version ID</th>
|
||||
<th scope="col">User</th>
|
||||
<th scope="col">Changes</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for version in object_list %}
|
||||
<tr>
|
||||
<th scope="row">{{ version.revision.date_created }}</th>
|
||||
<td><a href="{{ version.changes.new.get_absolute_url }}">{{version.changes.new|to_class_name}}
|
||||
{% if version.changes.new.asset_id %}
|
||||
{{ version.changes.new.asset_id }}
|
||||
{% else %}
|
||||
{{ version.changes.new.pk|stringformat:"05d" }}
|
||||
{% endif %}
|
||||
</a></td>
|
||||
<td>{{ version.pk }}|{{ version.revision.pk }}</td>
|
||||
<td>{{ version.revision.user.name|default:"System" }}</td>
|
||||
<td>
|
||||
{% if version.changes.old == None %}
|
||||
{{version.changes.new|to_class_name}} Created
|
||||
{% else %}
|
||||
{% include 'version_changes.html' %}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
5
versioning/templates/partials/last_edited_asset.html
Normal file
5
versioning/templates/partials/last_edited_asset.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<div class="pt-2">
|
||||
<a href="{% url target object.asset_id %}" title="View Revision History">
|
||||
Last edited {{ object.last_edited_at|default:'never' }} by {{ object.last_edited_by.name|default:'System' }}
|
||||
</a>
|
||||
</div>
|
||||
29
versioning/templates/partials/version_history_table.html
Normal file
29
versioning/templates/partials/version_history_table.html
Normal file
@@ -0,0 +1,29 @@
|
||||
{% load to_class_name from filters %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">Date</td>
|
||||
<th scope="col">Version ID</td>
|
||||
<th scope="col">User</td>
|
||||
<th scope="col">Changes</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for version in object_list %}
|
||||
<tr>
|
||||
<th scope="row">{{ version.revision.date_created }}</th>
|
||||
<td>{{ version.pk }}|{{ version.revision.pk }}</td>
|
||||
<td>{{ version.revision.user.name }}</td>
|
||||
<td>
|
||||
{% if version.changes.old is None %}
|
||||
{{object|to_class_name}} Created
|
||||
{% else %}
|
||||
{% include 'version_changes.html' %}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
Reference in New Issue
Block a user