diff --git a/re2o/templates/re2o/aff_history.html b/re2o/templates/re2o/aff_history.html
new file mode 100644
index 00000000..d2019c67
--- /dev/null
+++ b/re2o/templates/re2o/aff_history.html
@@ -0,0 +1,16 @@
+
+
+
+ Date |
+ Cableur |
+ Commentaire |
+
+
+ {% for rev in reversions %}
+
+ {{ rev.revision.date_created }} |
+ {{ rev.revision.user }} |
+ {{ rev.revision.comment }} |
+
+ {% endfor %}
+
diff --git a/re2o/templates/re2o/history.html b/re2o/templates/re2o/history.html
new file mode 100644
index 00000000..d78eb377
--- /dev/null
+++ b/re2o/templates/re2o/history.html
@@ -0,0 +1,12 @@
+{% extends "re2o/sidebar.html" %}
+{% load bootstrap3 %}
+
+{% block title %}Historique{% endblock %}
+
+{% block content %}
+Historique de {{ object }}
+ {% include "re2o/aff_history.html" with reversions=reversions %}
+
+
+
+{% endblock %}
diff --git a/topologie/admin.py b/topologie/admin.py
index 68598ac1..6d651876 100644
--- a/topologie/admin.py
+++ b/topologie/admin.py
@@ -1,15 +1,16 @@
from django.contrib import admin
+from reversion.admin import VersionAdmin
from .models import Port, Room, Switch
-class SwitchAdmin(admin.ModelAdmin):
+class SwitchAdmin(VersionAdmin):
list_display = ('building','number','details')
-class PortAdmin(admin.ModelAdmin):
+class PortAdmin(VersionAdmin):
list_display = ('switch', 'port','room','machine_interface','details')
-class RoomAdmin(admin.ModelAdmin):
+class RoomAdmin(VersionAdmin):
list_display = ('name','details')
admin.site.register(Port, PortAdmin)
diff --git a/topologie/models.py b/topologie/models.py
index 47350f76..f85f7fa7 100644
--- a/topologie/models.py
+++ b/topologie/models.py
@@ -3,6 +3,7 @@ from django.forms import ModelForm, Form
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
from django.core.exceptions import ValidationError
+import reversion
def make_port_related(port):
related_port = port.related
diff --git a/topologie/templates/topologie/aff_chambres.html b/topologie/templates/topologie/aff_chambres.html
index 2937a051..b77ddbcc 100644
--- a/topologie/templates/topologie/aff_chambres.html
+++ b/topologie/templates/topologie/aff_chambres.html
@@ -11,7 +11,8 @@
{{room.name}} |
{{room.details}} |
{% if is_infra %} Editer
- Supprimer{% endif %} |
+ Supprimer{% endif %}
+ Historique
{% endfor %}
diff --git a/topologie/templates/topologie/aff_port.html b/topologie/templates/topologie/aff_port.html
index 4976a9fd..bb0b7a3a 100644
--- a/topologie/templates/topologie/aff_port.html
+++ b/topologie/templates/topologie/aff_port.html
@@ -16,7 +16,8 @@
{{ port.machine_interface }} |
{{ port.related }} |
{{ port.details }} |
- {% if is_infra %} Editer{% endif %} |
+ {% if is_infra %} Editer{% endif %}
+ Historique |
{% endfor %}
diff --git a/topologie/templates/topologie/aff_switch.html b/topologie/templates/topologie/aff_switch.html
index 24d04761..cc80b12e 100644
--- a/topologie/templates/topologie/aff_switch.html
+++ b/topologie/templates/topologie/aff_switch.html
@@ -12,7 +12,8 @@
{{switch.building}} |
{{switch.number}} |
{{switch.details}} |
- Configurer |
+ Configurer
+ Historique |
{% endfor %}
diff --git a/topologie/urls.py b/topologie/urls.py
index 7f75a096..e8df7722 100644
--- a/topologie/urls.py
+++ b/topologie/urls.py
@@ -10,6 +10,9 @@ urlpatterns = [
url(r'^edit_room/(?P[0-9]+)$', views.edit_room, name='edit-room'),
url(r'^del_room/(?P[0-9]+)$', views.del_room, name='del-room'),
url(r'^switch/(?P[0-9]+)$', views.index_port, name='index-port'),
+ url(r'^history/(?P