Skip to content

Commit

Permalink
ZO-6370: rename image grid to image row
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinnaj94 committed Nov 14, 2024
1 parent a6dd771 commit 8e8f64e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions core/src/zeit/content/article/edit/browser/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -827,11 +827,11 @@
permission="zope.View"
/>

<!-- ImageGrid -->
<!-- ImageRow -->


<browser:viewlet
for="zeit.content.article.edit.interfaces.IImageGrid"
for="zeit.content.article.edit.interfaces.IImageRow"
layer="zeit.cms.browser.interfaces.ICMSLayer"
view="zope.interface.Interface"
manager="zeit.edit.interfaces.IContentViewletManager"
Expand All @@ -841,7 +841,7 @@
/>

<browser:page
for="zeit.content.article.edit.interfaces.IImageGrid"
for="zeit.content.article.edit.interfaces.IImageRow"
layer="zeit.cms.browser.interfaces.ICMSLayer"
name="edit-image-grid"
class=".edit.EditImageGrid"
Expand Down
8 changes: 4 additions & 4 deletions core/src/zeit/content/article/edit/browser/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,10 @@ def prefix(self):

class EditImageGrid(zeit.edit.browser.form.InlineForm):
legend = ''
form_fields = zope.formlib.form.FormFields(
zeit.content.article.edit.interfaces.IImageGrid
).omit(*list(zeit.edit.interfaces.IBlock))
form_fields = zope.formlib.form.FormFields(zeit.content.article.edit.interfaces.IImageRow).omit(
*list(zeit.edit.interfaces.IBlock)
)

@property
def prefix(self):
return 'image_grid.{0}'.format(self.context.__name__)
return 'image_row.{0}'.format(self.context.__name__)
6 changes: 3 additions & 3 deletions core/src/zeit/content/article/edit/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,13 @@
/>
</class>

<class class=".image_grid.ImageGrid">
<class class=".image_row.ImageRow">
<require
interface=".interfaces.IImageGrid"
interface=".interfaces.IImageRow"
permission="zope.View"
/>
<require
set_schema=".interfaces.IImageGrid"
set_schema=".interfaces.IImageRow"
permission="zeit.EditContent"
/>
</class>
Expand Down
16 changes: 8 additions & 8 deletions core/src/zeit/content/article/edit/image_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
import zeit.content.article.edit.interfaces


@grok.implementer(zeit.content.article.edit.interfaces.IImageGrid)
class ImageGrid(zeit.content.article.edit.block.Block):
@grok.implementer(zeit.content.article.edit.interfaces.IImageRow)
class ImageRow(zeit.content.article.edit.block.Block):
def __init__(self, context, xml):
# call base constructor
super(ImageGrid, self).__init__(context, xml)
super(ImageRow, self).__init__(context, xml)
# set xml object to default template, if it has no body
if not self.xml.xpath('//body'):
self.xml.append(lxml.etree.Element('body'))

type = 'image_grid'
type = 'image_row'

show_caption = ObjectPathAttributeProperty(
'.', 'show_caption', zeit.content.article.edit.interfaces.IImageGrid['show_caption']
'.', 'show_caption', zeit.content.article.edit.interfaces.IImageRow['show_caption']
)
_display_mode = zeit.cms.content.property.ObjectPathAttributeProperty('.', 'display_mode')
_variant_name = zeit.cms.content.property.ObjectPathAttributeProperty('.', 'variant_name')
size = ObjectPathAttributeProperty(
'.', 'size', zeit.content.article.edit.interfaces.IImageGrid['size']
'.', 'size', zeit.content.article.edit.interfaces.IImageRow['size']
)
images = zeit.cms.content.reference.MultiResource('.body.image', 'image')

Expand Down Expand Up @@ -70,5 +70,5 @@ def variant_name(self, value):


class Factory(zeit.content.article.edit.block.BlockFactory):
produces = ImageGrid
title = _('Image Grid')
produces = ImageRow
title = _('Image Row')
2 changes: 1 addition & 1 deletion core/src/zeit/content/article/edit/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ class ImageGridAspectRationSource(zeit.cms.content.sources.SimpleDictSource):
}


class IImageGrid(IBlock):
class IImageRow(IBlock):
show_caption = zope.schema.Bool(title=_('Show caption'), required=False, default=True)
size = zope.schema.Choice(
title=_('Size'),
Expand Down
2 changes: 1 addition & 1 deletion core/src/zeit/content/article/edit/tests/modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
<module id="video">Video</module>
<module id="volume">Ausgabe</module>
<module id="videotagesschau">ARD Video</module>
<module id="image_grid">Bilder-Grid</module>
<module id="image_row">Bilderreihe</module>
</modules>

0 comments on commit 8e8f64e

Please sign in to comment.