simplified rules ui

This commit is contained in:
Gani Georgiev
2023-03-04 13:05:55 +02:00
parent a67c14c368
commit e8d61e7b45
2 changed files with 3 additions and 17 deletions

View File

@@ -53,7 +53,7 @@
</div>
{:else}
<Field
class="form-field rule-field m-0 {required ? 'requied' : ''} {isAdminOnly ? 'disabled' : ''}"
class="form-field rule-field {required ? 'requied' : ''} {isAdminOnly ? 'disabled' : ''}"
name={formKey}
let:uniqueId
>
@@ -93,20 +93,11 @@
bind:value={rule}
baseCollection={collection}
disabled={isAdminOnly}
placeholder={!isAdminOnly ? "Leave empty to grant everyone access..." : ""}
/>
<div class="help-block">
<slot {isAdminOnly}>
<p>
{#if isAdminOnly}
Only admins will be able to perform this action (
<button type="button" class="link-primary" on:click={unlock}>unlock to change</button>
).
{:else}
Leave empty to grant everyone access.
{/if}
</p>
</slot>
<slot {isAdminOnly} />
</div>
</Field>
{/if}