Skip to content

Commit

Permalink
Merge pull request #854 from ZeitOnline/WCM-316_adjust-volume-form
Browse files Browse the repository at this point in the history
WCM-316: fix alignment of volume and covers and make volume.teaser a large text area
  • Loading branch information
stollero committed Sep 19, 2024
2 parents 3450f30 + f757b08 commit db3900c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
14 changes: 9 additions & 5 deletions core/src/zeit/content/volume/browser/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'<fieldset class="column-right choose">' +
'<b>COVERS:</b> <select id="choose-cover">' +
'<legend>COVERS</legend> <select id="choose-cover">' +
'</select></fieldset>');

$('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(
'<option>' + $(element).text() + '</option>');
});
Expand Down
2 changes: 1 addition & 1 deletion core/src/zeit/content/volume/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 #)'),
Expand Down

0 comments on commit db3900c

Please sign in to comment.