diff --git a/combo/apps/search/forms.py b/combo/apps/search/forms.py index 44735c67..a3f47acf 100644 --- a/combo/apps/search/forms.py +++ b/combo/apps/search/forms.py @@ -27,7 +27,7 @@ from .models import SearchCell class SearchCellForm(forms.ModelForm): class Meta: model = SearchCell - fields = ('autofocus', 'input_placeholder') + fields = ('title', 'autofocus', 'input_placeholder') class SelectWithDisabled(forms.Select): diff --git a/combo/apps/search/migrations/0011_title.py b/combo/apps/search/migrations/0011_title.py new file mode 100644 index 00000000..24dadcef --- /dev/null +++ b/combo/apps/search/migrations/0011_title.py @@ -0,0 +1,16 @@ +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('search', '0010_searchcell_template_name'), + ] + + operations = [ + migrations.AddField( + model_name='searchcell', + name='title', + field=models.CharField(blank=True, max_length=150, verbose_name='Title'), + ), + ] diff --git a/combo/apps/search/models.py b/combo/apps/search/models.py index 0fae2505..c11ba844 100644 --- a/combo/apps/search/models.py +++ b/combo/apps/search/models.py @@ -53,6 +53,7 @@ class SearchCell(CellBase): exclude_from_search = True _search_services = JSONField(_('Search Services'), default=dict, blank=True) + title = models.CharField(_('Title'), max_length=150, blank=True) autofocus = models.BooleanField(_('Autofocus'), default=False) input_placeholder = models.CharField(_('Placeholder'), max_length=64, default="", blank=True) diff --git a/combo/apps/search/templates/combo/search-cell.html b/combo/apps/search/templates/combo/search-cell.html index ddf08298..68126676 100644 --- a/combo/apps/search/templates/combo/search-cell.html +++ b/combo/apps/search/templates/combo/search-cell.html @@ -1,5 +1,8 @@ {% load i18n %} {% block cell-content %} +{% if cell.title %} +