-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #279 from co-cddo/feature/UCD_36-custom-applicatio…
…n-history-page Feature/ucd 36 custom application history page
- Loading branch information
Showing
15 changed files
with
552 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...domain/request/migrations/0020_remove_historicalregistrantperson_history_user_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Generated by Django 4.2.13 on 2024-09-09 14:08 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("request", "0019_historicalregistrypublishedperson_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="historicalregistrantperson", | ||
name="history_user", | ||
), | ||
migrations.RemoveField( | ||
model_name="historicalregistrarperson", | ||
name="history_user", | ||
), | ||
migrations.RemoveField( | ||
model_name="historicalregistrarperson", | ||
name="registrar", | ||
), | ||
migrations.RemoveField( | ||
model_name="historicalregistrypublishedperson", | ||
name="history_user", | ||
), | ||
migrations.DeleteModel( | ||
name="HistoricalRegistrant", | ||
), | ||
migrations.DeleteModel( | ||
name="HistoricalRegistrantPerson", | ||
), | ||
migrations.DeleteModel( | ||
name="HistoricalRegistrarPerson", | ||
), | ||
migrations.DeleteModel( | ||
name="HistoricalRegistryPublishedPerson", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...est_a_govuk_domain/request/templates/simple_history/_application_object_history_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{% load i18n %} | ||
{% load url from simple_history_compat %} | ||
{% load admin_urls %} | ||
{% load getattribute from getattributes %} | ||
{% load admin_tags %} | ||
<style nonce="{{ request.csp_nonce }}"> | ||
.full_width { | ||
width: 100%; | ||
align-items: center; | ||
} | ||
|
||
.full_width td { | ||
width: 30%; | ||
} | ||
|
||
h2 { | ||
margin-top: 2%; | ||
} | ||
</style> | ||
|
||
|
||
<h2>Full event history</h2> | ||
<table id="change-history" class="table table-bordered table-striped full_width"> | ||
<thead> | ||
<tr> | ||
<th scope="col">{% trans 'Date/time' %}</th> | ||
<th scope="col">{% trans 'User' %}</th> | ||
<th scope="col">{% trans 'Changed fields' %}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for action in action_list %} | ||
<tr> | ||
<td> | ||
<a href="{% url opts|admin_urlname:'simple_history' object.pk action.pk %}">{{ action.history_date | format_date }}</a> | ||
</td> | ||
<td> | ||
{% if action.history_object.last_updated_by %} | ||
{% url admin_user_view action.history_object.last_updated_by.id as admin_user_url %} | ||
{% if admin_user_url %} | ||
<a href="{{ admin_user_url }}">{{ action.history_object.last_updated_by }}</a> | ||
{% else %} | ||
{{ action.history_object.last_updated_by }} | ||
{% endif %} | ||
{% else %} | ||
{% trans "-" %} | ||
{% endif %} | ||
</td> | ||
<td> | ||
{{ action | changed_fields }} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> |
95 changes: 95 additions & 0 deletions
95
request_a_govuk_domain/request/templates/simple_history/_review_object_history_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{% load i18n %} | ||
{% load url from simple_history_compat %} | ||
{% load admin_urls %} | ||
{% load getattribute from getattributes %} | ||
{% load admin_tags %} | ||
<style nonce="{{ request.csp_nonce }}"> | ||
.full_width { | ||
width: 100%; | ||
align-items: center; | ||
} | ||
|
||
.full_width td { | ||
width: 30%; | ||
} | ||
|
||
h2 { | ||
margin-top: 2%; | ||
} | ||
</style> | ||
|
||
<h2>Status change history</h2> | ||
<table id="change-history-summary" class="table table-bordered table-striped full_width"> | ||
<thead> | ||
<tr> | ||
<th scope="col">{% trans 'Date/time' %}</th> | ||
<th scope="col">{% trans 'User' %}</th> | ||
<th scope="col">{% trans 'Status' %}</th> | ||
|
||
</tr> | ||
</thead> | ||
<tbody> | ||
{% with filtered_actions=application_history %} | ||
{% for action in filtered_actions %} | ||
{% should_display action as should_display %} | ||
{% if should_display %} | ||
<tr> | ||
<td> | ||
<a href="{% url opts|application_admin_url:'simple_history' action.id action.pk %}">{{ action.history_date | format_date }}</a> | ||
</td> | ||
<td> | ||
{% if action.last_updated_by %} | ||
{% url admin_user_view action.last_updated_by.id as admin_user_url %} | ||
{% if admin_user_url %} | ||
<a href="{{ admin_user_url }}">{{ action| owner_filter }}</a> | ||
{% else %} | ||
{{ action.last_updated_by }} | ||
{% endif %} | ||
{% else %} | ||
{% trans "-" %} | ||
{% endif %} | ||
</td> | ||
<td> | ||
{{ action.status | capfirst }} | ||
</td> | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
{% endwith %} | ||
</tbody> | ||
</table> | ||
|
||
<h2>Full event history</h2> | ||
<table id="change-history" class="table table-bordered table-striped full_width"> | ||
<thead> | ||
<tr> | ||
<th scope="col">{% trans 'Date/time' %}</th> | ||
<th scope="col">{% trans 'User' %}</th> | ||
<th scope="col">{% trans 'Changed fields' %}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for action in action_list %} | ||
<tr> | ||
<td> | ||
<a href="{% url opts|admin_urlname:'simple_history' object.pk action.pk %}">{{ action.history_date| format_date }}</a> | ||
</td> | ||
<td> | ||
{% if action.history_user %} | ||
{% url admin_user_view action.history_user.id as admin_user_url %} | ||
{% if admin_user_url %} | ||
<a href="{{ admin_user_url }}">{{ action.history_user }}</a> | ||
{% else %} | ||
{{ action.history_user }} | ||
{% endif %} | ||
{% else %} | ||
{% trans "-" %} | ||
{% endif %} | ||
</td> | ||
<td> | ||
<i>{{ action | changed_fields }}</i> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> |
25 changes: 25 additions & 0 deletions
25
request_a_govuk_domain/request/templates/simple_history/object_history.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% extends "admin/object_history.html" %} | ||
{% load i18n %} | ||
{% load url from simple_history_compat %} | ||
{% load admin_urls %} | ||
{% load display_list from simple_history_admin_list %} | ||
{% load admin_tags %} | ||
|
||
{% block content %} | ||
<div id="content-main"> | ||
<div class="govuk-table"> | ||
{% if action_list %} | ||
{% history_type action_list as history_type %} | ||
{% if history_type == "Review" %} | ||
{% display_review_list %} | ||
{% elif history_type == "Application" %} | ||
{% display_application_list %} | ||
{% else %} | ||
{% display_list %} | ||
{% endif %} | ||
{% else %} | ||
<p>{% trans "This object doesn't have a change history." %}</p> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endblock %} |
Empty file.
Oops, something went wrong.