Browse Source

L'édition des réglages de multi_op fonctionne

fix_multi_op_pref
Gabriel Detraz 5 years ago
committed by Gabriel Detraz
parent
commit
000d64adf0
  1. 20
      multi_op/migrations/0003_auto_20200904_1938.py
  2. 6
      multi_op/preferences/models.py
  3. 7
      multi_op/templates/multi_op/preferences.html

20
multi_op/migrations/0003_auto_20200904_1938.py

@ -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'),
),
]

6
multi_op/preferences/models.py

@ -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"),
)

7
multi_op/templates/multi_op/preferences.html

@ -9,21 +9,18 @@
</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' %}">
<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 %}
<div class="table-responsive">
<table class="table">
<tr>
<th><p>{% trans "Enabled Dorm" %}</p></th>
<td><p>{{ preferences.enabled_dorm | tick}}</p></td>
<td><p>{{ preferences.enabled_dorm.all|join:", " }}</p></td>
</tr>
<table class="table">
</table>
</div>
</div>

Loading…
Cancel
Save