diff --git a/app/src/Extensions/CompositeFieldExtension.php b/app/src/Extensions/CompositeFieldExtension.php index b29797b..f0b8313 100644 --- a/app/src/Extensions/CompositeFieldExtension.php +++ b/app/src/Extensions/CompositeFieldExtension.php @@ -11,10 +11,16 @@ use SilverStripe\ORM\DataExtension; class CompositeFieldExtension extends CompositeField { + public function extraClass() + { + return 'composite '.parent::extraClass(); + } + public function getAttributes() { $attrs = parent::getAttributes(); unset($attrs['name'], $attrs['type'], $attrs['disabled'], $attrs['readonly'], $attrs['autofocus']); + return $attrs; } } diff --git a/app/templates/SilverStripe/Forms/CompositeField_holder.ss b/app/templates/SilverStripe/Forms/CompositeField_holder.ss new file mode 100644 index 0000000..59fb7a2 --- /dev/null +++ b/app/templates/SilverStripe/Forms/CompositeField_holder.ss @@ -0,0 +1,7 @@ +<$Tag $AttributesHTML> + <% if $Tag == 'fieldset' && $Legend %> + $Legend + <% end_if %> + + $Field + diff --git a/app/templates/SilverStripe/Forms/FormField_holder.ss b/app/templates/SilverStripe/Forms/FormField_holder.ss new file mode 100644 index 0000000..cd8b14e --- /dev/null +++ b/app/templates/SilverStripe/Forms/FormField_holder.ss @@ -0,0 +1,16 @@ +
+ <% if $Title %><% end_if %> + +
+ $Field +
+ + <% if $Title && $RightTitle %> +
$RightTitle
+ <% else_if $RightTitle %> + + <% end_if %> + + <% if $Message %>$Message<% end_if %> + <% if $Description %>$Description<% end_if %> +
diff --git a/app/templates/SilverStripe/Forms/Includes/Form.ss b/app/templates/SilverStripe/Forms/Includes/Form.ss new file mode 100644 index 0000000..8515e46 --- /dev/null +++ b/app/templates/SilverStripe/Forms/Includes/Form.ss @@ -0,0 +1,27 @@ +<% if $IncludeFormTag %> +
+<% end_if %> + <% if $Message %> +

$Message.RAW

+ <% else %> + + <% end_if %> + +
+ <% if $Legend %>$Legend<% end_if %> + <% loop $Fields %> + $FieldHolder + <% end_loop %> +
+
+ + <% if $Actions %> +
+ <% loop $Actions %> + $Field + <% end_loop %> +
+ <% end_if %> +<% if $IncludeFormTag %> +
+<% end_if %> diff --git a/app/templates/SilverStripe/Forms/OptionsetField_holder.ss b/app/templates/SilverStripe/Forms/OptionsetField_holder.ss new file mode 100644 index 0000000..94c7ecf --- /dev/null +++ b/app/templates/SilverStripe/Forms/OptionsetField_holder.ss @@ -0,0 +1,9 @@ +
+ <% if $Title %>
$Title
<% end_if %> +
+ $Field +
+ <% if $RightTitle %>
$RightTitle
<% end_if %> + <% if $Message %>$Message<% end_if %> + <% if $Description %>$Description<% end_if %> +
diff --git a/app/templates/Site/Widgets/BannerWidget.ss b/app/templates/Site/Widgets/BannerWidget.ss index 8f85dda..dcccaaf 100644 --- a/app/templates/Site/Widgets/BannerWidget.ss +++ b/app/templates/Site/Widgets/BannerWidget.ss @@ -1,4 +1,4 @@ -$Title +$Title <% if $Link %> <% with $Link %> target="_blank"<% end_if %> class="stretched-link">