From ca6cddb3924bd185532a716ebb12aa9b79f951b7 Mon Sep 17 00:00:00 2001
From: David Taylor
Date: Tue, 5 Apr 2016 11:50:34 +0100
Subject: [PATCH] Add comments display to versioning history (because why not).
Maybe in future we could have a box people can type in before they save changes to an event... But that's a separate project
---
RIGS/admin.py | 3 ++-
RIGS/templates/RIGS/activity_feed_data.html | 3 +++
RIGS/templates/RIGS/activity_table.html | 2 ++
RIGS/templates/RIGS/version_history.html | 4 ++++
4 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/RIGS/admin.py b/RIGS/admin.py
index a72c4705..d8583e23 100644
--- a/RIGS/admin.py
+++ b/RIGS/admin.py
@@ -62,7 +62,8 @@ class AssociateAdmin(reversion.VersionAdmin):
for event in events:
masterObject.event_set.add(event)
obj.delete()
-
+ reversion.set_comment('Merging Objects')
+
self.message_user(request, "Objects successfully merged.")
return
else: # Present the confirmation screen
diff --git a/RIGS/templates/RIGS/activity_feed_data.html b/RIGS/templates/RIGS/activity_feed_data.html
index fc9af87e..e99baf8e 100644
--- a/RIGS/templates/RIGS/activity_feed_data.html
+++ b/RIGS/templates/RIGS/activity_feed_data.html
@@ -40,6 +40,9 @@
{% endif %}
{% include 'RIGS/object_button.html' with object=version.new %}
+ {% if version.revision.comment %}
+ ({{ version.revision.comment }})
+ {% endif %}
diff --git a/RIGS/templates/RIGS/activity_table.html b/RIGS/templates/RIGS/activity_table.html
index bf625e44..1d491663 100644
--- a/RIGS/templates/RIGS/activity_table.html
+++ b/RIGS/templates/RIGS/activity_table.html
@@ -59,6 +59,7 @@
Version ID |
User |
Changes |
+ Comment |
@@ -75,6 +76,7 @@
{% else %}
{% include 'RIGS/version_changes.html' %}
{% endif %}
+ {{ version.revision.comment }} |
{% endfor %}
diff --git a/RIGS/templates/RIGS/version_history.html b/RIGS/templates/RIGS/version_history.html
index 163a1ac5..924ea148 100644
--- a/RIGS/templates/RIGS/version_history.html
+++ b/RIGS/templates/RIGS/version_history.html
@@ -35,6 +35,7 @@
Version ID |
User |
Changes |
+ Comment |
@@ -51,6 +52,9 @@
{% include 'RIGS/version_changes.html' %}
{% endif %}
+
+ {{ version.revision.comment }}
+ |
{% endif %}
{% endfor %}