Skip to content

Commit

Permalink
Merge branch '263731-webform-demo' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbutura committed May 1, 2024
2 parents 166d9fb + 21bca69 commit f4ef398
Show file tree
Hide file tree
Showing 8 changed files with 357 additions and 174 deletions.
6 changes: 4 additions & 2 deletions config/sync/editor.editor.webform_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ settings:
- heading5
- heading6
ckeditor5_list:
reversed: true
startIndex: true
properties:
reversed: true
startIndex: true
multiBlock: true
ckeditor5_sourceEditing:
allowed_tags: { }
image_upload: { }
4 changes: 3 additions & 1 deletion config/sync/field.field.node.page.field_banner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dependencies:
config:
- field.storage.node.field_banner
- media.type.image
- media.type.vector
- node.type.page
id: node.page.field_banner
field_name: field_banner
Expand All @@ -21,9 +22,10 @@ settings:
handler_settings:
target_bundles:
image: image
vector: vector
sort:
field: _none
direction: ASC
auto_create: false
auto_create_bundle: ''
auto_create_bundle: image
field_type: entity_reference
1 change: 0 additions & 1 deletion config/sync/views.view.webform_submissions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ display:
default_argument_type: fixed
default_argument_options:
argument: ''
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
Expand Down
393 changes: 223 additions & 170 deletions config/sync/webform.webform.survey.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions web/themes/custom/parc/css/components/webform/webform.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions web/themes/custom/parc/parc.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -503,3 +503,8 @@ m--video--slideshow:
- core/drupal
- core/jquery
- core/once

webform:
css:
component:
css/components/webform/webform.css: { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.webform-submission-form {
.webform-section {
.webform-section-title {
font-size: 24px;
font-weight: bold;
margin-bottom: 20px;

@media (--md) {
margin-left: 330px;
}
}

.webform-section-wrapper {
.form-item {
margin-bottom: 40px;

@media (--md) {
display: grid;
grid-template-columns: 300px auto;
grid-gap: 30px;
}

&.js-form-type-checkbox,
&.js-form-type-radio {
margin-bottom: 0;
align-items: center;
display: flex;
gap: 7px;

input {
margin: 0 !important;
}
}

&.js-form-type-checkbox {
input {
border-radius: 5px;
}
}

label, legend {
font-size: 14px;
font-weight: 600;

&:after {
width: 0;
}
}

.form-control {
padding: 4px 12px;
}

input, textarea {
border: 1px solid #000;
}
}

.flex-container {
@media (--lg) {
display: flex;
gap: 30px;

.form-item:last-child {
gap: 10px;
}
}
}
}
}

.form-actions {
margin-top: 30px;

.btn-primary {
font-weight: 600;
font-size: 14px;
text-transform: uppercase;
padding: 7px 15px;
line-height: 18px;

&:hover {
text-decoration: none;
}
}

@media (--md) {
margin-left: 330px;
}
}
}
30 changes: 30 additions & 0 deletions web/themes/custom/parc/templates/webform.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{#
/**
* @file
* Theme implementation for a 'webform' element.
*
* This is an copy of the webform.html.twig theme_wrapper which includes the
* 'title_prefix' and 'title_suffix' variables needed for
* contextual links to appear.
*
* Available variables
* - attributes: A list of HTML attributes for the wrapper element.
* - children: The child elements of the webform.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
*
* @see template_preprocess_webform()
* @see _webform_form_after_build()
*
* @ingroup themeable
*/
#}
{{ attach_library('parc/webform') }}

<form{{ attributes }}>
{{ title_prefix }}
{{ children }}
{{ title_suffix }}
</form>

0 comments on commit f4ef398

Please sign in to comment.