Commit 6113de33 authored by Krophil's avatar Krophil
Browse files

Add comment in product type

parent cd4b0d8e
Pipeline #1379 passed with stage
in 5 minutes and 59 seconds
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('counter', '0015_merge'),
]
operations = [
migrations.AddField(
model_name='producttype',
name='comment',
field=models.TextField(verbose_name='comment', blank=True, null=True),
),
]
......@@ -112,6 +112,7 @@ class ProductType(models.Model):
"""
name = models.CharField(_('name'), max_length=30)
description = models.TextField(_('description'), null=True, blank=True)
comment = models.TextField(_('comment'), null=True, blank=True)
icon = models.ImageField(upload_to='products', null=True, blank=True)
class Meta:
......
......@@ -688,7 +688,7 @@ class ProductTypeCreateView(CounterAdminTabsMixin, CounterAdminMixin, CreateView
A create view for the admins
"""
model = ProductType
fields = ['name', 'description', 'icon']
fields = ['name', 'description', 'comment', 'icon']
template_name = 'core/create.jinja'
current_tab = "products"
......@@ -699,7 +699,7 @@ class ProductTypeEditView(CounterAdminTabsMixin, CounterAdminMixin, UpdateView):
"""
model = ProductType
template_name = 'core/edit.jinja'
fields = ['name', 'description', 'icon']
fields = ['name', 'description', 'comment', 'icon']
pk_url_kwarg = "type_id"
current_tab = "products"
......
......@@ -41,6 +41,10 @@
{% for t in categories %}
{% if eboutic.products.filter(product_type=t).exists() %}
<h5>{{ t }}</h5>
{% if t.comment %}
<p>{{ t.comment }}</p>
{% endif %}
<br />
{% for p in eboutic.products.filter(product_type=t).all() %}
{% set file = None %}
{% if p.icon %}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment