mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Added descriptions to item categories
This commit is contained in:
26
src/pretix/base/migrations/0020_auto_20160421_1943.py
Normal file
26
src/pretix/base/migrations/0020_auto_20160421_1943.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.9.4 on 2016-04-21 19:43
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import pretix.base.i18n
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('pretixbase', '0019_auto_20160326_1139'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='itemcategory',
|
||||
name='description',
|
||||
field=pretix.base.i18n.I18nTextField(blank=True, verbose_name='Category description'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='questionanswer',
|
||||
name='options',
|
||||
field=models.ManyToManyField(blank=True, related_name='answers', to='pretixbase.QuestionOption'),
|
||||
),
|
||||
]
|
||||
@@ -36,6 +36,9 @@ class ItemCategory(LoggedModel):
|
||||
max_length=255,
|
||||
verbose_name=_("Category name"),
|
||||
)
|
||||
description = I18nTextField(
|
||||
blank=True, verbose_name=_("Category description")
|
||||
)
|
||||
position = models.IntegerField(
|
||||
default=0
|
||||
)
|
||||
|
||||
@@ -16,7 +16,8 @@ class CategoryForm(I18nModelForm):
|
||||
model = ItemCategory
|
||||
localized_fields = '__all__'
|
||||
fields = [
|
||||
'name'
|
||||
'name',
|
||||
'description'
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<fieldset>
|
||||
<legend>{% trans "General information" %}</legend>
|
||||
{% bootstrap_field form.name layout="horizontal" %}
|
||||
{% bootstrap_field form.description layout="horizontal" %}
|
||||
</fieldset>
|
||||
<div class="form-group submit-group">
|
||||
<button type="submit" class="btn btn-primary btn-save">
|
||||
|
||||
@@ -56,7 +56,12 @@
|
||||
{% csrf_token %}
|
||||
{% for tup in items_by_category %}
|
||||
<section>
|
||||
{% if tup.0 %}<h3>{{ tup.0.name }}</h3>{% endif %}
|
||||
{% if tup.0 %}
|
||||
<h3>{{ tup.0.name }}</h3>
|
||||
{% if tup.0.description %}
|
||||
<p>{{ tup.0.description }}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% for item in tup.1 %}
|
||||
{% if item.has_variations %}
|
||||
<div class="item-with-variations">
|
||||
|
||||
Reference in New Issue
Block a user