-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH Pre-render the LinkField in entwine
- Loading branch information
1 parent
746cb83
commit 8a891cd
Showing
9 changed files
with
97 additions
and
11 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,2 +1,15 @@ | ||
<%-- This template is here to bootstrap a LinkField React form field --%> | ||
<%-- It includes some pre-rendered content to provide a nicer UI while waiting for React to boot --%> | ||
<%-- Once React is done pre-rendering, it will discard the pre-rendered markup --%> | ||
<input $AttributesHTML /> | ||
<div data-field-id="$ID" data-schema-component="$SchemaComponent" class="entwine-linkfield" data-types="$TypesProp"></div> | ||
<div data-field-id="$ID" data-schema-component="$SchemaComponent" class="entwine-linkfield" data-types="$TypesProp"> | ||
<div class="link-field__container"> | ||
<% include SilverStripe/LinkField/Form/LinkField_Spinner %> | ||
<div> | ||
<div class="link-picker__link link-picker__link--is-first link-picker__link--is-last form-control link-picker__link--disabled link-picker__link--published" role="button" aria-disabled="false" aria-roledescription="sortable" aria-describedby="" id="link-picker__link-42"> | ||
<button type="button" disabled="" class="link-picker__button font-icon-link btn btn-secondary disabled"></button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
26 changes: 26 additions & 0 deletions
26
templates/SilverStripe/LinkField/Form/LinkField_Spinner.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,26 @@ | ||
<div class="link-field__loading"> | ||
<div class="cms-content-loading-overlay ui-widget-overlay-light"></div> | ||
<div class="cms-content-loading-spinner"> | ||
<div class="spinner"> | ||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="297" viewBox="0 0 512 297" class="spinner__animation"> | ||
<defs> | ||
<path id="spinner__animation__outline_right_be342372-94f2-4867-a6dd-0f9784c8f4be" d="M253 29L145 105C130 115 126 136 137 150C147 165 168 169 183 159L291 83C335 52 397 63 428 107C459 152 448 214 404 245L370 268C398 316 461 296 490 245C520 191 519 123 482 70C430 -4 327 -22 253 29Z"></path> | ||
<path id="spinner__animation__outline_left_be342372-94f2-4867-a6dd-0f9784c8f4be" d="M258 266L366 191C381 180 385 160 374 145C364 130 343 127 328 137L220 212C176 244 114 233 83 188C52 144 63 82 107 51L141 27C113 -20 50 -0 21 51C-8 104 -7 172 29 226C81 300 184 318 258 266V266Z"></path> | ||
<clipPath id="spinner__animation__mask_right_be342372-94f2-4867-a6dd-0f9784c8f4be"> | ||
<use href="#spinner__animation__outline_right_be342372-94f2-4867-a6dd-0f9784c8f4be"></use> | ||
</clipPath> | ||
<clipPath id="spinner__animation__mask_left_be342372-94f2-4867-a6dd-0f9784c8f4be"> | ||
<use href="#spinner__animation__outline_left_be342372-94f2-4867-a6dd-0f9784c8f4be"></use> | ||
</clipPath> | ||
</defs> | ||
<use class="spinner__animation__empty" href="#spinner__animation__outline_left_be342372-94f2-4867-a6dd-0f9784c8f4be"></use> | ||
<use class="spinner__animation__empty" href="#spinner__animation__outline_right_be342372-94f2-4867-a6dd-0f9784c8f4be"></use> | ||
<path d="M 379,145 236,242 C 179,282 102,273 62,216 22,159 19,77 76,37 L 135,7" class="spinner__animation__fill-left" clip-path="url(#spinner__animation__mask_left_be342372-94f2-4867-a6dd-0f9784c8f4be)"></path> | ||
<path d="M 138,148 281,50 c 57,-39 129,-30 169,26 39,56 41,136 -14,178 l -47,40" class="spinner__animation__fill-right" clip-path="url(#spinner__animation__mask_right_be342372-94f2-4867-a6dd-0f9784c8f4be)"></path> | ||
<path d="M253 29L145 105C130 115 126 136 137 150C147 165 168 169 183 159L291 83C335 52 397 63 428 107C459 152 448 214 404 245L370 268C398 316 461 296 490 245C520 191 519 123 482 70C430 -4 327 -22 253 29Z"></path> | ||
</svg> | ||
</div> | ||
</div> | ||
</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,2 +1,35 @@ | ||
<%-- This template is here to bootstrap a MultiLinkField React form field --%> | ||
<%-- It includes some pre-rendered content to provide a nicer UI while waiting for React to boot --%> | ||
<%-- Once React is done pre-rendering, it will discard the pre-rendered markup --%> | ||
<input $AttributesHTML /> | ||
<div data-is-multi="true" data-field-id="$ID" data-schema-component="$SchemaComponent" class="entwine-linkfield" data-types="$TypesProp"></div> | ||
<div data-is-multi="true" data-field-id="$ID" data-schema-component="$SchemaComponent" class="entwine-linkfield" data-types="$TypesProp"> | ||
|
||
<div class="link-field__container"> | ||
<% include SilverStripe/LinkField/Form/LinkField_Spinner %> | ||
<div class="link-picker form-control"> | ||
<div class="link-picker__menu dropdown"> | ||
<button | ||
type="button" | ||
aria-haspopup="true" | ||
aria-expanded="false" | ||
class="link-picker__menu-toggle font-icon-plus-1 dropdown-toggle btn btn-secondary" | ||
aria-label="<%t SilverStripe\LinkField\Models\MultiLinkField.AddLink "Add link" %>"> | ||
<%t SilverStripe\LinkField\Models\MultiLinkField.AddLink "Add link" %> | ||
</button> | ||
</div> | ||
</div> | ||
<div class="link-picker-links"> | ||
<% loop $LinkIDs %> | ||
<div class="link-picker__link form-control link-picker__link--published <% if $IsFirst %>link-picker__link--is-first<% end_if %> <% if $IsLast %>link-picker__link--is-last<% end_if %>"> | ||
<button | ||
type="button" | ||
disabled="" | ||
class="link-picker__button font-icon-link btn btn-secondary disabled" | ||
aria-label="<%t SilverStripe\LinkField\Models\MultiLinkField.EditLink "Edit link" %>"></button> | ||
</div> | ||
<% end_loop %> | ||
</div> | ||
</div> | ||
|
||
</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