LocationGroupCategory help text
This commit is contained in:
parent
8bfc591331
commit
069b0021d8
3 changed files with 33 additions and 4 deletions
|
@ -115,11 +115,13 @@ class EditorFormBase(I18nModelFormMixin, ModelForm):
|
|||
name = 'group_'+category.name
|
||||
initial = initial[0] if initial else ''
|
||||
choices = (('', '---'), )+choices
|
||||
field = ChoiceField(label=category.title, required=False, initial=initial, choices=choices)
|
||||
field = ChoiceField(label=category.title, required=False, initial=initial, choices=choices,
|
||||
help_text=category.help_text)
|
||||
else:
|
||||
name = 'groups_'+category.name
|
||||
field = MultipleChoiceField(label=category.title_plural, required=False,
|
||||
initial=initial, choices=choices)
|
||||
initial=initial, choices=choices,
|
||||
help_text=category.help_text)
|
||||
self.fields[name] = field
|
||||
|
||||
if 'category' in self.fields:
|
||||
|
@ -262,8 +264,8 @@ class EditorFormBase(I18nModelFormMixin, ModelForm):
|
|||
|
||||
|
||||
def create_editor_form(editor_model):
|
||||
possible_fields = ['slug', 'name', 'title', 'title_plural', 'icon', 'join_edges', 'up_separate', 'walk',
|
||||
'ordering', 'category', 'width', 'groups', 'color', 'priority', 'icon_name',
|
||||
possible_fields = ['slug', 'name', 'title', 'title_plural', 'help_text', 'icon', 'join_edges', 'up_separate',
|
||||
'walk', 'ordering', 'category', 'width', 'groups', 'color', 'priority', 'icon_name',
|
||||
'base_altitude', 'waytype', 'access_restriction', 'height', 'default_height', 'door_height',
|
||||
'outside', 'can_search', 'can_describe', 'geometry', 'single', 'altitude', 'short_label',
|
||||
'origin_space', 'target_space', 'data', 'comment', 'slow_down_factor',
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
# Generated by Django 2.1.4 on 2018-12-23 16:46
|
||||
|
||||
import c3nav.mapdata.fields
|
||||
from decimal import Decimal
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('mapdata', '0006_location_icon'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='locationgroupcategory',
|
||||
name='help_text',
|
||||
field=c3nav.mapdata.fields.I18nField(fallback_any=True, fallback_value='', plural_name='help_texts', verbose_name='Help text'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='area',
|
||||
name='slow_down_factor',
|
||||
field=models.DecimalField(decimal_places=2, default=1, help_text='values of overlapping areas get multiplied!', max_digits=6, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='slow down factor'),
|
||||
),
|
||||
]
|
|
@ -221,6 +221,7 @@ class LocationGroupCategory(SerializableMixin, models.Model):
|
|||
single = models.BooleanField(_('single selection'), default=False)
|
||||
title = I18nField(_('Title'), plural_name='titles', fallback_any=True)
|
||||
title_plural = I18nField(_('Title (Plural)'), plural_name='titles_plural', fallback_any=True)
|
||||
help_text = I18nField(_('Help text'), plural_name='help_texts', fallback_any=True, fallback_value='')
|
||||
allow_levels = models.BooleanField(_('allow levels'), db_index=True, default=True)
|
||||
allow_spaces = models.BooleanField(_('allow spaces'), db_index=True, default=True)
|
||||
allow_areas = models.BooleanField(_('allow areas'), db_index=True, default=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue