mirror of https://gitlab.federez.net/re2o/re2o
11 changed files with 213 additions and 19 deletions
@ -0,0 +1,42 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('machines', '0024_machinetype_need_infra'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='IpType', |
|||
fields=[ |
|||
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)), |
|||
('type', models.CharField(max_length=255)), |
|||
('need_infra', models.BooleanField(default=False)), |
|||
('extension', models.ForeignKey(to='machines.Extension', on_delete=django.db.models.deletion.PROTECT)), |
|||
], |
|||
), |
|||
migrations.RemoveField( |
|||
model_name='machinetype', |
|||
name='extension', |
|||
), |
|||
migrations.RemoveField( |
|||
model_name='machinetype', |
|||
name='need_infra', |
|||
), |
|||
migrations.AlterField( |
|||
model_name='iplist', |
|||
name='ip_type', |
|||
field=models.ForeignKey(to='machines.IpType', on_delete=django.db.models.deletion.PROTECT), |
|||
), |
|||
migrations.AddField( |
|||
model_name='machinetype', |
|||
name='ip_type', |
|||
field=models.ForeignKey(to='machines.IpType', null=True, blank=True, on_delete=django.db.models.deletion.PROTECT), |
|||
), |
|||
] |
|||
@ -0,0 +1,21 @@ |
|||
<table class="table table-striped"> |
|||
<thead> |
|||
<tr> |
|||
<th>Type d'ip</th> |
|||
<th>Extension</th> |
|||
<th>Nécessite l'autorisation infra</th> |
|||
<th></th> |
|||
<th></th> |
|||
</tr> |
|||
</thead> |
|||
{% for type in iptype_list %} |
|||
<tr> |
|||
<td>{{ type.type }}</td> |
|||
<td>{{ type.extension }}</td> |
|||
<td>{{ type.need_infra }}</td> |
|||
<td>{% if is_infra %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:edit-iptype' type.id %}"><i class="glyphicon glyphicon-pushpin"></i> Editer</a>{% endif %}</td> |
|||
<td><a class="btn btn-info btn-sm" role="button" href="{% url 'machines:history' 'iptype' type.id %}"><i class="glyphicon glyphicon-repeat"></i> Historique</a></td> |
|||
</tr> |
|||
{% endfor %} |
|||
</table> |
|||
|
|||
@ -0,0 +1,17 @@ |
|||
{% extends "machines/sidebar.html" %} |
|||
{% load bootstrap3 %} |
|||
|
|||
{% block title %}Ip{% endblock %} |
|||
|
|||
{% block content %} |
|||
<h2>Liste des types d'ip</h2> |
|||
{% if is_infra %} |
|||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-iptype' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un type d'ip</a> |
|||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-iptype' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un ou plusieurs types d'ip</a> |
|||
{% endif %} |
|||
{% include "machines/aff_iptype.html" with iptype_list=iptype_list %} |
|||
<br /> |
|||
<br /> |
|||
<br /> |
|||
{% endblock %} |
|||
|
|||
@ -0,0 +1,19 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('users', '0035_auto_20161018_0046'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='user', |
|||
name='state', |
|||
field=models.IntegerField(default=0, choices=[(0, 'STATE_ACTIVE'), (1, 'STATE_DISABLED'), (2, 'STATE_ARCHIVE')]), |
|||
), |
|||
] |
|||
Loading…
Reference in new issue