FIX: WAVE updates

This commit is contained in:
Tony Air 2020-07-01 16:02:39 +07:00
parent a8218b8082
commit bc7fea884a
6 changed files with 66 additions and 1 deletions

View File

@ -11,10 +11,16 @@ use SilverStripe\ORM\DataExtension;
class CompositeFieldExtension extends CompositeField class CompositeFieldExtension extends CompositeField
{ {
public function extraClass()
{
return 'composite '.parent::extraClass();
}
public function getAttributes() public function getAttributes()
{ {
$attrs = parent::getAttributes(); $attrs = parent::getAttributes();
unset($attrs['name'], $attrs['type'], $attrs['disabled'], $attrs['readonly'], $attrs['autofocus']); unset($attrs['name'], $attrs['type'], $attrs['disabled'], $attrs['readonly'], $attrs['autofocus']);
return $attrs; return $attrs;
} }
} }

View File

@ -0,0 +1,7 @@
<$Tag $AttributesHTML>
<% if $Tag == 'fieldset' && $Legend %>
<legend>$Legend</legend>
<% end_if %>
$Field
</$Tag>

View File

@ -0,0 +1,16 @@
<div id="$HolderID" class="field<% if $extraClass %> $extraClass<% end_if %>">
<% if $Title %><label class="left" for="$ID">$Title</label><% end_if %>
<div class="middleColumn">
$Field
</div>
<% if $Title && $RightTitle %>
<div class="right">$RightTitle</div>
<% else_if $RightTitle %>
<label class="right" for="$ID">$RightTitle</label>
<% end_if %>
<% if $Message %><span class="message $MessageType">$Message</span><% end_if %>
<% if $Description %><span class="description">$Description</span><% end_if %>
</div>

View File

@ -0,0 +1,27 @@
<% if $IncludeFormTag %>
<form $AttributesHTML>
<% end_if %>
<% if $Message %>
<p id="{$FormName}_error" class="message $MessageType">$Message.RAW</p>
<% else %>
<p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
<% end_if %>
<fieldset>
<% if $Legend %><legend>$Legend</legend><% end_if %>
<% loop $Fields %>
$FieldHolder
<% end_loop %>
<div class="clear"><!-- --></div>
</fieldset>
<% if $Actions %>
<div class="btn-toolbar">
<% loop $Actions %>
$Field
<% end_loop %>
</div>
<% end_if %>
<% if $IncludeFormTag %>
</form>
<% end_if %>

View File

@ -0,0 +1,9 @@
<div id="$HolderID" class="field<% if $extraClass %> $extraClass<% end_if %>">
<% if $Title %><div class="left">$Title</div><% end_if %>
<div class="middleColumn">
$Field
</div>
<% if $RightTitle %><div class="right">$RightTitle</div><% end_if %>
<% if $Message %><span class="message $MessageType">$Message</span><% end_if %>
<% if $Description %><span class="description">$Description</span><% end_if %>
</div>

View File

@ -1,4 +1,4 @@
<img src="$Image.Fill(432,324).URL" alt="$Title" /> <img src="$Image.Fill(432,315).URL" alt="$Title" />
<% if $Link %> <% if $Link %>
<% with $Link %> <% with $Link %>
<a href="$URL"<% if $OpenInNewWindow %> target="_blank"<% end_if %> class="stretched-link"> <a href="$URL"<% if $OpenInNewWindow %> target="_blank"<% end_if %> class="stretched-link">