-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CIVIC-1493] Added webform related fixes.
- Loading branch information
1 parent
e3b7127
commit a1cf1e6
Showing
8 changed files
with
108 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
web/themes/contrib/civictheme/templates/form/container.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{# | ||
/** | ||
* @file | ||
* Default theme implementation of a container used to wrap child elements. | ||
* | ||
* Used for grouped form items. Can also be used as a theme wrapper for any | ||
* renderable element, to surround it with a <div> and HTML attributes. | ||
* See \Drupal\Core\Render\Element\RenderElement for more | ||
* information on the #theme_wrappers render array property, and | ||
* \Drupal\Core\Render\Element\container for usage of the container render | ||
* element. | ||
* | ||
* Available variables: | ||
* - attributes: HTML attributes for the containing element. | ||
* - children: The rendered child elements of the container. | ||
* - has_parent: A flag to indicate that the container has one or more parent | ||
containers. | ||
* | ||
* @see template_preprocess_container() | ||
* | ||
* @ingroup themeable | ||
*/ | ||
#} | ||
{% set classes = [ | ||
has_parent ? 'js-form-wrapper form-wrapper', | ||
modifier_class ? modifier_class, | ||
'ct-contianer', | ||
] %} | ||
<div {{ attributes.addClass(classes) }}> | ||
{{ children }} | ||
</div> |
8 changes: 8 additions & 0 deletions
8
web/themes/contrib/civictheme/templates/form/fieldset.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{# | ||
/** | ||
* @file | ||
* CivicTheme theme implementation to display a fieldset. | ||
*/ | ||
#} | ||
{% include '@atoms/fieldset/fieldset.twig' %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
web/themes/contrib/civictheme/templates/webform/webform.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{# | ||
/** | ||
* @file | ||
* Webform component. | ||
* | ||
* Variables: | ||
* - attributes: [string] Additional attributes. | ||
* - modifier_class: [string] Additional classes. | ||
*/ | ||
#} | ||
|
||
{% set theme_class = 'ct-theme-%s'|format(theme|default('light')) %} | ||
{% set modifier_class = '%s %s'|format(theme_class, modifier_class) %} | ||
|
||
<form class="ct-webform {{ modifier_class }}" {{ attributes }}> | ||
{{ title_prefix }} | ||
{{ children }} | ||
{{ title_suffix }} | ||
</form> |