Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
a84e8b55
Commit
a84e8b55
authored
Jul 22, 2018
by
chirac
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_65_history' into 'master'
fix #65, gestion propre de l'historique. Closes #65 See merge request federez/re2o!186
parents
f6a152f0
c7bf2958
Changes
51
Hide whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
1227 additions
and
1282 deletions
+1227
-1282
cotisations/templates/cotisations/aff_article.html
cotisations/templates/cotisations/aff_article.html
+4
-5
cotisations/templates/cotisations/aff_banque.html
cotisations/templates/cotisations/aff_banque.html
+5
-6
cotisations/templates/cotisations/aff_cotisations.html
cotisations/templates/cotisations/aff_cotisations.html
+2
-3
cotisations/templates/cotisations/aff_paiement.html
cotisations/templates/cotisations/aff_paiement.html
+2
-3
cotisations/urls.py
cotisations/urls.py
+0
-7
logs/templatetags/logs_extra.py
logs/templatetags/logs_extra.py
+20
-0
logs/urls.py
logs/urls.py
+5
-0
logs/views.py
logs/views.py
+67
-7
machines/templates/machines/aff_alias.html
machines/templates/machines/aff_alias.html
+18
-17
machines/templates/machines/aff_extension.html
machines/templates/machines/aff_extension.html
+12
-11
machines/templates/machines/aff_iptype.html
machines/templates/machines/aff_iptype.html
+10
-9
machines/templates/machines/aff_ipv6.html
machines/templates/machines/aff_ipv6.html
+23
-22
machines/templates/machines/aff_machines.html
machines/templates/machines/aff_machines.html
+153
-152
machines/templates/machines/aff_machinetype.html
machines/templates/machines/aff_machinetype.html
+20
-19
machines/templates/machines/aff_mx.html
machines/templates/machines/aff_mx.html
+22
-21
machines/templates/machines/aff_nas.html
machines/templates/machines/aff_nas.html
+25
-24
machines/templates/machines/aff_ns.html
machines/templates/machines/aff_ns.html
+20
-19
machines/templates/machines/aff_servers.html
machines/templates/machines/aff_servers.html
+20
-20
machines/templates/machines/aff_service.html
machines/templates/machines/aff_service.html
+25
-24
machines/templates/machines/aff_soa.html
machines/templates/machines/aff_soa.html
+28
-27
machines/templates/machines/aff_srv.html
machines/templates/machines/aff_srv.html
+33
-32
machines/templates/machines/aff_txt.html
machines/templates/machines/aff_txt.html
+20
-19
machines/templates/machines/aff_vlan.html
machines/templates/machines/aff_vlan.html
+8
-7
machines/urls.py
machines/urls.py
+0
-5
preferences/templates/preferences/aff_service.html
preferences/templates/preferences/aff_service.html
+2
-1
preferences/urls.py
preferences/urls.py
+0
-7
re2o/views.py
re2o/views.py
+7
-126
templates/buttons/history.html
templates/buttons/history.html
+3
-2
topologie/templates/topologie/aff_ap.html
topologie/templates/topologie/aff_ap.html
+41
-42
topologie/templates/topologie/aff_building.html
topologie/templates/topologie/aff_building.html
+12
-13
topologie/templates/topologie/aff_chambres.html
topologie/templates/topologie/aff_chambres.html
+13
-14
topologie/templates/topologie/aff_constructor_switch.html
topologie/templates/topologie/aff_constructor_switch.html
+12
-13
topologie/templates/topologie/aff_model_switch.html
topologie/templates/topologie/aff_model_switch.html
+15
-16
topologie/templates/topologie/aff_port.html
topologie/templates/topologie/aff_port.html
+58
-59
topologie/templates/topologie/aff_repr_switch.html
topologie/templates/topologie/aff_repr_switch.html
+74
-74
topologie/templates/topologie/aff_stacks.html
topologie/templates/topologie/aff_stacks.html
+22
-23
topologie/templates/topologie/aff_switch.html
topologie/templates/topologie/aff_switch.html
+48
-47
topologie/templates/topologie/aff_switch_bay.html
topologie/templates/topologie/aff_switch_bay.html
+19
-20
topologie/templates/topologie/edit_stack_sw.html
topologie/templates/topologie/edit_stack_sw.html
+20
-21
topologie/urls.py
topologie/urls.py
+0
-5
users/templates/users/aff_bans.html
users/templates/users/aff_bans.html
+22
-21
users/templates/users/aff_clubs.html
users/templates/users/aff_clubs.html
+29
-29
users/templates/users/aff_listright.html
users/templates/users/aff_listright.html
+24
-23
users/templates/users/aff_rights.html
users/templates/users/aff_rights.html
+13
-13
users/templates/users/aff_schools.html
users/templates/users/aff_schools.html
+9
-8
users/templates/users/aff_serviceusers.html
users/templates/users/aff_serviceusers.html
+25
-24
users/templates/users/aff_shell.html
users/templates/users/aff_shell.html
+21
-20
users/templates/users/aff_users.html
users/templates/users/aff_users.html
+6
-6
users/templates/users/aff_whitelists.html
users/templates/users/aff_whitelists.html
+21
-20
users/templates/users/profil.html
users/templates/users/profil.html
+169
-171
users/urls.py
users/urls.py
+0
-5
No files found.
cotisations/templates/cotisations/aff_article.html
View file @
a84e8b55
...
...
@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load i18n %}
{% load logs_extra %}
<table
class=
"table table-striped"
>
<thead>
...
...
@@ -46,14 +47,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>
{{ article.type_user }}
</td>
<td>
{{ article.available_for_everyone }}
</td>
<td
class=
"text-right"
>
{% can_edit article %}
{% can_edit article %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
title=
"{% trans "
Edit
"
%}"
href=
"{% url 'cotisations:edit-article' article.id %}"
>
<i
class=
"fa fa-edit"
></i>
</a>
{% acl_end %}
<a
class=
"btn btn-info btn-sm"
role=
"button"
title=
"{% trans "
Historique
"
%}"
href=
"{% url 'cotisations:history' 'article' article.id %}"
>
<i
class=
"fa fa-history"
></i>
</a>
{% acl_end %}
{% history_button article %}
</td>
</tr>
{% endfor %}
...
...
cotisations/templates/cotisations/aff_banque.html
View file @
a84e8b55
...
...
@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load i18n %}
{% load logs_extra %}
<table
class=
"table table-striped"
>
<thead>
...
...
@@ -36,14 +37,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<td>
{{ banque.name }}
</td>
<td
class=
"text-right"
>
{% can_edit banque %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
title=
"{% trans "
Edit
"
%}"
href=
"{% url 'cotisations:edit-banque' banque.id %}"
>
{% can_edit banque %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
title=
"{% trans "
Edit
"
%}"
href=
"{% url 'cotisations:edit-banque' banque.id %}"
>
<i
class=
"fa fa-edit"
></i>
</a>
{% acl_end %}
<a
class=
"btn btn-info btn-sm"
role=
"button"
title=
"{% trans "
Historique
"
%}"
href=
"{% url 'cotisations:history' 'banque' banque.id %}"
>
<i
class=
"fa fa-history"
></i>
</a>
{% acl_end %}
{% history_button banque %}
</td>
</tr>
{% endfor %}
...
...
cotisations/templates/cotisations/aff_cotisations.html
View file @
a84e8b55
...
...
@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load i18n %}
{% load logs_extra %}
<div
class=
"table-responsive"
>
{% if facture_list.paginator %}
...
...
@@ -86,9 +87,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</li>
{% acl_end %}
<li>
<a
href=
"{% url 'cotisations:history' 'facture' facture.id %}"
>
<i
class=
"fa fa-history"
></i>
{% trans "Historique" %}
</a>
{% history_button facture text=True html_class=False%}
</li>
</ul>
</div>
...
...
cotisations/templates/cotisations/aff_paiement.html
View file @
a84e8b55
...
...
@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load i18n %}
{% load logs_extra %}
<table
class=
"table table-striped"
>
<thead>
...
...
@@ -47,9 +48,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<i
class=
"fa fa-edit"
></i>
</a>
{% acl_end %}
<a
class=
"btn btn-info btn-sm"
role=
"button"
title=
"{% trans "
Historique
"
%}"
href=
"{% url 'cotisations:history' 'paiement' paiement.id %}"
>
<i
class=
"fa fa-history"
></i>
</a>
{% history_button paiement %}
</td>
</tr>
{% endfor %}
...
...
cotisations/urls.py
View file @
a84e8b55
...
...
@@ -27,7 +27,6 @@ from __future__ import unicode_literals
from
django.conf.urls
import
url
import
re2o
from
.
import
views
from
.
import
payment_methods
...
...
@@ -122,12 +121,6 @@ urlpatterns = [
views
.
index_paiement
,
name
=
'index-paiement'
),
url
(
r
'history/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$'
,
re2o
.
views
.
history
,
name
=
'history'
,
kwargs
=
{
'application'
:
'cotisations'
},
),
url
(
r
'^control/$'
,
views
.
control
,
...
...
logs/templatetags/logs_extra.py
View file @
a84e8b55
...
...
@@ -33,3 +33,23 @@ register = template.Library()
def
classname
(
obj
):
""" Returns the object class name """
return
obj
.
__class__
.
__name__
@
register
.
inclusion_tag
(
'buttons/history.html'
)
def
history_button
(
instance
,
text
=
False
,
html_class
=
True
):
"""Creates the correct history button for an instance.
Args:
instance: The instance of which you want to get history buttons.
text: Flag stating if a 'History' text should be displayed.
html_class: Flag stating if the link should have the html classes
allowing it to be displayed as a button.
"""
return
{
'application'
:
instance
.
_meta
.
app_label
,
'name'
:
instance
.
_meta
.
model_name
,
'id'
:
instance
.
id
,
'text'
:
text
,
'class'
:
html_class
,
}
logs/urls.py
View file @
a84e8b55
...
...
@@ -39,4 +39,9 @@ urlpatterns = [
url
(
r
'^stats_models/$'
,
views
.
stats_models
,
name
=
'stats-models'
),
url
(
r
'^stats_users/$'
,
views
.
stats_users
,
name
=
'stats-users'
),
url
(
r
'^stats_actions/$'
,
views
.
stats_actions
,
name
=
'stats-actions'
),
url
(
r
'(?P<application>\w+)/(?P<object_name>\w+)/(?P<object_id>[0-9]+)$'
,
views
.
history
,
name
=
'history'
,
),
]
logs/views.py
View file @
a84e8b55
...
...
@@ -2,9 +2,10 @@
# se veut agnostique au réseau considéré, de manière à être installable en
# quelques clics.
#
# Copyright © 2017 Gabriel Détraz
# Copyright © 2017 Goulven Kermarec
# Copyright © 2017 Augustin Lemesle
# Copyright © 2018 Gabriel Détraz
# Copyright © 2018 Goulven Kermarec
# Copyright © 2018 Augustin Lemesle
# Copyright © 2018 Hugo Levy-Falk
#
# 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
...
...
@@ -36,12 +37,16 @@ nombre d'objets par models, nombre d'actions par user, etc
"""
from
__future__
import
unicode_literals
from
itertools
import
chain
from
django.urls
import
reverse
from
django.shortcuts
import
render
,
redirect
from
django.contrib
import
messages
from
django.contrib.auth.decorators
import
login_required
from
django.db.models
import
Count
,
Max
,
F
from
django.http
import
Http404
from
django.db.models
import
Count
from
django.apps
import
apps
from
django.utils.translation
import
ugettext
as
_
from
reversion.models
import
Revision
from
reversion.models
import
Version
,
ContentType
...
...
@@ -142,7 +147,7 @@ def index(request):
'comment'
:
version
.
revision
.
comment
,
'datetime'
:
version
.
revision
.
date_created
.
strftime
(
'%d/%m/%y %H:%M:%S'
),
),
'username'
:
version
.
revision
.
user
.
get_username
()
if
version
.
revision
.
user
else
'?'
,
...
...
@@ -173,7 +178,7 @@ def stats_logs(request):
revisions
=
re2o_paginator
(
request
,
revisions
,
pagination_number
)
return
render
(
request
,
'logs/stats_logs.html'
,
{
'revisions_list'
:
revisions
})
})
@
login_required
...
...
@@ -191,7 +196,7 @@ def revert_action(request, revision_id):
return
form
({
'objet'
:
revision
,
'objet_name'
:
revision
.
__class__
.
__name__
},
'logs/delete.html'
,
request
)
},
'logs/delete.html'
,
request
)
@
login_required
...
...
@@ -453,3 +458,58 @@ def stats_actions(request):
},
}
return
render
(
request
,
'logs/stats_users.html'
,
{
'stats_list'
:
stats
})
def
history
(
request
,
application
,
object_name
,
object_id
):
"""Render history for a model.
The model is determined using the `HISTORY_BIND` dictionnary if none is
found, raises a Http404. The view checks if the user is allowed to see the
history using the `can_view` method of the model.
Args:
request: The request sent by the user.
application: Name of the application.
object_name: Name of the model.
object_id: Id of the object you want to acces history.
Returns:
The rendered page of history if access is granted, else the user is
redirected to their profile page, with an error message.
Raises:
Http404: This kind of models doesn't have history.
"""
try
:
model
=
apps
.
get_model
(
application
,
object_name
)
except
LookupError
:
raise
Http404
(
_
(
"No model found."
))
object_name_id
=
object_name
+
'id'
kwargs
=
{
object_name_id
:
object_id
}
try
:
instance
=
model
.
get_instance
(
**
kwargs
)
except
model
.
DoesNotExist
:
messages
.
error
(
request
,
_
(
"No entry found."
))
return
redirect
(
reverse
(
'users:profil'
,
kwargs
=
{
'userid'
:
str
(
request
.
user
.
id
)}
))
can
,
msg
=
instance
.
can_view
(
request
.
user
)
if
not
can
:
messages
.
error
(
request
,
msg
or
_
(
"You cannot acces to this menu"
))
return
redirect
(
reverse
(
'users:profil'
,
kwargs
=
{
'userid'
:
str
(
request
.
user
.
id
)}
))
pagination_number
=
GeneralOption
.
get_cached_value
(
'pagination_number'
)
reversions
=
Version
.
objects
.
get_for_object
(
instance
)
if
hasattr
(
instance
,
'linked_objects'
):
for
related_object
in
chain
(
instance
.
linked_objects
()):
reversions
=
(
reversions
|
Version
.
objects
.
get_for_object
(
related_object
))
reversions
=
re2o_paginator
(
request
,
reversions
,
pagination_number
)
return
render
(
request
,
're2o/history.html'
,
{
'reversions'
:
reversions
,
'object'
:
instance
}
)
machines/templates/machines/aff_alias.html
View file @
a84e8b55
...
...
@@ -23,24 +23,25 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load logs_extra %}
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
Alias
</th>
<th></th>
</tr>
</thead>
{% for alias in alias_list %}
<table
class=
"table table-striped"
>
<thead>
<tr>
<td>
{{ alias }}
</td>
<td
class=
"text-right"
>
{% can_edit alias %}
{% include 'buttons/edit.html' with href='machines:edit-alias' id=alias.id %}
{% acl_end %}
{% include 'buttons/history.html' with href='machines:history' name='domain' id=alias.id %}
</td>
<th>
Alias
</th>
<th></th>
</tr>
{% endfor %}
</table>
</thead>
{% for alias in alias_list %}
<tr>
<td>
{{ alias }}
</td>
<td
class=
"text-right"
>
{% can_edit alias %}
{% include 'buttons/edit.html' with href='machines:edit-alias' id=alias.id %}
{% acl_end %}
{% history_button alias %}
</td>
</tr>
{% endfor %}
</table>
machines/templates/machines/aff_extension.html
View file @
a84e8b55
...
...
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load logs_extra %}
<div
class=
"table-responsive"
>
<table
class=
"table table-striped"
>
...
...
@@ -30,28 +31,28 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<th>
Extension
</th>
<th>
Droit infra pour utiliser ?
</th>
<th>
Enregistrement SOA
</th>
<th>
Enregistrement A origin
</th>
{% if ipv6_enabled %}
<th>
Enregistrement AAAA origin
</th>
{% endif %}
<th></th>
<th>
Enregistrement SOA
</th>
<th>
Enregistrement A origin
</th>
{% if ipv6_enabled %}
<th>
Enregistrement AAAA origin
</th>
{% endif %}
<th></th>
</tr>
</thead>
{% for extension in extension_list %}
<tr>
<tr>
<td>
{{ extension.name }}
</td>
<td>
{{ extension.need_infra }}
</td>
<td>
{{ extension.soa}}
</td>
<td>
{{ extension.origin }}
</td>
<td>
{{ extension.origin }}
</td>
{% if ipv6_enabled %}
<td>
{{ extension.origin_v6 }}
</td>
{% endif %}
<td
class=
"text-right"
>
{% can_edit extension %}
{% can_edit extension %}
{% include 'buttons/edit.html' with href='machines:edit-extension' id=extension.id %}
{% acl_end %}
{%
include 'buttons/history.html' with href='machines:history' name='extension' id=extension.id
%}
{% acl_end %}
{%
history_button extension
%}
</td>
</tr>
{% endfor %}
...
...
machines/templates/machines/aff_iptype.html
View file @
a84e8b55
...
...
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load logs_extra %}
<div
class=
"table-responsive"
>
<table
class=
"table table-striped"
>
<thead>
...
...
@@ -31,10 +32,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<th>
Extension
</th>
<th>
Nécessite l'autorisation infra
</th>
<th>
Plage ipv4
</th>
<th>
Préfixe v6
</th>
<th>
Préfixe v6
</th>
<th>
Sur vlan
</th>
<th>
Ouverture ports par défault
</th>
<th></th>
<th>
Ouverture ports par défault
</th>
<th></th>
<th></th>
</tr>
</thead>
...
...
@@ -43,15 +44,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>
{{ type.type }}
</td>
<td>
{{ type.extension }}
</td>
<td>
{{ type.need_infra }}
</td>
<td>
{{ type.domaine_ip_start }}-{{ type.domaine_ip_stop }}
</td>
<td>
{{ type.prefix_v6 }}
</td>
<td>
{{ type.domaine_ip_start }}-{{ type.domaine_ip_stop }}
</td>
<td>
{{ type.prefix_v6 }}
</td>
<td>
{{ type.vlan }}
</td>
<td>
{{ type.ouverture_ports }}
</td>
<td>
{{ type.ouverture_ports }}
</td>
<td
class=
"text-right"
>
{% can_edit type %}
{% can_edit type %}
{% include 'buttons/edit.html' with href='machines:edit-iptype' id=type.id %}
{% acl_end %}
{%
include 'buttons/history.html' with href='machines:history' name='iptype' id=type.id
%}
{% acl_end %}
{%
history_button type
%}
</td>
</tr>
{% endfor %}
...
...
machines/templates/machines/aff_ipv6.html
View file @
a84e8b55
...
...
@@ -23,29 +23,30 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load logs_extra %}
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
Ipv6
</th>
<th>
Slaac
</th>
<th></th>
</tr>
</thead>
{% for ipv6 in ipv6_list %}
<table
class=
"table table-striped"
>
<thead>
<tr>
<td>
{{ ipv6.ipv6 }}
</td>
<td>
{{ ipv6.slaac_ip }}
</td>
<td
class=
"text-right"
>
{% can_edit ipv6 %}
{% include 'buttons/edit.html' with href='machines:edit-ipv6list' id=ipv6.id %}
{% acl_end %}
{% can_delete ipv6 %}
{% include 'buttons/suppr.html' with href='machines:del-ipv6list' id=ipv6.id %}
{% acl_end %}
{% include 'buttons/history.html' with href='machines:history' name='ipv6list' id=ipv6.id %}
</td>
<th>
Ipv6
</th>
<th>
Slaac
</th>
<th></th>
</tr>
{% endfor %}
</table>
</thead>
{% for ipv6 in ipv6_list %}
<tr>
<td>
{{ ipv6.ipv6 }}
</td>
<td>
{{ ipv6.slaac_ip }}
</td>
<td
class=
"text-right"
>
{% can_edit ipv6 %}
{% include 'buttons/edit.html' with href='machines:edit-ipv6list' id=ipv6.id %}
{% acl_end %}
{% can_delete ipv6 %}
{% include 'buttons/suppr.html' with href='machines:del-ipv6list' id=ipv6.id %}
{% acl_end %}
{% history_button ipv6 %}
</td>
</tr>
{% endfor %}
</table>
machines/templates/machines/aff_machines.html
View file @
a84e8b55
...
...
@@ -22,165 +22,166 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}
{% load acl %}
{% load acl %}
{% load logs_extra %}
<div
class=
"table-responsive"
>
{% if machines_list.paginator %}
{% include "pagination.html" with list=machines_list %}
{% endif %}
{% if machines_list.paginator %}
{% include "pagination.html" with list=machines_list %}
{% endif %}
<table
class=
"table"
id=
"machines_table"
>
<colgroup>
<col>
<col>
<col>
<col
width=
"{% if ipv6_enabled %}300{% else %}150{% endif %}px"
>
<col
width=
"144px"
>
</colgroup>
<thead>
<th>
{% include "buttons/sort.html" with prefix='machine' col='name' text='Nom DNS' %}
</th>
<th>
Type
</th>
<th>
MAC
</th>
<th>
IP
</th>
<th>
Actions
</th>
<tbody>
{% for machine in machines_list %}
<tr
class=
"info"
>
<td
colspan=
"4"
>
<b>
{{ machine.name|default:'
<i>
Pas de nom
</i>
' }}
</b>
<i
class=
"fa-angle-right"
></i>
<a
href=
"{% url 'users:profil' userid=machine.user.id %}"
title=
"Voir le profil"
>
<i
class=
"fa fa-user"
></i>
{{ machine.user }}
</a>
</td>
<td
class=
"text-right"
>
{% can_create Interface machine.id %}
{% include 'buttons/add.html' with href='machines:new-interface' id=machine.id desc='Ajouter une interface' %}
{% acl_end %}
{% include 'buttons/history.html' with href='machines:history' name='machine' id=machine.id %}
{% can_delete machine %}
{% include 'buttons/suppr.html' with href='machines:del-machine' id=machine.id %}
{% acl_end %}
</td>
</tr>
{% for interface in machine.interface_set.all %}
<tr>
<td>
{% if interface.domain.related_domain.all %}
{{ interface.domain }}
<button
class=
"btn btn-default btn-xs"
type=
"button"
data-toggle=
"collapse"
data-target=
"#collapseDomain_{{interface.id}}"
aria-expanded=
"true"
aria-controls=
"collapseDomain_{{interface.id}}"
>
Afficher les alias
</button>
{% else %}
{{ interface.domain }}
{% endif %}
</td>
<td>
{{ interface.type }}
</td>
<td>
{{ interface.mac_address }}
</td>
<td>
<b>
IPv4
</b>
{{ interface.ipv4 }}
<br>
{% if ipv6_enabled and interface.ipv6 != 'None'%}
<b>
IPv6
</b>
<button
class=
"btn btn-default btn-xs"
type=
"button"
data-toggle=
"collapse"
data-target=
"#collapseIpv6_{{interface.id}}"
aria-expanded=
"true"
aria-controls=
"collapseIpv6_{{interface.id}}"
>
Afficher l'IPV6
</button>
{% endif %}
</td>
<td
class=
"text-right"
>
<div
style=
"width: 128px;"
>
<div
class=
"btn-group"
role=
"group"
>
<button
class=
"btn btn-primary btn-sm dropdown-toggle"
type=
"button"
id=
"editioninterface"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"true"
>
<i
class=
"fa fa-edit"
></i>
<span
class=
"caret"
></span>
<table
class=
"table"
id=
"machines_table"
>
<colgroup>
<col>
<col>
<col>
<col
width=
"{% if ipv6_enabled %}300{% else %}150{% endif %}px"
>
<col
width=
"144px"
>
</colgroup>
<thead>
<th>
{% include "buttons/sort.html" with prefix='machine' col='name' text='Nom DNS' %}
</th>
<th>
Type
</th>
<th>
MAC
</th>
<th>
IP
</th>
<th>
Actions
</th>
<tbody>
{% for machine in machines_list %}
<tr
class=
"info"
>
<td
colspan=
"4"
>
<b>
{{ machine.name|default:'
<i>
Pas de nom
</i>
' }}
</b>
<i
class=
"fa-angle-right"
></i>
<a
href=
"{% url 'users:profil' userid=machine.user.id %}"
title=
"Voir le profil"
>
<i
class=
"fa fa-user"
></i>
{{ machine.user }}
</a>
</td>
<td
class=
"text-right"
>
{% can_create Interface machine.id %}
{% include 'buttons/add.html' with href='machines:new-interface' id=machine.id desc='Ajouter une interface' %}
{% acl_end %}
{% history_button machine %}
{% can_delete machine %}
{% include 'buttons/suppr.html' with href='machines:del-machine' id=machine.id %}
{% acl_end %}
</td>
</tr>
{% for interface in machine.interface_set.all %}
<tr>
<td>
{% if interface.domain.related_domain.all %}
{{ interface.domain }}
<button
class=
"btn btn-default btn-xs"
type=
"button"
data-toggle=
"collapse"
data-target=
"#collapseDomain_{{interface.id}}"
aria-expanded=
"true"
aria-controls=
"collapseDomain_{{interface.id}}"
>
Afficher les alias
</button>
<ul
class=
"dropdown-menu pull-right"
aria-labelledby=
"editioninterface"
>
{% can_edit interface %}
<li>
<a
href=
"{% url 'machines:edit-interface' interface.id %}"
>
<i
class=
"fa fa-edit"
></i>
Editer
</a>
</li>
{% acl_end %}
{% can_create Domain interface.id %}
<li>
<a
href=
"{% url 'machines:index-alias' interface.id %}"
>
<i
class=
"fa fa-edit"
></i>
Gerer les alias
</a>
</li>
{% acl_end %}
{% can_create Ipv6List interface.id %}
<li>
<a
href=
"{% url 'machines:index-ipv6' interface.id %}"
>
<i
class=
"fa fa-edit"
></i>
Gerer les ipv6
</a>
</li>
{% acl_end %}
{% can_create OuverturePortList %}
<li>
<a
href=
"{% url 'machines:port-config' interface.id%}"
>
<i
class=
"fa fa-edit"
></i>
Gerer la configuration des ports
</a>
</li>
{% else %}
{{ interface.domain }}
{% endif %}
</td>
<td>
{{ interface.type }}
</td>
<td>
{{ interface.mac_address }}
</td>
<td>
<b>
IPv4
</b>
{{ interface.ipv4 }}
<br>
{% if ipv6_enabled and interface.ipv6 != 'None'%}
<b>
IPv6
</b>
<button
class=
"btn btn-default btn-xs"
type=
"button"
data-toggle=
"collapse"
data-target=
"#collapseIpv6_{{interface.id}}"
aria-expanded=
"true"
aria-controls=
"collapseIpv6_{{interface.id}}"
>
Afficher l'IPV6
</button>
{% endif %}
</td>
<td
class=
"text-right"
>
<div
style=
"width: 128px;"
>
<div
class=
"btn-group"
role=
"group"
>
<button
class=
"btn btn-primary btn-sm dropdown-toggle"
type=
"button"
id=
"editioninterface"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"true"
>
<i
class=
"fa fa-edit"
></i>
<span
class=
"caret"
></span>