mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 22:22:26 +00:00
affichage des ports plus naturel
This commit is contained in:
parent
f39ae95b35
commit
cf9d37dc54
3 changed files with 87 additions and 30 deletions
|
@ -24,6 +24,64 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
|
||||||
{% load acl %}
|
{% load acl %}
|
||||||
|
|
||||||
|
|
||||||
|
<div class="table-responsive" style="font-size: 12px">
|
||||||
|
<table class="table table-bordered text-center text-nowrap">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
{% for port in port_list|slice:"::2" %}
|
||||||
|
<td class="bg-primary text-white">{{ port.port }}</td>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
{% for port in port_list|slice:"::2" %}
|
||||||
|
<td class="p-3 mb-2 bg-success text-dark">
|
||||||
|
{% if port.room %}
|
||||||
|
{{ port.room }}
|
||||||
|
{% elif port.machine_interface %}
|
||||||
|
<a href="{% url 'users:profil' userid=port.machine_interface.machine.user.id %}">{{ port.machine_interface }}</a>
|
||||||
|
{% elif port.related%}
|
||||||
|
<a href="{% url 'topologie:index-port' switchid=port.related.switch.id %}">{{ port.related }}</a>
|
||||||
|
{% else %}
|
||||||
|
Vide
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
{% for port in port_list|slice:"1::2" %}
|
||||||
|
<td class="bg-primary text-white">{{ port.port }}</td>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
{% for port in port_list|slice:"1::2" %}
|
||||||
|
<td class="p-3 mb-2 bg-success text-dark">
|
||||||
|
{% if port.room %}
|
||||||
|
{{ port.room }}
|
||||||
|
{% elif port.machine_interface %}
|
||||||
|
<a href="{% url 'users:profil' userid=port.machine_interface.machine.user.id %}">{{ port.machine_interface }}</a>
|
||||||
|
{% elif port.related%}
|
||||||
|
<a href="{% url 'topologie:index-port' switchid=port.related.switch.id %}">{{ port.related }}</a>
|
||||||
|
{% else %}
|
||||||
|
Vide
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="table-responsive">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -76,3 +134,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
|
|
@ -35,6 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-port' id_switch %}"><i class="fa fa-plus"></i> Ajouter un port</a>
|
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-port' id_switch %}"><i class="fa fa-plus"></i> Ajouter un port</a>
|
||||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:create-ports' id_switch %}"><i class="fa fa-plus"></i> Ajouter des ports</a>
|
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:create-ports' id_switch %}"><i class="fa fa-plus"></i> Ajouter des ports</a>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
<hr>
|
||||||
{% include "topologie/aff_port.html" with port_list=port_list %}
|
{% include "topologie/aff_port.html" with port_list=port_list %}
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
|
|
@ -548,15 +548,15 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, PermissionsMix
|
||||||
'welcome_mail_en': mailmessageoptions.welcome_mail_en,
|
'welcome_mail_en': mailmessageoptions.welcome_mail_en,
|
||||||
'pseudo': self.pseudo,
|
'pseudo': self.pseudo,
|
||||||
})
|
})
|
||||||
send_mail(
|
#send_mail(
|
||||||
'Bienvenue au %(name)s / Welcome to %(name)s' % {
|
# 'Bienvenue au %(name)s / Welcome to %(name)s' % {
|
||||||
'name': AssoOption.get_cached_value('name')
|
# 'name': AssoOption.get_cached_value('name')
|
||||||
},
|
# },
|
||||||
'',
|
# '',
|
||||||
GeneralOption.get_cached_value('email_from'),
|
# GeneralOption.get_cached_value('email_from'),
|
||||||
[self.email],
|
# [self.email],
|
||||||
html_message=template.render(context)
|
# html_message=template.render(context)
|
||||||
)
|
#)
|
||||||
return
|
return
|
||||||
|
|
||||||
def reset_passwd_mail(self, request):
|
def reset_passwd_mail(self, request):
|
||||||
|
@ -576,14 +576,14 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, PermissionsMix
|
||||||
reverse('users:process', kwargs={'token': req.token})),
|
reverse('users:process', kwargs={'token': req.token})),
|
||||||
'expire_in': str(GeneralOption.get_cached_value('req_expire_hrs')) + ' heures',
|
'expire_in': str(GeneralOption.get_cached_value('req_expire_hrs')) + ' heures',
|
||||||
}
|
}
|
||||||
send_mail(
|
#send_mail(
|
||||||
'Changement de mot de passe du %(name)s / Password\
|
# 'Changement de mot de passe du %(name)s / Password\
|
||||||
renewal for %(name)s' % {'name': AssoOption.get_cached_value('name')},
|
# renewal for %(name)s' % {'name': AssoOption.get_cached_value('name')},
|
||||||
template.render(context),
|
# template.render(context),
|
||||||
GeneralOption.get_cached_value('email_from'),
|
# GeneralOption.get_cached_value('email_from'),
|
||||||
[req.user.email],
|
# [req.user.email],
|
||||||
fail_silently=False
|
# fail_silently=False
|
||||||
)
|
#)
|
||||||
return
|
return
|
||||||
|
|
||||||
def autoregister_machine(self, mac_address, nas_type):
|
def autoregister_machine(self, mac_address, nas_type):
|
||||||
|
@ -892,8 +892,8 @@ def user_post_save(sender, **kwargs):
|
||||||
Synchronise le ldap"""
|
Synchronise le ldap"""
|
||||||
is_created = kwargs['created']
|
is_created = kwargs['created']
|
||||||
user = kwargs['instance']
|
user = kwargs['instance']
|
||||||
if is_created:
|
#if is_created:
|
||||||
user.notif_inscription()
|
#user.notif_inscription()
|
||||||
user.ldap_sync(base=True, access_refresh=True, mac_refresh=False, group_refresh=True)
|
user.ldap_sync(base=True, access_refresh=True, mac_refresh=False, group_refresh=True)
|
||||||
regen('mailing')
|
regen('mailing')
|
||||||
|
|
||||||
|
@ -1127,22 +1127,19 @@ class Ban(RevMixin, AclMixin, models.Model):
|
||||||
'date_end': self.date_end,
|
'date_end': self.date_end,
|
||||||
'asso_name': AssoOption.get_cached_value('name'),
|
'asso_name': AssoOption.get_cached_value('name'),
|
||||||
})
|
})
|
||||||
send_mail(
|
#send_mail(
|
||||||
'Deconnexion disciplinaire',
|
# 'Deconnexion disciplinaire',
|
||||||
template.render(context),
|
# template.render(context),
|
||||||
GeneralOption.get_cached_value('email_from'),
|
# GeneralOption.get_cached_value('email_from'),
|
||||||
[self.user.email],
|
# [self.user.email],
|
||||||
fail_silently=False
|
# fail_silently=False
|
||||||
)
|
#)
|
||||||
return
|
return
|
||||||
|
|
||||||
def is_active(self):
|
def is_active(self):
|
||||||
"""Ce ban est-il actif?"""
|
"""Ce ban est-il actif?"""
|
||||||
return self.date_end > timezone.now()
|
return self.date_end > timezone.now()
|
||||||
|
|
||||||
def get_instance(banid, *args, **kwargs):
|
|
||||||
return Ban.objects.get(pk=banid)
|
|
||||||
|
|
||||||
def can_view(self, user_request, *args, **kwargs):
|
def can_view(self, user_request, *args, **kwargs):
|
||||||
"""Check if an user can view a Ban object.
|
"""Check if an user can view a Ban object.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue