From c32c72c3f4640ede867907b4c8de8811a508a6c3 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 6 Jun 2020 23:09:53 +0200 Subject: tiling styles --- frontend/views/page/components/tile.form.js | 56 +++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 11 deletions(-) (limited to 'frontend/views/page/components/tile.form.js') diff --git a/frontend/views/page/components/tile.form.js b/frontend/views/page/components/tile.form.js index c5f5c0b..1d15296 100644 --- a/frontend/views/page/components/tile.form.js +++ b/frontend/views/page/components/tile.form.js @@ -30,6 +30,10 @@ const REQUIRED_KEYS = { text: ['content'], } +const IMAGE_TILE_STYLES = [ + 'tile', 'cover', 'contain', 'contain no-repeat' +].map(style => ({ name: style, label: style })) + // target_page_id = Column(Integer, ForeignKey('page.id'), nullable=True) // https://s3.amazonaws.com/i.asdf.us/im/1c/gradient_gold1-SpringGreen1_1321159749.jpg @@ -37,6 +41,7 @@ const newImage = (data) => ({ settings: { ...newPosition(), is_tiled: false, + tile_style: 'tile', url: "", }, type: 'image', @@ -222,6 +227,14 @@ class TileForm extends Component { } } + handleDelete() { + const { temporaryTile, isNew } = this.props + const tile_id = temporaryTile.id + if (confirm('Really delete this tile?')) { + actions.tile.delete(temporaryTile.id) + } + } + render() { const { temporaryTile, isNew } = this.props const { title, submitTitle, errorFields } = this.state @@ -255,10 +268,19 @@ class TileForm extends Component { ? this.renderTextForm() : ""} - +
+ + {!isNew && + + } +
{!!errorFields.size &&