Skip to content

Commit

Permalink
Using variable references
Browse files Browse the repository at this point in the history
  • Loading branch information
robdekort committed Oct 27, 2021
1 parent 6a760a4 commit 98273ad
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion dev/resources/views/email/form_owner.antlers.html
Expand Up @@ -51,7 +51,7 @@
{{ if value && handle !== 'consent' }}
<tr>
<td style='vertical-align:top; font-family:"Source Code Pro", monospace; padding:11px; border-bottom:#e3e3da 1px solid; font-size:14px' valign="top">
<strong>{{ trans key="{display}" locale="{site:locale}" }}:</strong><br>
<strong>{{ trans :key="display" :locale="site:locale" }}:</strong><br>
<pre style="white-space:pre-line; font-family:inherit; margin:0">{{ if (value | is_array) }}<ul>{{ value }}<li>{{ value }}</li>{{ /value }}</ul>{{ else }}{{ value }}{{ /if }}</pre>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion dev/resources/views/email/form_owner_text.antlers.html
Expand Up @@ -8,7 +8,7 @@
-
{{ fields }}
{{ if handle !== 'consent' }}
{{ trans key="{display}" locale="{locale}" }}:
{{ trans :key="display" :locale="locale" }}:
{{ if (value | is_array) }}
{{ value }}
{{ value }}
Expand Down
2 changes: 1 addition & 1 deletion dev/resources/views/email/form_sender.antlers.html
Expand Up @@ -63,7 +63,7 @@
{{ if value && handle !== 'consent' }}
<tr>
<td style='vertical-align:top; font-family:"Source Code Pro", monospace; padding:11px; border-bottom:#e3e3da 1px solid; font-size:14px' valign="top">
<strong>{{ trans key="{display}" locale="{site:locale}" }}:</strong><br>
<strong>{{ trans :key="display" :locale="site:locale" }}:</strong><br>
<pre style="white-space:pre-line; font-family:inherit; margin:0">{{ if (value | is_array) }}<ul>{{ value }}<li>{{ value }}</li>{{ /value }}</ul>{{ else }}{{ value }}{{ /if }}</pre>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion dev/resources/views/email/form_sender_text.antlers.html
Expand Up @@ -13,7 +13,7 @@
-
{{ fields }}
{{ if handle !== 'consent' }}
{{ trans key="{display}" locale="{locale}" }}:
{{ trans :key="display" :locale="locale" }}:
{{ if (value | is_array) }}
{{ value }}
{{ value }}
Expand Down
2 changes: 1 addition & 1 deletion dev/resources/views/snippets/_form_fields.antlers.html
Expand Up @@ -13,7 +13,7 @@
{{ width == '100' ?= 'md:col-span-12' }}"
>
<label class="font-bold" for="{{ handle }}">
{{ trans key="{display}" }}
{{ trans :key="display" }}
{{ if validate | contains:required }}
<sup class="text-yellow-400">*</sup>
{{ /if }}
Expand Down
@@ -1,20 +1,20 @@
<div
class="flex
{{ inline
? 'space-x-4'
: 'flex-col space-y-4'
<div
class="flex
{{ inline
? 'space-x-4'
: 'flex-col space-y-4'
}}"
>
{{ foreach:options as="value|label" }}
<label class="inline-flex items-center">
<input
class="mr-2 rounded border-neutral text-primary focus-visible:ring focus-visible:ring-primary motion-safe:transition"
type="checkbox"
name="{{ handle }}[]"
value="{{ value }}"
<input
class="mr-2 rounded border-neutral text-primary focus-visible:ring focus-visible:ring-primary motion-safe:transition"
type="checkbox"
name="{{ handle }}[]"
value="{{ value }}"
{{ old | in_array:value ?= checked }}
>
{{ trans key="{ label }" }}
{{ trans :key="label" }}
</label>
{{ /foreach:options }}
</div>
</div>
24 changes: 12 additions & 12 deletions dev/resources/views/vendor/statamic/forms/fields/radio.antlers.html
@@ -1,20 +1,20 @@
<div
class="flex
{{ inline
? 'space-x-4'
: 'flex-col space-y-4'
<div
class="flex
{{ inline
? 'space-x-4'
: 'flex-col space-y-4'
}}"
>
{{ foreach:options as="value|label" }}
<label class="inline-flex items-center">
<input
class="mr-2 border-neutral text-primary focus-visible:border-primary focus-visible:ring focus-visible:ring-primary motion-safe:transition"
type="radio"
name="{{ handle }}"
value="{{ value }}"
<input
class="mr-2 border-neutral text-primary focus-visible:border-primary focus-visible:ring focus-visible:ring-primary motion-safe:transition"
type="radio"
name="{{ handle }}"
value="{{ value }}"
{{ old === value ?= "checked" }}
>
{{ trans key="{ label }" }}
{{ trans :key="label" }}
</label>
{{ /foreach:options }}
</div>
</div>
@@ -1,21 +1,21 @@
{{# Bind custom error classses when there is a validation error with the field. #}}
<select
class="w-full rounded border-neutral focus-visible:border-primary focus-visible:ring focus-visible:ring-primary motion-safe:transition"
<select
class="w-full rounded border-neutral focus-visible:border-primary focus-visible:ring focus-visible:ring-primary motion-safe:transition"
:class="{ 'border-red-600 focus-visible:border-red-600': errors.{{ handle }} }"
name="{{ handle }}{{ multiple ?= "[]" }}"
{{ multiple ?= "multiple" }}
name="{{ handle }}{{ multiple ?= "[]" }}"
{{ multiple ?= "multiple" }}
>
{{ unless multiple }}
<option value>{{ trans key="Please select..." }}</option>
{{ /unless }}
{{ foreach:options as="value|label" }}
<option
value="{{ value }}"
<option
value="{{ value }}"
{{ if old|in_array:value or old === value }}
selected
{{ /if }}
>
{{ trans key="{ label }" }}
{{ trans :key="label" }}
</option>
{{ /foreach:options }}
</select>
</select>

0 comments on commit 98273ad

Please sign in to comment.