aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-11-19 16:38:56 -0800
committerBryan Newbold <bnewbold@robocracy.org>2021-11-19 16:45:02 -0800
commitf22c278a96f46bf72d94db47fdd0efed6b61abf5 (patch)
tree340ea57d9d43e4685d097475cd695703cf9937d0
parent046ecc62ba7a60a896200895be0b34b65ac72464 (diff)
downloadfatcat-f22c278a96f46bf72d94db47fdd0efed6b61abf5.tar.gz
fatcat-f22c278a96f46bf72d94db47fdd0efed6b61abf5.zip
web editgroup diff: don't enrich in TOML diff; fix overlapping break
-rw-r--r--python/fatcat_web/entity_helpers.py12
-rw-r--r--python/fatcat_web/templates/editgroup_diff.html1
2 files changed, 8 insertions, 5 deletions
diff --git a/python/fatcat_web/entity_helpers.py b/python/fatcat_web/entity_helpers.py
index 9657e828..34a5ceb9 100644
--- a/python/fatcat_web/entity_helpers.py
+++ b/python/fatcat_web/entity_helpers.py
@@ -305,14 +305,16 @@ def _entity_edit_diff(entity_type: str, entity_edit: EntityEdit) -> List[str]:
prev_revision
redirect_ident
"""
- pop_fields = ["revision", "state"]
- new_rev = generic_get_entity_revision(entity_type, entity_edit.revision)
- new_toml = entity_to_toml(new_rev, pop_fields=pop_fields).split("\n")
+ pop_fields = ["ident", "revision", "state"]
+ new_rev = generic_get_entity_revision(entity_type, entity_edit.revision, enrich=False)
+ new_toml = entity_to_toml(new_rev, pop_fields=pop_fields).strip().split("\n")
if len(new_toml) == 1 and not new_toml[0].strip():
new_toml = []
if entity_edit.prev_revision:
- old_rev = generic_get_entity_revision(entity_type, entity_edit.prev_revision)
- old_toml = entity_to_toml(old_rev, pop_fields=pop_fields).split("\n")
+ old_rev = generic_get_entity_revision(
+ entity_type, entity_edit.prev_revision, enrich=False
+ )
+ old_toml = entity_to_toml(old_rev, pop_fields=pop_fields).strip().split("\n")
fromdesc = f"/{entity_type}/rev/{entity_edit.prev_revision}.toml"
else:
old_toml = []
diff --git a/python/fatcat_web/templates/editgroup_diff.html b/python/fatcat_web/templates/editgroup_diff.html
index 4b32fbf5..ec5e4a82 100644
--- a/python/fatcat_web/templates/editgroup_diff.html
+++ b/python/fatcat_web/templates/editgroup_diff.html
@@ -13,6 +13,7 @@
{{ entity_macros.extra_metadata(edit.extra) }}
{% endif %}
{% if edit.revision and not edit.redirect_ident and edit.ident in diffs and diffs[edit.ident] != None %}
+ <br clear="all">
<div style="border: 1px solid black; font-size: smaller; font-color: #222; word-break: break-all; margin-top: 0.5em; margin-bottom: 0.5em;">
{% for line in diffs[edit.ident] %}
{% set line_space = false %}