From 37f87d6487faada5e2cf6f666151de784a47692e Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Sat, 25 Apr 2020 12:45:36 +0200 Subject: [PATCH] Remove detaild_history.html file --- logs/templates/logs/detailed_history.html | 94 ----------------------- logs/views.py | 2 +- re2o/templates/re2o/aff_history.html | 90 +++++++++++++++------- re2o/templates/re2o/history.html | 5 +- 4 files changed, 65 insertions(+), 126 deletions(-) delete mode 100644 logs/templates/logs/detailed_history.html diff --git a/logs/templates/logs/detailed_history.html b/logs/templates/logs/detailed_history.html deleted file mode 100644 index 8ffe5d68..00000000 --- a/logs/templates/logs/detailed_history.html +++ /dev/null @@ -1,94 +0,0 @@ -{% extends 'logs/sidebar.html' %} -{% comment %} -Re2o est un logiciel d'administration développé initiallement au rezometz. Il -se veut agnostique au réseau considéré, de manière à être installable en -quelques clics. - -Copyright © 2020 Jean-Romain Garnier - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -{% endcomment %} - -{% load bootstrap3 %} -{% load i18n %} -{% load logs_extra %} - -{% block title %}{% trans "History" %}{% endblock %} - -{% block content %} -

{% blocktrans %}History of {{ title }}{% endblocktrans %}

- -{% if events %} - - - - - - - - - - {% for event in events %} - - - - - - - {% endfor %} -
{% trans "Date" %}{% trans "Performed by" %}{% trans "Edited" %}{% trans "Comment" %}
{{ event.date }} - {% if event.performed_by %} - - {{ event.performed_by }} - - {% else %} - {% trans "Unknown" %} - {% endif %} - - {% for edit in event.edits %} - {% if edit.1 is None and edit.2 is None %} - {{ edit.0 }}
- {% elif edit.1 is None %} - {{ edit.0 }}: - {{ edit.2 }}
- {% else %} - {{ edit.0 }}: - {{ edit.1 }} - ➔ {{ edit.2 }}
- {% endif %} - {% endfor %} -
{{ event.comment }}
- {% include 'pagination.html' with list=events %} -{% else %} -

{% trans "No event" %}

-{% endif %} - -{% if related_history %} - -

{% blocktrans %}Related elements{% endblocktrans %}

- - -{% endif %} -
-
-
- -{% endblock %} diff --git a/logs/views.py b/logs/views.py index 69102b31..3f9fac5e 100644 --- a/logs/views.py +++ b/logs/views.py @@ -601,6 +601,6 @@ def history(request, application, object_name, object_id): return render( request, - "logs/detailed_history.html", + "re2o/history.html", {"title": title, "events": events, "related_history": history.related}, ) diff --git a/re2o/templates/re2o/aff_history.html b/re2o/templates/re2o/aff_history.html index 6256ff23..b8c8397a 100644 --- a/re2o/templates/re2o/aff_history.html +++ b/re2o/templates/re2o/aff_history.html @@ -6,6 +6,7 @@ quelques clics. Copyright © 2017 Gabriel Détraz Copyright © 2017 Lara Kermarec Copyright © 2017 Augustin Lemesle +Copyright © 2020 Jean-Romain Garnier This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,36 +24,67 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load i18n %} +{% load logs_extra %} - {% if reversions.paginator %} - - {% endif %} - - - +{% if events %} +
+ + + + + + + + + {% for event in events %} - - - + + + + - - {% for rev in reversions %} - - - - - - {% endfor %} -
{% trans "Date" %}{% trans "Performed by" %}{% trans "Edited" %}{% trans "Comment" %}
{% trans "Date" %}{% trans "Performed by" %}{% trans "Comment" %}{{ event.date }} + {% if event.performed_by %} + + {{ event.performed_by }} + + {% else %} + {% trans "Unknown" %} + {% endif %} + + {% for edit in event.edits %} + {% if edit.1 is None and edit.2 is None %} + {{ edit.0 }}
+ {% elif edit.1 is None %} + {{ edit.0 }}: + {{ edit.2 }}
+ {% else %} + {{ edit.0 }}: + {{ edit.1 }} + ➔ {{ edit.2 }}
+ {% endif %} + {% endfor %} +
{{ event.comment }}
{{ rev.revision.date_created }}{{ rev.revision.user }}{{ rev.revision.comment }}
+ {% endfor %} + + {% include 'pagination.html' with list=events %} +{% else %} +

{% trans "No event" %}

+{% endif %} + +{% if related_history %} + +

{% blocktrans %}Related elements{% endblocktrans %}

+ + +{% endif %} +
+
+
+ diff --git a/re2o/templates/re2o/history.html b/re2o/templates/re2o/history.html index 285fd62f..53ccd587 100644 --- a/re2o/templates/re2o/history.html +++ b/re2o/templates/re2o/history.html @@ -7,6 +7,7 @@ quelques clics. Copyright © 2017 Gabriel Détraz Copyright © 2017 Lara Kermarec Copyright © 2017 Augustin Lemesle +Copyright © 2020 Jean-Romain Garnier This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,8 +30,8 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block title %}{% trans "History" %}{% endblock %} {% block content %} -

{% blocktrans %}History of {{ object }}{% endblocktrans %}

- {% include 're2o/aff_history.html' with reversions=reversions %} +

{% blocktrans %}History of {{ title }}{% endblocktrans %}

+ {% include 're2o/aff_history.html' with events=events related_history=related_history %}