-
Notifications
You must be signed in to change notification settings - Fork 821
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API Update core templates for CompositeField / SelectionGroup.ss
- Loading branch information
Damian Mooyman
committed
Jul 28, 2016
1 parent
7a095b1
commit c556b01
Showing
8 changed files
with
83 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<% if $Tag == 'fieldset' && $Legend %> | ||
<legend>$Legend</legend> | ||
<% end_if %> | ||
<% loop $FieldList %> | ||
$FieldHolder | ||
<% end_loop %> |
17 changes: 17 additions & 0 deletions
17
admin/themes/cms-forms/templates/forms/CompositeField_holder.ss
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,17 @@ | ||
<div id="$HolderID" class="form-group field<% if $extraClass %> $extraClass<% end_if %>"> | ||
<% if $Title %> | ||
<label for="$ID" id="title-$ID" class="form__field-label">$Title</label> | ||
<% end_if %> | ||
<$Tag id="$ID" <% include AriaAttributes %> | ||
class="form__fieldgroup form__field-holder | ||
<% if not $Title %> form__field-holder--no-label<% end_if %> | ||
<% if $Zebra %> form__fieldgroup-zebra<% end_if %> | ||
<% if $extraClass %> $extraClass<% end_if %>" | ||
> | ||
$Field | ||
<%-- TODO: change $MessageType to match Bootstraps alert types, e.g. alert-info, alert-danger etc --%> | ||
<% if $Message %><p class="alert $MessageType" role="alert" id="message-$ID">$Message</p><% end_if %> | ||
<% if $Description %><p class="form__field-description" id="describes-$ID">$Description</p><% end_if %> | ||
</$Tag> | ||
<% if $RightTitle %><p class="form__field-extra-label" id="extra-label-$ID">$RightTitle</p><% end_if %> | ||
</div> |
17 changes: 17 additions & 0 deletions
17
admin/themes/cms-forms/templates/forms/CompositeField_holder_small.ss
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,17 @@ | ||
<div id="$HolderID" class="form__fieldgroup-item field field--small<% if $extraClass %> $extraClass<% end_if %>"> | ||
<% if $Title %> | ||
<label for="$ID" id="title-$ID" class="form__fieldgroup-label">$Title</label> | ||
<% end_if %> | ||
<$Tag id="$ID" | ||
<% if $Title %>aria-labelledby="title-$ID"<% end_if %> | ||
class="form__fieldgroup form__field-holder | ||
<% if not $Title %> form__field-holder--no-label<% end_if %> | ||
<% if $Zebra %> form__fieldgroup-zebra<% end_if %> | ||
<% if $extraClass %> $extraClass<% end_if %>" | ||
> | ||
<%-- Note: _holder_small.ss overrides CompositeField.ss to force nested $SmallFieldHolder --%> | ||
<% loop $FieldList %> | ||
$SmallFieldHolder | ||
<% end_loop %> | ||
</$Tag> | ||
</div> |
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 |
---|---|---|
@@ -1,21 +1,25 @@ | ||
<div class="form-group selection-group"> | ||
<ul class="form__field-holder form__field-holder--no-label SelectionGroup<% if $extraClass %> $extraClass<% end_if %>"> | ||
<% if $IsReadonly %> | ||
<% loop $FieldSet %> | ||
<% if $Selected %> | ||
<li class="selected selection-group__item"> | ||
$RadioLabel | ||
$SmallFieldHolder | ||
</li> | ||
<% end_if %> | ||
<% end_loop %> | ||
<% else %> | ||
<% loop $FieldSet %> | ||
<li class="selection-group__item<% if $Selected %> selected<% end_if %>"> | ||
{$RadioButton}{$RadioLabel} | ||
$SmallFieldHolder | ||
<ul> | ||
<% if $IsReadonly %> | ||
<% loop $FieldSet %> | ||
<% if $Selected %> | ||
<li class="selected selection-group__item"> | ||
$RadioLabel | ||
<%-- Bypass composite item field and directly render child fields --%> | ||
<% loop $FieldList %> | ||
$Field | ||
<% end_loop %> | ||
</li> | ||
<% end_loop %> | ||
<% end_if %> | ||
</ul> | ||
</div> | ||
<% end_if %> | ||
<% end_loop %> | ||
<% else %> | ||
<% loop $FieldSet %> | ||
<li class="selection-group__item<% if $Selected %> selected<% end_if %>"> | ||
{$RadioButton}{$RadioLabel} | ||
<%-- Bypass composite item field and directly render child fields --%> | ||
<% loop $FieldList %> | ||
$Field | ||
<% end_loop %> | ||
</li> | ||
<% end_loop %> | ||
<% end_if %> | ||
</ul> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
<$Tag class="CompositeField $extraClass <% if ColumnCount %>multicolumn<% end_if %>"> | ||
<% if $Tag == 'fieldset' && $Legend %> | ||
<legend>$Legend</legend> | ||
<% end_if %> | ||
|
||
<% loop $FieldList %> | ||
<% if $ColumnCount %> | ||
<div class="column-{$ColumnCount} $FirstLast"> | ||
$Field | ||
</div> | ||
<% else %> | ||
<% loop $FieldList %> | ||
<% if $ColumnCount %> | ||
<div class="column-{$ColumnCount} $FirstLast"> | ||
$Field | ||
<% end_if %> | ||
<% end_loop %> | ||
</$Tag> | ||
</div> | ||
<% else %> | ||
$Field | ||
<% end_if %> | ||
<% end_loop %> |
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 |
---|---|---|
@@ -1,17 +1,7 @@ | ||
<$Tag class="CompositeField $extraClass <% if ColumnCount %>multicolumn<% end_if %>" id="$HolderID"> | ||
<$Tag class="CompositeField $extraClass <% if $ColumnCount %>multicolumn<% end_if %>" id="$HolderID"> | ||
<% if $Tag == 'fieldset' && $Legend %> | ||
<legend>$Legend</legend> | ||
<% end_if %> | ||
|
||
<% loop $FieldList %> | ||
<% if $ColumnCount %> | ||
<div class="column-{$ColumnCount} $FirstLast"> | ||
$FieldHolder | ||
</div> | ||
<% else %> | ||
$FieldHolder | ||
<% end_if %> | ||
<% end_loop %> | ||
|
||
<% if $Description %><span class="description">$Description</span><% end_if %> | ||
$Field | ||
</$Tag> |
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