Skip to content

Commit

Permalink
Merge pull request #405 from itk-dev/feature/1289-files-paragraph
Browse files Browse the repository at this point in the history
Files paragraph
  • Loading branch information
yepzdk authored May 13, 2024
2 parents 05553f1 + 05280b6 commit eed18ed
Show file tree
Hide file tree
Showing 12 changed files with 190 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Versioning](https://semver.org/spec/v2.0.0.html).

* [PR-406](https://github.com/itk-dev/hoeringsportal/pull/406)
Infobox styling
* [PR-405](https://github.com/itk-dev/hoeringsportal/pull/405)
Add paragraph for files

## [4.3.0] - 2024-04-29

* [PR-402](https://github.com/itk-dev/hoeringsportal/pull/402)
Project list filters: remove categories
* [PR-395](https://github.com/itk-dev/hoeringsportal/pull/395)
Project fixtures
* [PR-398](https://github.com/itk-dev/hoeringsportal/pull/398)
Expand Down
34 changes: 34 additions & 0 deletions config/sync/core.entity_form_display.paragraph.files.default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
uuid: 458df720-e0e0-4169-bdcb-c3b73826dfaf
langcode: da
status: true
dependencies:
config:
- field.field.paragraph.files.field_files
- field.field.paragraph.files.field_title
- paragraphs.paragraphs_type.files
id: paragraph.files.default
targetEntityType: paragraph
bundle: files
mode: default
content:
field_files:
type: entity_reference_autocomplete
weight: 1
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
field_title:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
hidden:
created: true
status: true
31 changes: 31 additions & 0 deletions config/sync/core.entity_view_display.paragraph.files.default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
uuid: 007ebc45-761d-4581-bec4-1a3746342f72
langcode: da
status: true
dependencies:
config:
- field.field.paragraph.files.field_files
- field.field.paragraph.files.field_title
- paragraphs.paragraphs_type.files
id: paragraph.files.default
targetEntityType: paragraph
bundle: files
mode: default
content:
field_files:
type: entity_reference_entity_view
label: hidden
settings:
view_mode: material_display
link: false
third_party_settings: { }
weight: 1
region: content
field_title:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 0
region: content
hidden: { }
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies:
- field.storage.node.field_content_sections
- node.type.project_main_page
- paragraphs.paragraphs_type.content_block
- paragraphs.paragraphs_type.files
- paragraphs.paragraphs_type.image
- paragraphs.paragraphs_type.info_box
- paragraphs.paragraphs_type.introduction
Expand Down Expand Up @@ -35,6 +36,7 @@ settings:
info_box: info_box
introduction: introduction
teaser_row: teaser_row
files: files
negate: 0
target_bundles_drag_drop:
content_block:
Expand All @@ -43,6 +45,9 @@ settings:
content_list:
weight: -20
enabled: false
files:
weight: 13
enabled: true
image:
weight: -22
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies:
- field.storage.node.field_content_sections
- node.type.project_page
- paragraphs.paragraphs_type.content_block
- paragraphs.paragraphs_type.files
- paragraphs.paragraphs_type.image
- paragraphs.paragraphs_type.info_box
- paragraphs.paragraphs_type.introduction
Expand Down Expand Up @@ -34,6 +35,7 @@ settings:
info_box: info_box
introduction: introduction
teaser_row: teaser_row
files: files
text_aside_blocks_2_column: text_aside_blocks_2_column
negate: 0
target_bundles_drag_drop:
Expand All @@ -43,6 +45,9 @@ settings:
content_list:
weight: -18
enabled: false
files:
weight: 13
enabled: true
image:
weight: -20
enabled: true
Expand Down
31 changes: 31 additions & 0 deletions config/sync/field.field.paragraph.files.field_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
uuid: 6ea32cf8-12f7-4989-b7c0-b3c6fe0f5887
langcode: da
status: true
dependencies:
config:
- field.storage.paragraph.field_files
- media.type.document
- media.type.image
- paragraphs.paragraphs_type.files
id: paragraph.files.field_files
field_name: field_files
entity_type: paragraph
bundle: files
label: Files
description: 'Used to reference the files'
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
handler: 'default:media'
handler_settings:
target_bundles:
image: image
document: document
sort:
field: _none
direction: ASC
auto_create: false
auto_create_bundle: image
field_type: entity_reference
19 changes: 19 additions & 0 deletions config/sync/field.field.paragraph.files.field_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
uuid: 57f24aa7-0238-4330-8266-f6c9e9307704
langcode: da
status: true
dependencies:
config:
- field.storage.paragraph.field_title
- paragraphs.paragraphs_type.files
id: paragraph.files.field_title
field_name: field_title
entity_type: paragraph
bundle: files
label: Title
description: 'Used for the title'
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
20 changes: 20 additions & 0 deletions config/sync/field.storage.paragraph.field_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
uuid: b3aa2101-054f-4c60-821b-3b39df4efe02
langcode: da
status: true
dependencies:
module:
- media
- paragraphs
id: paragraph.field_files
field_name: field_files
entity_type: paragraph
type: entity_reference
settings:
target_type: media
module: core
locked: false
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
10 changes: 10 additions & 0 deletions config/sync/paragraphs.paragraphs_type.files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
uuid: 50378b6f-ed0f-41ae-98af-1afa956943b0
langcode: da
status: true
dependencies: { }
id: files
label: Files
icon_uuid: null
icon_default: null
description: 'Used to upload files that the user can download'
behavior_plugins: { }
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"module/signup",
"module/list",
"module/pager",
"module/paragraph-files",
"module/info_box",
"module/search",
"module/newsletter",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.paragraph-files article {
background-color: $color-petroleum-100;
padding: $spacer;
margin-bottom: calc($spacer * 0.25);
display: flex;
}

.paragraph-files article svg {
order: 1;
}

.paragraph-files article span {
order: 2;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{# Paragraph for exposing downloadable files #}

<div class="container">
<div class="row">
<div class="col-md-8">
{% block paragraph %}
{% if content.field_title['#items'] is not empty %}
<h2>{{ content.field_title }}</h2>
{% endif %}
{% block content %}
<div class="paragraph-files d-flex flex-column">
{{ content|without('field_title') }}
</div>
{% endblock %}
{% endblock paragraph %}
</div>
</div>
</div>

0 comments on commit eed18ed

Please sign in to comment.