Skip to content

Commit

Permalink
Add blocks. (#13)
Browse files Browse the repository at this point in the history
* Add blocks.

* Add data to blocks.

---------

Co-authored-by: jonas <[email protected]>
  • Loading branch information
JoniHoffi and jonas authored May 14, 2024
1 parent 0f7396f commit 7ade51b
Show file tree
Hide file tree
Showing 75 changed files with 2,436 additions and 570 deletions.
20 changes: 20 additions & 0 deletions config/block/AdvancedTextBlock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Block/AdvancedTextBlock:
label: 'Advanced text'
groups: [ layout ]
block_type: true
use:
- App\Entity\Block\Traits\CtaTrait
traits:
- CtaTrait

properties:
text:
template: expanded-choice
columns:
template: expanded-choice
overline:
template: text
headline:
template: headline
copy:
template: wysiwyg
22 changes: 22 additions & 0 deletions config/block/CardBlock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Block/CardBlock:
label: 'Card'
groups: [ layout ]
block_type: true
use:
- App\Entity\Block\Traits\CtaTrait
traits:
- CtaTrait

properties:
gradient:
template: expanded-choice
layouts:
template: expanded-choice
media:
template: file
overline:
template: text
headline:
template: headline
copy:
template: wysiwyg
51 changes: 51 additions & 0 deletions config/block/ContentFlexBlock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Block/ContentFlexBlock:
label: 'Content Flex'
groups: [ layout ]
block_type: true

properties:
layout:
template: expanded-choice
alignment:
template: expanded-choice
headline:
template: headline
items:
template: items
type_options:
singular: item
entry_class: ContentFlexBlockItem
relation:
target_entity: ContentFlexBlockItem::class
mapped_by: contentFlexBlock
form:
options:
entry_type: ContentFlexBlockItemType::class

classes:
Block/ContentFlexBlockItem:
use:
- App\Entity\Block\Traits\CtaTrait
traits:
- CtaTrait

properties:
id:
template: primary-key
contentFlexBlock:
type: ContentFlexBlock
nullable: true
relation:
type: ManyToOne
target_entity: ContentFlexBlock::class
inversed_by: items
position:
template: PositionType
media:
template: picture
overline:
template: text
headline:
template: headline
copy:
template: wysiwyg
10 changes: 10 additions & 0 deletions config/block/QuoteBlock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Block/QuoteBlock:
label: 'Quote'
groups: [ layout ]
block_type: true

properties:
alignment:
template: expanded-choice
text:
template: wysiwyg
36 changes: 36 additions & 0 deletions config/block/TeamBlock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Block/TeamBlock:
label: 'Team'
groups: [ layout ]
block_type: true

properties:
overline:
template: text
headline:
template: headline
items:
template: items
type_options:
singular: item
entry_class: TeamBlockItem
relation:
target_entity: TeamBlockItem::class
mapped_by: teamBlock
form:
options:
entry_type: TeamBlockItemType::class

classes:
Block/TeamBlockItem:
properties:
id:
template: primary-key
teamBlock:
type: TeamBlock
nullable: true
relation:
type: ManyToOne
target_entity: TeamBlock::class
inversed_by: items
position:
template: PositionType
9 changes: 9 additions & 0 deletions config/block/templates/expanded-choice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: string
nullable: true
form:
use:
- Symfony\Component\Form\Extension\Core\Type\ChoiceType
class: ChoiceType
options:
expanded: true
choices: []
16 changes: 16 additions & 0 deletions config/block/templates/file.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
type: FileInterface
type_options:
use:
- Enhavo\Bundle\MediaBundle\Model\FileInterface
nullable: true
relation:
type: ManyToOne
target_entity: FileInterface::class
inversed_by: false
form:
use:
- Enhavo\Bundle\MediaBundle\Form\Type\MediaType
class: MediaType
options:
translation_domain: "'EnhavoMediaBundle'"
multiple: 'false'
8 changes: 8 additions & 0 deletions config/block/templates/headline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: string
nullable: true
form:
use:
- Enhavo\Bundle\FormBundle\Form\Type\HeadLineType
class: HeadlineType
options:
label: "'Headline'"
18 changes: 18 additions & 0 deletions config/block/templates/items.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
type: Collection
allow_setter: false
type_options:
constructor: ArrayCollection
use:
- Doctrine\Common\Collections\Collection
- Doctrine\Common\Collections\ArrayCollection
remover: removeElement
relation:
type: OneToMany
order_by:
position: asc
form:
use:
- Enhavo\Bundle\FormBundle\Form\Type\ListType
class: ListType
options:
sortable: 'true'
16 changes: 16 additions & 0 deletions config/block/templates/picture.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
type: FileInterface
type_options:
use:
- Enhavo\Bundle\MediaBundle\Model\FileInterface
nullable: true
relation:
type: ManyToOne
target_entity: Enhavo\Bundle\MediaBundle\Model\FileInterface
form:
use:
- Enhavo\Bundle\MediaBundle\Form\Type\MediaType
class: MediaType
options:
label: "'Picture'"
help: "'Supported formats are jpeg, gif, png, webp'"
multiple: 'false'
6 changes: 6 additions & 0 deletions config/block/templates/primary-key.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: int
orm_type: integer
orm_primary_key: true
orm_generated_value_type: AUTO
nullable: true
allow_setter: false
12 changes: 12 additions & 0 deletions config/block/templates/sidebar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type: string
nullable: true
default: SidebarAwareInterface::SIDEBAR_OFF
type_options:
use:
- App\Model\SidebarAwareInterface
form:
options:
expanded: "true"
use:
- App\Form\Type\Block\Core\SidebarType
class: SidebarType
6 changes: 6 additions & 0 deletions config/block/templates/text.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: string
nullable: true
form:
use:
- Symfony\Component\Form\Extension\Core\Type\TextType
class: TextType
17 changes: 17 additions & 0 deletions config/block/templates/video.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
type: FileInterface
type_options:
use:
- Enhavo\Bundle\MediaBundle\Model\FileInterface
nullable: true
relation:
type: ManyToOne
target_entity: Enhavo\Bundle\MediaBundle\Model\FileInterface
form:
use:
- Enhavo\Bundle\MediaBundle\Form\Type\MediaType
class: MediaType
options:
label: "'Video'"
help: "'Supported formats are mp4'"
multiple: 'false'
upload: 'false'
7 changes: 7 additions & 0 deletions config/block/templates/wysiwyg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: string
orm_type: text
nullable: true
form:
use:
- Enhavo\Bundle\FormBundle\Form\Type\WysiwygType
class: WysiwygType
2 changes: 1 addition & 1 deletion config/packages/doctrine_migrations.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
doctrine_migrations:
migrations_paths:
'App\Migration': '%kernel.project_dir%/src/Migration'
'App\Migration': '%kernel.project_dir%/migrations'
6 changes: 6 additions & 0 deletions config/packages/enhavo_app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ enhavo_app:
type: page
navigation:
type: navigation
team_member:
type: base
label: Team
icon: people
route: app_team_member_index

# backup:
# type: backup
43 changes: 27 additions & 16 deletions config/packages/enhavo_block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,32 @@ imports:

enhavo_block:
blocks:
picture:
type: picture
# picture:
# type: picture
gallery:
type: gallery
text:
type: text
text_picture:
type: text_picture
blockquote:
type: blockquote
video:
type: video
one_column:
type: one_column
two_column:
type: two_column
three_column:
type: three_column
# text:
# type: text
# text_picture:
# type: text_picture
# blockquote:
# type: blockquote
# video:
# type: video
# one_column:
# type: one_column
# two_column:
# type: two_column
# three_column:
# type: three_column
card:
type: card
content_flex:
type: content_flex
team:
type: team
advanced_text:
type: advanced_text
quote:
type: quote

4 changes: 3 additions & 1 deletion config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ security:

access_control:
- { path: ^/admin/login$, role: PUBLIC_ACCESS }
- { path: ^/admin/login/check$, role: PUBLIC_ACCESS }
- { path: ^/admin/api/login$, role: PUBLIC_ACCESS }
- { path: ^/admin/reset-password/.+, role: PUBLIC_ACCESS }
- { path: ^/admin/api/reset-password/.+, role: PUBLIC_ACCESS }
- { path: ^/admin/, role: ROLE_ADMIN }


- { path: ^/user/login$, role: PUBLIC_ACCESS }
- { path: ^/user/login/check$, role: PUBLIC_ACCESS }
- { path: ^/user/registration/.+, role: PUBLIC_ACCESS }
Expand Down
14 changes: 7 additions & 7 deletions config/packages/sylius_resource.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# @see https://github.com/Sylius/SyliusResourceBundle/blob/master/docs/index.md
sylius_resource:
# Override default settings
#settings:

# Configure your resources
resources:
#app.book:
#classes:
#model: App\Entity\Book
app.team_member:
classes:
model: App\Entity\TeamMember
controller: Enhavo\Bundle\AppBundle\Controller\ResourceController
form: App\Form\Type\TeamMemberType
repository: App\Repository\TeamMemberRepository

6 changes: 6 additions & 0 deletions config/packages/vue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
enhavo_app:
vue:
route_providers:
admin:
type: routing
groups: ['admin']
Loading

0 comments on commit 7ade51b

Please sign in to comment.