{% extends "base.html" %} {#- The history of one company or contact (pages/live.py): the commits that touched its files, newest first, PER_PAGE at a time. Each Undo posts to /live/undo and comes back here. -#} {% block title %}History: {{ record_name }}{% endblock %} {% block content %}

← {{ record_name }}

History: {{ record_name }}

Every change to this record is a commit in your data folder, newest first. Undo makes a new commit that reverses one; nothing is ever erased. How this works

{% if changes %}
{% for c in changes %} {% endfor %}
WhenChangeBefore → after
{{ when_text(c.when) }} {{ c.words }}{% if c.agent %} agent{% endif %} {{ c.sha7 }} {% if c.added and c.fields %}
Created with {{ c.fields | length }} field{{ '' if c.fields | length == 1 else 's' }}
    {% for f in c.fields %}
  • {{ f.name }}: {{ f.after }}
  • {% endfor %}
{% elif c.deleted %}Deleted {% elif c.fields %}
    {% for f in c.fields %}
  • {{ f.name }}: {% if f.before %}{{ f.before }}{% else %}empty{% endif %} → {% if f.after %}{{ f.after }}{% else %}empty{% endif %}
  • {% endfor %}
{% endif %} {% if c.body_changed and not c.added %}

Notes text changed.

{% endif %} {% if c.others %}

{{ c.others[:5] | join(', ') }}{% if c.others | length > 5 %} and {{ c.others | length - 5 }} more{% endif %}

{% endif %} {% if c.elsewhere %}

The same change also touched {{ c.elsewhere }} other file{{ '' if c.elsewhere == 1 else 's' }} in your folder.{% if c.can_undo %} Undo reverses all of it.{% endif %}

{% endif %}
{% if c.can_undo %}
{% elif c.undone %}undone {% elif c.merge %}merge {% else %}first commit{% endif %}
{% if newer_url or older_url %}

{% if newer_url %}← Newer{% endif %}{% if newer_url and older_url %} · {% endif %}{% if older_url %}Older →{% endif %}

{% endif %}

{{ per_page }} changes a page. In a terminal: git log -- <file> and hermitcrm undo <commit>.

{% else %}

No history yet: this record has no commit in the folder's history, or the folder is not a git repository.

{% endif %} {% endblock %}