From 4f774e1864e906bf2f591e6fc9c5e2e99014d8f5 Mon Sep 17 00:00:00 2001 From: Jannis Jahr Date: Wed, 18 Sep 2024 08:35:05 +0200 Subject: [PATCH 1/2] WCM-316: fix alignment of volume and covers and make volume.teaser a large text area --- core/src/zeit/content/volume/browser/form.py | 14 +++++++++----- core/src/zeit/content/volume/interfaces.py | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/src/zeit/content/volume/browser/form.py b/core/src/zeit/content/volume/browser/form.py index ad561fad83..d7f395388c 100644 --- a/core/src/zeit/content/volume/browser/form.py +++ b/core/src/zeit/content/volume/browser/form.py @@ -39,11 +39,6 @@ class Base: ('product', 'year', 'volume', 'date_digital_published', 'volume_note'), css_class='column-left', ), - gocept.form.grouped.Fields( - _('Teaser'), - ('title', 'teaser', 'background_color'), - css_class='wide-widgets column-left', - ), ) def __init__(self, context, request): @@ -83,6 +78,15 @@ def __init__(self, context, request): self.field_groups += ( gocept.form.grouped.Fields(product.title, fieldnames, css_class='column-right'), ) + # Append the teaser field to the teaser group at the end of the dom + # so it is aligned properly + self.field_groups += ( + gocept.form.grouped.Fields( + _('Teaser'), + ('title', 'teaser', 'background_color'), + css_class='wide-widgets column-left', + ), + ) class Add(Base, zeit.cms.browser.form.AddForm): diff --git a/core/src/zeit/content/volume/interfaces.py b/core/src/zeit/content/volume/interfaces.py index 21c38d5733..3097a98571 100644 --- a/core/src/zeit/content/volume/interfaces.py +++ b/core/src/zeit/content/volume/interfaces.py @@ -49,7 +49,7 @@ class IVolume(zeit.cms.content.interfaces.IXMLContent): title = zope.schema.TextLine(title=_('Title'), required=False) - teaser = zope.schema.TextLine(title=_('Teaser'), required=False) + teaser = zope.schema.Text(title=_('Teaser'), required=False) background_color = zope.schema.TextLine( title=_('Area background color (6 characters, no #)'), From f757b08010e89e9efd2d3728d6b2ea716561c64a Mon Sep 17 00:00:00 2001 From: Jannis Jahr Date: Wed, 18 Sep 2024 09:40:44 +0200 Subject: [PATCH 2/2] WCM-316: put COVERS on top of the box as a legend --- .../zeit/content/volume/browser/resources/volume-covers.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/zeit/content/volume/browser/resources/volume-covers.js b/core/src/zeit/content/volume/browser/resources/volume-covers.js index c508cbdfdd..9aea469293 100644 --- a/core/src/zeit/content/volume/browser/resources/volume-covers.js +++ b/core/src/zeit/content/volume/browser/resources/volume-covers.js @@ -15,10 +15,12 @@ $(document).bind('fragment-ready', function(event) { // substring match on "fieldname-cover*", so it might be complicated). $('fieldset.column-right').first().before( '
' + - 'COVERS: ' + '
'); - $('fieldset.column-right legend').each(function(i, element) { + // Iterate through all legends and add them to the select + // ignoring the first legend, because it is the legend for the selection + $('fieldset.column-right legend:not(:first)').each(function(i, element) { $('#choose-cover').append( ''); });