mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-05 09:26:27 +00:00
L'édition des réglages de multi_op fonctionne
This commit is contained in:
parent
b3333b020d
commit
000d64adf0
3 changed files with 32 additions and 13 deletions
20
multi_op/migrations/0003_auto_20200904_1938.py
Normal file
20
multi_op/migrations/0003_auto_20200904_1938.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.29 on 2020-09-04 17:38
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('multi_op', '0002_auto_20200904_1905'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='multiopoption',
|
||||
name='enabled_dorm',
|
||||
field=models.ManyToManyField(blank=True, related_name='enabled_dorm_multiop', to='topologie.Dormitory', verbose_name='enabled dorm'),
|
||||
),
|
||||
]
|
|
@ -27,13 +27,15 @@ with multiple operators.
|
|||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from re2o.mixins import AclMixin, RevMixin
|
||||
from preferences.models import PreferencesModel
|
||||
|
||||
class Preferences(models.Model):
|
||||
class MultiopOption(AclMixin, PreferencesModel):
|
||||
"""Definition of the settings of multi_op."""
|
||||
|
||||
enabled_dorm = models.ManyToManyField(
|
||||
"topologie.Dormitory",
|
||||
related_name="vlan_tagged",
|
||||
related_name="enabled_dorm_multiop",
|
||||
blank=True,
|
||||
verbose_name=_("enabled dorm"),
|
||||
)
|
||||
|
|
|
@ -8,23 +8,20 @@
|
|||
</h4>
|
||||
</div>
|
||||
|
||||
<div id="collapse_multiop" class="panel-collapse panel-body collapse">
|
||||
{% comment %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'tickets:edit-options' 'TicketOption' %}">
|
||||
<div id="collapse_multiop" class="panel-collapse panel-body collapse">
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'multi_op:edit-options' 'MultiopOption' %}">
|
||||
<i class="fa fa-edit"></i>
|
||||
{% trans "Edit" %}
|
||||
</a>
|
||||
<p></p>
|
||||
{% endcomment %}
|
||||
<p></p>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th><p>{% trans "Enabled Dorm" %}</p></th>
|
||||
<td><p>{{ preferences.enabled_dorm | tick}}</p></td>
|
||||
</tr>
|
||||
<table class="table">
|
||||
</table>
|
||||
<tr>
|
||||
<th><p>{% trans "Enabled Dorm" %}</p></th>
|
||||
<td><p>{{ preferences.enabled_dorm.all|join:", " }}</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue