Based on parent ticket #2438.
_Do not push live until around Feb 5._
Valentine's DayHome tab
@kristinashu should the new category Valentine's Day be available on CMS before Feb 5(ish)?
From our slack convo: not necessary since there aren't very many new products
Let's update the tabs so that empty categories (ones with only draft products) don't show up. That way when we add the category in the CMS and flip all products from draft to published, it automatically appears.
@alanmoo @Pomax If we want to add a new category called Valentine's Day and make it show as the first item in the category list on website's nav (note that "Home" doesn't count since it's not a product category), what would be the best approach?
Valentine's Day in via migration# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-23 21:12
from __future__ import unicode_literals
from django.db import migrations
def create_vday_category(apps, schema_editor):
BuyersGuideProductCategory = apps.get_model("buyersguide", "BuyersGuideProductCategory")
BuyersGuideProductCategory.objects.get_or_create(name="Valentine's Day")
class Migration(migrations.Migration):
dependencies = [
('buyersguide', '0018_product_is_draft'),
]
operations = [
migrations.RunPython(create_vday_category, migrations.RunPython.noop),
]
category list, if name matches Valentine's Day, make that category show first.BuyersGuideProductCategory model so it includes a new field Featured (boolean)Valentine's Day in with Featured set to True.Featured category firstThoughts?
Isn't there a way to make the whole model orderable via the admin UI? I feel like @gideonthomas has done that in the past. (And I don't think there's a need to run a manual migration, we can add the category in the production UI as long as we add the check for categories having published products.)
I see in the codebase we have django-admin-sortable for Highlight and Person but I can't tell what that is for as they both don't seem to be sortable on Wagtail admin?
Oh damn, that's right. The Wagtail admin squashes that functionality.
Ok, go with option 2, but also make sure that the category has live products in it before showing it.
While you're doing this, you can probably knock out #2519 too.
@alanmoo
go with option 2, but also make sure that the category has live products in it before showing it
Wondering if that Featured field should be CMS'able and if so, how do we want that field to look? A new dropdown field "Featured Product Category" below "Product Category"?

Oh yes, it totally should be CMS'able.
I was thinking the featured category would just be in the same list as other products (since a product can already be in multiple categories), and then the "featured" boolean happens on the category edit admin view. I'm not tied to that if there's a better option, but including "Featured Product Category" on each product seems like we could technically end up with multiple featured categories.