From 6679afbb6bf86f775235614e530bc3034081374d Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 9 Nov 2014 17:04:04 +0100 Subject: [PATCH] Added "created" snapshot operation --- public_html/templates/history.tpl | 8 ++- src/Entities/Snapshot.php | 5 +- src/Services/ISnapshotProvider.php | 10 ++++ src/Services/PostHistoryService.php | 9 +++- src/Services/PostService.php | 2 +- src/Services/PostSnapshotProvider.php | 58 ++++++++++++-------- src/Services/TagHistoryService.php | 9 +++- src/Services/TagService.php | 2 +- src/Services/TagSnapshotProvider.php | 59 +++++++++++++-------- src/Upgrades/Upgrade33.php | 19 +++++++ src/di.php | 1 + tests/Services/PostServiceTest.php | 10 ++-- tests/Services/PostSnapshotProviderTest.php | 4 +- 13 files changed, 134 insertions(+), 62 deletions(-) create mode 100644 src/Services/ISnapshotProvider.php create mode 100644 src/Upgrades/Upgrade33.php diff --git a/public_html/templates/history.tpl b/public_html/templates/history.tpl index ad4c51c9..f946657f 100644 --- a/public_html/templates/history.tpl +++ b/public_html/templates/history.tpl @@ -48,10 +48,14 @@ var reprValue = function(value) { - <% if (historyEntry.operation == 1) { %> + <% if (historyEntry.operation == 2) { %> deleted <% } else { %> - changed + <% if (historyEntry.operation == 0) { %> + added + <% } else { %> + changed + <% } %> <% if (historyEntry.dataDifference) { %>