From 72a80d98cdea9e0c95fae4dcd4e2a7cf8a62cc68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 31 May 2015 14:03:06 +0200 Subject: [PATCH] add title to galleries --- .../migrations/0003_gallerycell_title.py | 20 +++++++++++++++++++ combo/apps/gallery/models.py | 1 + .../templates/combo/gallery_manager.html | 5 +++++ 3 files changed, 26 insertions(+) create mode 100644 combo/apps/gallery/migrations/0003_gallerycell_title.py diff --git a/combo/apps/gallery/migrations/0003_gallerycell_title.py b/combo/apps/gallery/migrations/0003_gallerycell_title.py new file mode 100644 index 00000000..57cb09c3 --- /dev/null +++ b/combo/apps/gallery/migrations/0003_gallerycell_title.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('gallery', '0002_image_title'), + ] + + operations = [ + migrations.AddField( + model_name='gallerycell', + name='title', + field=models.CharField(max_length=50, null=True, verbose_name='Title', blank=True), + preserve_default=True, + ), + ] diff --git a/combo/apps/gallery/models.py b/combo/apps/gallery/models.py index 5f4e2671..ac41a231 100644 --- a/combo/apps/gallery/models.py +++ b/combo/apps/gallery/models.py @@ -24,6 +24,7 @@ from combo.data.library import register_cell_class @register_cell_class class GalleryCell(CellBase): + title = models.CharField(_('Title'), max_length=50, blank=True, null=True) manager_form_template = 'combo/gallery_manager.html' class Meta: diff --git a/combo/apps/gallery/templates/combo/gallery_manager.html b/combo/apps/gallery/templates/combo/gallery_manager.html index 9131c218..438a7e3d 100644 --- a/combo/apps/gallery/templates/combo/gallery_manager.html +++ b/combo/apps/gallery/templates/combo/gallery_manager.html @@ -2,6 +2,10 @@ {% load static thumbnail i18n %} {% block cell-form %} +
+{% csrf_token %} + {{ form.as_p }} +