@@ -354,3 +354,100 @@ class Meta:
354354 label = _ ("Logo Image" ),
355355 required = False ,
356356 )
357+
358+
359+ @components .register
360+ class RelatedPeople (CMSFrontendComponent ):
361+ """Related People component"""
362+
363+ class Meta :
364+ name = _ ("Related People" )
365+ render_template = "related_people/related_people.html"
366+ allow_children = True
367+ child_classes = [
368+ "HeadingPlugin" ,
369+ "PeopleCardPlugin" ,
370+ ]
371+ mixins = ["Background" , "Spacing" , "Attributes" ]
372+
373+ eyebrow_text = forms .CharField (
374+ label = _ ("Eyebrow text" ),
375+ required = False ,
376+ )
377+
378+ eyebrow_text_color = forms .ChoiceField (
379+ label = _ ("Eyebrow text color" ),
380+ choices = settings .DJANGOCMS_FRONTEND_COLOR_STYLE_CHOICES ,
381+ required = False ,
382+ initial = "default" ,
383+ widget = ColoredButtonGroup (attrs = {"class" : "flex-wrap" }),
384+ help_text = _ ("Eyebrow text color." ),
385+ )
386+
387+ grid_columns = forms .ChoiceField (
388+ label = _ ("Grid columns" ),
389+ choices = [
390+ ("1" , _ ("1" )),
391+ ("2" , _ ("2" )),
392+ ("3" , _ ("3" )),
393+ ],
394+ initial = "3" ,
395+ help_text = _ ("Number of grid columns." ),
396+ )
397+
398+
399+ @components .register
400+ class PeopleCard (CMSFrontendComponent ):
401+ """People card component"""
402+
403+ class Meta :
404+ name = _ ("People Card" )
405+ render_template = "related_people/person_card.html"
406+ allow_children = True
407+ parent_classes = [
408+ "RelatedPeoplePlugin" ,
409+ ]
410+ child_classes = [
411+ "ImagePlugin" ,
412+ "TextPlugin" ,
413+ "HeadingPlugin" ,
414+ "TextLinkPlugin" ,
415+ ]
416+ mixins = ["Background" , "Spacing" , "Attributes" ]
417+
418+ image_accent = forms .BooleanField (
419+ label = _ ("Image accent" ),
420+ required = False ,
421+ initial = False ,
422+ help_text = _ ("Add image accent" ),
423+ )
424+
425+ image_accent_color = forms .ChoiceField (
426+ label = _ ("Image accent color" ),
427+ choices = settings .DJANGOCMS_FRONTEND_COLOR_STYLE_CHOICES ,
428+ required = False ,
429+ initial = "primary" ,
430+ help_text = _ ("Image accent color." ),
431+ widget = ColoredButtonGroup (attrs = {"class" : "flex-wrap" }),
432+ )
433+
434+ role = forms .CharField (
435+ label = _ ("Role" ),
436+ required = False ,
437+ help_text = _ ("Role displayed in people card." ),
438+ )
439+
440+ description = HTMLFormField (
441+ label = _ ("Description" ),
442+ required = False ,
443+ help_text = _ ("Description displayed in people card." ),
444+ )
445+
446+ text_color = forms .ChoiceField (
447+ label = _ ("Text Color" ),
448+ choices = settings .DJANGOCMS_FRONTEND_COLOR_STYLE_CHOICES ,
449+ required = False ,
450+ initial = "dark" ,
451+ help_text = _ ("Card content text color." ),
452+ widget = ColoredButtonGroup (attrs = {"class" : "flex-wrap" }),
453+ )
0 commit comments