{% extends "sidebar_table_layout.html" %} {% macro change_to_logging_preference(event) %} {% if event.val_after == LoggingMode.DISABLED %} {% if event.val_before == LoggingMode.ENABLED %} {{ _("Disabled Project History") }} {% else %} {{ _("Disabled Project History & IP Address Recording") }} {% endif %} {% elif event.val_after == LoggingMode.ENABLED %} {% if event.val_before == LoggingMode.DISABLED %} {{ _("Enabled Project History") }} {% elif event.val_before == LoggingMode.RECORD_IP %} {{ _("Disabled IP Address Recording") }} {% else %} {{ _("Enabled Project History") }} {% endif %} {% elif event.val_after == LoggingMode.RECORD_IP %} {% if event.val_before == LoggingMode.DISABLED %} {{ _("Enabled Project History & IP Address Recording") }} {% elif event.val_before == LoggingMode.ENABLED %} {{ _("Enabled IP Address Recording") }} {% else %} {{ _("Enabled Project History & IP Address Recording") }} {% endif %} {% else %} {# Should be unreachable #} {{ _("History Settings Changed") }} {% endif %} {% endmacro %} {% macro describe_object(event) %}{{ event.object_type }} {{ event.object_desc }}{% endmacro %} {% macro simple_property_change(event, localized_property_name, from=True) %} {{ describe_object(event) }}: {{ localized_property_name }} {{ _("changed") }} {% if from %}{{ _("from") }} {{ event.val_before }}{% endif %} {{ _("to") }} {{ event.val_after }} {% endmacro %} {% macro clear_history_modals() %}

### {{ _('Confirm Remove IP Adresses') }}

×

{{ _("Are you sure you want to delete all recorded IP addresses from this project? The rest of the project history will be unaffected. This action cannot be undone.") }}

### {{ _('Delete Confirmation') }}

×

{{ _("Are you sure you want to erase all history for this project? This action cannot be undone.") }}

{% endmacro %} {% macro owers_changed(event, add) %} {{ describe_object(event) }}: {% if add %}{{ _("Added") }}{% else %}{{ _("Removed") }}{% endif %} {% if event.val_after|length > 1 %} {% for name in event.val_after %} {{ name }}{% if event.val_after|length > 2 and loop.index != event.val_after|length %},{% endif %} {% if loop.index == event.val_after|length - 1 %} {{ _("and") }} {% endif %} {% endfor %} {% else %} {{ event.val_after[0] }} {% endif %} {% if add %}{{ _("to") }}{% else %}{{ _("from") }}{% endif %} {{ _("owers list") }} {% endmacro %} {% block sidebar %}
{{ balance_table(show_weight=False, show_header=True) }}
{% endblock %} {% block content %} {% if current_log_pref == LoggingMode.DISABLED or (current_log_pref != LoggingMode.RECORD_IP and any_ip_addresses) %}
{% if current_log_pref == LoggingMode.DISABLED %}

{% set url = url_for(".edit_project") %} {% trans %} This project has history disabled. New actions won't appear below. You can enable history on the settings page {% endtrans %}

{% if history %}

{% trans %} The table below reflects actions recorded prior to disabling project history. You can clear project history to remove them.

{% endtrans %} {% endif %} {% endif %} {% if current_log_pref != LoggingMode.RECORD_IP and any_ip_addresses %}

{{ _("Some entries below contain IP addresses, even though this project has IP recording disabled. ") }} {{ _("Delete stored IP addresses") }}

{% endif %}
{% endif %} {{ clear_history_modals() }} {{ static_include("images/x.svg") | safe }} {{ _("Clear Project History") }} {{ static_include("images/x.svg") | safe }} {{ _("Delete Stored IP Addresses") }}
{% if history %}

{{ _("Time") }} | {{ _("Event") }} | {{ _("From IP") }}
--- | --- | ---
{% for event in history %}
| {% if event.operation_type == OperationType.INSERT %} {{ event.object_type }} {{ event.object_desc }} {{ _("added") }} {% elif event.operation_type == OperationType.UPDATE %} {% if event.object_type == _("Project") %} {% if event.prop_changed == "password" %} {{ _("Project private code changed") }} {% elif event.prop_changed == "logging_preference" %} {{ change_to_logging_preference(event) }} {% elif event.prop_changed == "name" %} {{ _("Project renamed to") }} {{ event.val_after }} {% elif event.prop_changed == "contact_email" %} {{ _("Project contact email changed to") }} {{ event.val_after }} {% else %} {{ _("Project settings modified") }} {% endif %} {% elif event.prop_changed == "activated" %} {{ event.object_type }} {{ event.object_desc }} {% if event.val_after == False %}{{ _("deactivated") }}{% else %}{{ _("reactivated") }}{% endif %} {% elif event.prop_changed == "name" or event.prop_changed == "what" %} {{ describe_object(event) }} {{ _("renamed to") }} {{ event.val_after }} {% elif event.prop_changed == "weight" %} {{ simple_property_change(event, _("Weight")) }} {% elif event.prop_changed == "external_link" %} {{ describe_object(event) }}: {{ _("External link changed to") }} {{ event.val_after }} {% elif event.prop_changed == "owers_added" %} {{ owers_changed(event, True)}} {% elif event.prop_changed == "owers_removed" %} {{ owers_changed(event, False)}} {% elif event.prop_changed == "payer" %} {{ simple_property_change(event, _("Payer"))}} {% elif event.prop_changed == "amount" %} {{ simple_property_change(event, _("Amount")) }} {% elif event.prop_changed == "date" %} {{ simple_property_change(event, _("Date")) }} {% elif event.prop_changed == "original_currency" %} {{ simple_property_change(event, _("Currency")) }} {% elif event.prop_changed == "converted_amount" %} {{ simple_property_change(event, _("Amount in %(currency)s", currency=g.project.default_currency)) }} {% else %} {{ describe_object(event) }} {{ _("modified") }} {% endif %} {% elif event.operation_type == OperationType.DELETE %} {{ event.object_type }} {{ event.object_desc }} {{ _("removed") }} {% else %} {# Should be unreachable #} {{ describe_object(event) }} {{ _("changed in a unknown way") }} {% endif %} | {% if event.ip %}{{ event.ip }}{% else %} -- {% endif %}
{% endfor %}

{% else %}
{{ static_include("images/bill.svg") | safe }}

### {{ _('Nothing to list')}}

{{ _("Someone probably cleared the project history.") }}

{% endif %} {% endblock %}